netcdf does not build with `BUILD_SHARED_LIBS=OFF` on MacOS
netcdf does not build with BUILD_SHARED_LIBS=OFF
on MacOS
steps to repro:
cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_netcdf=ON ../src/selftest
make
2023-10-28T06:55:28.2507240Z [ 77%] Linking C shared module lib__nch5misc.dylib
2023-10-28T06:55:28.3429890Z ld: warning: dylib (/usr/local/lib/libzstd.dylib) was built for newer macOS version (12.0) than being linked (10.9)
2023-10-28T06:55:28.4034120Z [ 78%] Building C object plugins/CMakeFiles/h5noop.dir/H5Znoop.c.o
2023-10-28T06:55:28.4134090Z Undefined symbols for architecture x86_64:
2023-10-28T06:55:28.4235720Z "_SZ_BufftoBuffCompress", referenced from:
2023-10-28T06:55:28.4336290Z _H5Z__filter_szip in libhdf5.a(H5Zszip.c.o)
2023-10-28T06:55:28.4436960Z "_SZ_BufftoBuffDecompress", referenced from:
2023-10-28T06:55:28.4537600Z _H5Z__filter_szip in libhdf5.a(H5Zszip.c.o)
2023-10-28T06:55:28.4638050Z "_SZ_encoder_enabled", referenced from:
2023-10-28T06:55:28.4738220Z _H5Z_init in libhdf5.a(H5Z.c.o)
2023-10-28T06:55:28.4838960Z ld: symbol(s) not found for architecture x86_64
2023-10-28T06:55:28.4940030Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2023-10-28T06:55:28.5040080Z make[5]: *** [plugins/lib__nch5misc.dylib] Error 1
2023-10-28T06:55:28.5140470Z make[4]: *** [plugins/CMakeFiles/h5misc.dir/all] Error 2
2023-10-28T06:55:28.5240740Z make[4]: *** Waiting for unfinished jobs....
2023-10-28T06:55:28.5341740Z [ 78%] Building C object libsrc/CMakeFiles/netcdf3.dir/posixio.c.o
2023-10-28T06:55:28.6271490Z [ 79%] Building C object plugins/CMakeFiles/h5noop.dir/H5Zutil.c.o
2023-10-28T06:55:28.7618700Z [ 80%] Linking C shared module lib__nch5noop.dylib
2023-10-28T06:55:28.8674400Z ld: warning: dylib (/usr/local/lib/libzstd.dylib) was built for newer macOS version (12.0) than being linked (10.9)
2023-10-28T06:55:28.9266720Z Undefined symbols for architecture x86_64:
2023-10-28T06:55:28.9267850Z "_SZ_BufftoBuffCompress", referenced from:
2023-10-28T06:55:28.9269400Z _H5Z__filter_szip in libhdf5.a(H5Zszip.c.o)
2023-10-28T06:55:28.9275620Z "_SZ_BufftoBuffDecompress", referenced from:
2023-10-28T06:55:28.9279700Z _H5Z__filter_szip in libhdf5.a(H5Zszip.c.o)
2023-10-28T06:55:28.9284860Z "_SZ_encoder_enabled", referenced from:
2023-10-28T06:55:28.9286270Z _H5Z_init in libhdf5.a(H5Z.c.o)
2023-10-28T06:55:28.9296710Z ld: symbol(s) not found for architecture x86_64
2023-10-28T06:55:28.9316960Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2023-10-28T06:55:28.9341940Z make[5]: *** [plugins/lib__nch5noop.dylib] Error 1
2023-10-28T06:55:28.9344930Z make[4]: *** [plugins/CMakeFiles/h5noop.dir/all] Error 2
2023-10-28T06:55:30.4939010Z [ 80%] Built target netcdf3
2023-10-28T06:55:30.4947050Z make[3]: *** [all] Error 2
2023-10-28T06:55:30.4952710Z CMake Error at /Users/runner/work/f3d-superbuild/f3d-superbuild/fsbb/superbuild/sb-netcdf-build.cmake:47 (message):
2023-10-28T06:55:30.4953660Z Failed with exit code 2
Caused by this !598 (merged).
Specifically caused by the fix to NOT use system zlib.