diff --git a/build_all_libs.sh b/build_all_libs.sh new file mode 100644 index 000000000..b78d7aef4 --- /dev/null +++ b/build_all_libs.sh @@ -0,0 +1,282 @@ +#!/bin/bash +# Build all (or some subset) of the libraries. + +#### +#Define Target locations, files. +#### +HOMEDIR=`pwd` +TARGBASEDIR="$HOMEDIR/netcdf-windows/" +mkdir -p $TARGBASEDIR +LOGFILE="$HOMEDIR/buildall_log.txt" + +#### +# 32-bit directories +#### +CLASSIC32STATDIR="$HOMEDIR/nc-32-classic-static" +NC432STATDIR="$HOMEDIR/nc-32-nc4-static" +NC4DAP32STATDIR="$HOMEDIR/nc-32-dap-static" +CLASSIC32DLLDIR="$HOMEDIR/nc-32-classic-dll" +NC432DLLDIR="$HOMEDIR/nc-32-nc4-dll" +NC4DAP32DLLDIR="$HOMEDIR/nc-32-dap-dll" + +#### +# 64-bit directories +#### +CLASSIC64STATDIR="$HOMEDIR/nc-64-classic-static" +NC464STATDIR="$HOMEDIR/nc-64-nc4-static" +NC4DAP64STATDIR="$HOMEDIR/nc-64-dap-static" +CLASSIC64DLLDIR="$HOMEDIR/nc-64-classic-dll" +NC464DLLDIR="$HOMEDIR/nc-64-nc4-dll" +NC4DAP64DLLDIR="$HOMEDIR/nc-64-dap-dll" + +#### +#Define CFLAGS, LDFLAGS related to dependency locations. +#### +CMNFLAGS="--disable-doxygen" + +STATICFLAGS="--enable-static --disable-shared" +SHAREDFLAGS="--disable-static --enable-shared --enable-dll" + +MINFLAGS="--disable-dap --disable-netcdf-4" + +STATICCFLAGS="-static" +STATICLDFLAGS="-static" + +#HDF5 +HDF5DIR="/c/Users/wfisher/Desktop/hdf5-1.8.9/" +HDF5INCDIR="$HDF5DIR/src" +HDF532DLLDIR="$HDF5DIR/build_win32_dll/bin" +HDF532LIBDIR="$HDF5DIR/build_win32_static/bin" + +#SZIP +SZIPDIR="/c/Users/wfisher/Desktop/szip-2.1/" +SZIP32LIBS="/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin" + +#ZLIB +ZLIBDIR="/c/Users/wfisher/Desktop/zlib125dll" +ZLIB32LIB="$ZLIBDIR/static32" +ZLIB32DLL="$ZLIBDIR/dll32" +ZLIB64LIB="$ZLIBDIR/staticx64" +ZLIB64DLL="$ZLIBDIR/dllx64" + +#CURL +CURLDIR="/c/Users/wfisher/Desktop/curl-7.25.0" +CURL32INCDIR="$CURLDIR/build_win32/include/" +CURL32LIBS="$CURLDIR/build_win32/lib/.libs" + +if [ $# -lt 1 ]; then + echo "Usage: $0 [clean/all] [deps]" + exit 0 +fi + +if [ $1 == "clean" ]; then + echo "Cleaning up." + set -x + rm -rf $LOGFILE + rm -rf $CLASSIC32STATDIR \ + $NC432STATDIR $NC4DAP32STATDIR $CLASSIC32DLLDIR \ + $NC432DLLDIR $NC4DAP32DLLDIR $CLASSIC64STATDIR \ + $NC464STATDIR $NC4DAP64STATDIR $CLASSIC64DLLDIR \ + $NC464DLLDIR $NC4DAP64DLLDIR + rm -rf netcdf-windows + + exit 0 +fi + +INCDEPS="false" +if [ $# -gt 1 ]; then +if [ $2 == "deps" ]; then + INCDEPS="true" +fi +fi +#### +# 32-bit libraries +#### +echo "Target Home Directory: $TARGBASEDIR" +echo "Writing build output to: $LOGFILE" +echo "Include Dependency libs: $INCDEPS" +echo "" +echo "Building 32-bit libraries." +echo "" +#### +# 32, static, classic only +#### + +# Build +BUILDDIR="$CLASSIC32STATDIR" +TARGDIR="$TARGBASEDIR/nc3_32_static" +echo "o Building 32-bit NetCDF Classic [static] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $CMNFLAGS $STATICFLAGS $MINFLAGS CFLAGS="$STATICCFLAGS" LDFLAGS="$STATICLDFLAGS -L$ZLIB32LIB" > $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +DEPDIR=$TARGDIR/deps +mkdir -p $DEPDIR +if [ $INCDEPS == "true" ]; then + echo "Copying dependencies to $DEPDIR" + cp $ZLIB32LIB/* $DEPDIR +fi + +echo "" +echo "---------------" +echo "" + +#### +# 32, static, nc4 +#### +BUILDDIR="$NC432STATDIR" +TARGDIR="$TARGBASEDIR/nc4_32_static" +echo "o Building 32-bit NetCDF-4 [static] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $CMNFLAGS $STATICFLAGS --enable-netcdf-4 --disable-dap CFLAGS="$STATICCFLAGS -I$HDF5INCDIR" LDFLAGS="$STATICLDFLAGS -L$HDF532LIBDIR -L$SZIP32LIBS -L$ZLIB32LIB" >> $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +if [ $INCDEPS == "true" ]; then + DEPDIR=$TARGDIR/deps + mkdir -p $DEPDIR + echo "Copying dependencies to $DEPDIR" + cp $HDF532LIBDIR/*.a $DEPDIR + cp $SZIP32LIBS/*.a $SZIP32LIBS/*.lib $DEPDIR + cp $ZLIB32LIB/* $DEPDIR +fi +echo "" +echo "---------------" +echo "" + +#### +# 32, static, nc4, dap +#### +BUILDDIR="$NC4DAP32STATDIR" +TARGDIR="$TARGBASEDIR/nc4_dap_32_static" +echo "o Building 32-bit NetCDF-4 with DAP [static] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $CMNFLAGS $STATICFLAGS --enable-netcdf-4 --enable-dap CFLAGS="$STATICCFLAGS -I$HDF5INCDIR -I$CURL32INCDIR" LDFLAGS="$STATICLDFLAGS -L$HDF532LIBDIR -L$SZIP32LIBS -L$CURL32LIBS -DCURL_STATICLIB -L$ZLIB32LIB" >> $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +if [ $INCDEPS == "true" ]; then + DEPDIR=$TARGDIR/deps + mkdir -p $DEPDIR + echo "Copying dependencies to $DEPDIR" + cp $HDF532LIBDIR/*.a $DEPDIR + cp $SZIP32LIBS/*.a $SZIP32LIBS/*.lib $DEPDIR + cp $CURL32LIBS/libcurl.a $DEPDIR + cp $ZLIB32LIB/* $DEPDIR +fi +echo "" +echo "---------------" +echo "" + +#### +# 32, dll, classic only +#### +BUILDDIR="$CLASSIC32DLLDIR" +TARGDIR="$TARGBASEDIR/nc3_32_dll" +echo "o Building 32-bit NetCDF Classic [dll] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $CMNFLAGS $SHAREDFLAGS $MINFLAGS LDFLAGS="-L$ZLIB32DLL" >> $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +if [ $INCDEPS == "true" ]; then + DEPDIR=$TARGDIR/deps + mkdir -p $DEPDIR + echo "Copying dependencies to $DEPDIR" + cp $ZLIB32DLL/* $DEPDIR +fi +echo "" +echo "---------------" +echo "" + +#### +# 32, dll, nc4 +#### +BUILDDIR="$NC432DLLDIR" +TARGDIR="$TARGBASEDIR/nc4_32_dll" +echo "o Building 32-bit NetCDF-4 [dll] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $CMNFLAGS $SHAREDFLAGS --enable-netcdf-4 --disable-dap CFLAGS="-I$HDF5INCDIR" LDFLAGS="-L$HDF532DLLDIR -L$SZIP32LIBS -L$ZLIB32DLL" >> $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +if [ $INCDEPS == "true" ]; then + DEPDIR=$TARGDIR/deps + mkdir -p $DEPDIR + echo "Copying dependencies to $DEPDIR" + cp $HDF532DLLDIR/*.dll $DEPDIR + cp $SZIP32LIBS/*.dll $SZIP32LIBS/*.lib $DEPDIR + cp $ZLIB32DLL/* $DEPDIR +fi +echo "" +echo "---------------" +echo "" + +#### +# 32, dll, nc4, dap +#### +BUILDDIR="$NC4DAP32DLLDIR" +TARGDIR="$TARGBASEDIR/nc4_dap_32_dll" +echo "o Building 32-bit NetCDF-4 with DAP [dll] ($BUILDDIR)" +mkdir -p $BUILDDIR +cd $BUILDDIR +../configure --prefix=$TARGDIR $SHAREDFLAGS --enable-netcdf-4 --enable-dap CFLAGS="-I$HDF5INCDIR -I$CURL32INCDIR" LDFLAGS="-L$HDF532DLLDIR -L$SZIP32LIBS -L$CURL32LIBS -L$ZLIB32DLL" >> $LOGFILE 2>&1 +make -j 10 >> $LOGFILE 2>&1 +make install >> $LOGFILE 2>&1 + +# Dependencies if needed +if [ $INCDEPS == "true" ]; then + DEPDIR=$TARGDIR/deps + mkdir -p $DEPDIR + echo "Copying dependencies to $DEPDIR" + cp $HDF532LIBDIR/*.a $DEPDIR + cp $SZIP32LIBS/*.a $SZIP32LIBS/*.lib $DEPDIR + cp $CURL32LIBS/libcurl.a $DEPDIR + cp $ZLIB32LIB/* $DEPDIR +fi +echo "" +echo "---------------" +echo "" + + + +#### +# 64-bit libraries +#### +echo "Building 64-bit libraries." +echo "" + +# 64, static, classic only + + +# 64, static, nc4 + + +# 64, static, nc4, dap + + +# 64, dll, classic only + + +# 64, dll, nc4 + + +# 64, dll, nc4, dap + + + +echo "Finished" + + + diff --git a/my_shared_32_min_conf.sh b/my_shared_32_min_conf.sh new file mode 100644 index 000000000..86f71f59a --- /dev/null +++ b/my_shared_32_min_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x +./configure --disable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --disable-netcdf-4 CFLAGS="-ggdb -O0" LDFLAGS="-shared -ggdb -O0" + +#./configure --disable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --disable-netcdf-4 --disable-utilities --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0" LDFLAGS="-ggdb -O0" \ No newline at end of file diff --git a/my_shared_32_nc4_conf.sh b/my_shared_32_nc4_conf.sh new file mode 100644 index 000000000..de3045ea3 --- /dev/null +++ b/my_shared_32_nc4_conf.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -x +./configure --disable-static --disable-doxygen --enable-shared --disable-dap --enable-netcdf-4 --enable-dll CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_dll/bin -L/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin" + diff --git a/my_shared_32_nc4_dap_conf.sh b/my_shared_32_nc4_dap_conf.sh new file mode 100644 index 000000000..a16e2a6ba --- /dev/null +++ b/my_shared_32_nc4_dap_conf.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -x + +./configure --disable-static --disable-doxygen --enable-shared --enable-dap --enable-netcdf-4 --enable-utilities --enable-dll CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/include" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_dll/bin -L/c/Users/wfisher/Desktop/szip-2.1/build_win32_dll/bin -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/lib/.libs" diff --git a/my_shared_64_min_conf.sh b/my_shared_64_min_conf.sh new file mode 100644 index 000000000..658d3701e --- /dev/null +++ b/my_shared_64_min_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x +./configure --disable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --disable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0" LDFLAGS="-ggdb -O0" + +#./configure --disable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --disable-netcdf-4 --disable-utilities --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0" LDFLAGS="-ggdb -O0" \ No newline at end of file diff --git a/my_shared_64_nc4_conf.sh b/my_shared_64_nc4_conf.sh new file mode 100644 index 000000000..f3cef5147 --- /dev/null +++ b/my_shared_64_nc4_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x + +./configure --disable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -gdwarf-2 -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -gdwarf-2 -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_dll/bin -L/c/Users/wfisher/Desktop/zlib125dll/dllx64 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin" + diff --git a/my_shared_64_nc4_dap_conf.sh b/my_shared_64_nc4_dap_conf.sh new file mode 100644 index 000000000..4b1099098 --- /dev/null +++ b/my_shared_64_nc4_dap_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x + +./configure --enable-dap --disable-doxygen --enable-shared --disable-static --enable-dll --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -gdwarf-2 -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_dll -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win64/include" LDFLAGS="-ggdb -gdwarf-2 -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_dll/bin -L/c/Users/wfisher/Desktop/zlib125dll/dllx64 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win64/lib/.libs" + diff --git a/my_static_32_min_conf.sh b/my_static_32_min_conf.sh new file mode 100644 index 000000000..f9c46426a --- /dev/null +++ b/my_static_32_min_conf.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -x +./configure --enable-static --disable-dap --disable-doxygen --disable-shared --disable-netcdf-4 CFLAGS="-static -O0 -fno-stack-check -fno-stack-protector -mno-stack-arg-probe" LDFLAGS="-static -O0" \ No newline at end of file diff --git a/my_static_32_nc4_conf.sh b/my_static_32_nc4_conf.sh new file mode 100644 index 000000000..ab90318eb --- /dev/null +++ b/my_static_32_nc4_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x +./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/hdf5-1.8.9/hl/src -I/c/Users/wfisher/Desktop/netcdf-4.2/include/" LDFLAGS="-static -ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_static/bin -L/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin -L/c/Users/wfisher/Desktop/zlib125dll/static32" + + diff --git a/my_static_32_nc4_dap_conf.sh b/my_static_32_nc4_dap_conf.sh new file mode 100644 index 000000000..7babdadd6 --- /dev/null +++ b/my_static_32_nc4_dap_conf.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -x +./configure --disable-doxygen --disable-shared --enable-dap --enable-netcdf-4 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/hdf5-1.8.9/hl/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/include/ -DCURL_STATICLIB" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win32_static/bin -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win32/lib/.libs -L/c/Users/wfisher/Desktop/szip-2.1/build_win32/bin" + +#-L/c/Users/wfisher/Desktop/curl-7.25.0/lib/.libs/libcurl.a" \ No newline at end of file diff --git a/my_static_64_min_conf.sh b/my_static_64_min_conf.sh new file mode 100644 index 000000000..35b6e3d27 --- /dev/null +++ b/my_static_64_min_conf.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -x +./configure --enable-static --disable-dap --disable-doxygen --disable-shared --disable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -static -O0" LDFLAGS="-static -ggdb -O0" \ No newline at end of file diff --git a/my_static_64_nc4_conf.sh b/my_static_64_nc4_conf.sh new file mode 100644 index 000000000..b1b301425 --- /dev/null +++ b/my_static_64_nc4_conf.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -x +./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64" + +#./configure --enable-static --disable-doxygen --disable-shared --disable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_static/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64" + + + diff --git a/my_static_64_nc4_dap_conf.sh b/my_static_64_nc4_dap_conf.sh new file mode 100644 index 000000000..e2a2ff860 --- /dev/null +++ b/my_static_64_nc4_dap_conf.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -x + +./configure --enable-static --disable-doxygen --disable-shared --enable-dap --enable-netcdf-4 --host=x86_64-w64-mingw32 CFLAGS="-ggdb -O0 -I/c/Users/wfisher/Desktop/hdf5-1.8.9/src -I/c/Users/wfisher/Desktop/curl-7.25.0/build_win64/include -DCURL_STATICLIB" LDFLAGS="-ggdb -O0 -L/c/Users/wfisher/Desktop/szip-2.1/build_win64/bin -L/c/Users/wfisher/Desktop/hdf5-1.8.9/build_win64_static/bin -L/c/Users/wfisher/Desktop/zlib125dll/staticx64 -L/c/Users/wfisher/Desktop/curl-7.25.0/build_win64/lib/.libs" + + +