Skip to content

Instantly share code, notes, and snippets.

@Alexander-Barth
Last active June 9, 2022 09:33
Show Gist options
  • Save Alexander-Barth/f3d0e20892abe171d3d4ed095435678f to your computer and use it in GitHub Desktop.
Save Alexander-Barth/f3d0e20892abe171d3d4ed095435678f to your computer and use it in GitHub Desktop.
NetCDF MSYS2 julia
# see https://github.com/Alexander-Barth/NetCDF-CI-Builder
pacman -Syu
pacman -Syu
pacman -S git emacs diffutils mingw-w64-x86_64-gdb mingw-w64-x86_64-netcdf \
mingw-w64-x86_64-hdf5 mingw-w64-x86_64-gcc m4 mingw-w64-x86_64-make make patch \
autoconf automake libtool
git clone https://github.com/Unidata/netcdf-c
git clone https://github.com/Alexander-Barth/Yggdrasil
$HOME/AppData/Local/Programs/Julia-1.7.2/bin/julia.exe --eval ' using NetCDF_jll; NC_NETCDF4 = 0x1000; ccall((:nc_create, libnetcdf), Cint, (Cstring, Cint, Ptr{Cint}), "test.nc4", NC_NETCDF4, Ref(Cint(0)))'
cd netcdf-c/
git checkout v4.8.1
patch -p1 < ~/Yggdrasil/N/NetCDF/bundled/patches/0001-Fix-a-number-of-OS-specific-bugs.patch
patch -p1 < ~/Yggdrasil/N/NetCDF/bundled/patches/0002-include-getopt.h-if-available.patch
patch -p1 < ~/Yggdrasil/N/NetCDF/bundled/patches/0003-_fpclass-not-defined-on-mingw.patch
patch -p1 < ~/Yggdrasil/N/NetCDF/bundled/patches/0004-save-rc-in-globalstate-rcinfo.triples.patch
export CFLAGS="-std=c99"
LDFLAGS_MAKE="${LDFLAGS} ${LIBS} -no-undefined -Wl,--export-all-symbols"
./configure --disable-testsets --enable-shared --disable-static --disable-dap-remote-tests
make LDFLAGS=" -no-undefined -Wl,--export-all-symbols"
make check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment