WARNING: HDF version should be the same that the one installed on Linux 


export DIR=/home/fettweis/src

cd $DIR
mkdir lib
ln -s lib lib64

export CC=icx
export CXX=icpx
export CFLAGS="-O3 -static -I`echo $DIR`/include/ -L`echo $DIR`/lib/"
export CXXFLAGS="-O3 -static -I`echo $DIR`/include/ -L`echo $DIR`/lib/"

export F77=ifx
export FC=ifx
export F90=ifx
export FFLAGS="-O3 -static -I`echo $DIR`/include/ -L`echo $DIR`/lib/"
export FCFLAGS="-O3 -static -I`echo $DIR`/include/ -L`echo $DIR`/lib/"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR/lib/
export PATH=$DIR/bin:$PATH

zlib-1.2.8: ./configure --prefix=`echo $DIR`  --static
szip-2.1.1: ./configure --prefix=`echo $DIR`  --enable-static
curl-8.6.0: ./configure --prefix=`echo $DIR`  --enable-static --without-ssl --without-libpsl --enable-byterange
hdf5-1.12.3: ./configure --prefix=`echo $DIR`  --enable-static
netcdf-c-4.9.2: ./configure --prefix=`echo $DIR`  --enable-static --disable-byterange
netcdf-fortran-4.6.1: ./configure --prefix=`echo $DIR`  --enable-static --disable-byterange

change ./configure to have both
   BUILD_V2_TRUE=
   BUILD_V2_FALSE='#'
+ export LIBS="-lnetcdf  -lm -lhdf5_hl -lhdf5 -lsz -lz -lcurl"



 cd $DIR/lib
 mkdir libnetcdf
 cp *.a libnetcdf
 cd libnetcdf
 ar x libhdf5.a
 ar x libhdf5_hl.a
 ar x libnetcdf.a
 ar x libnetcdff.a
 ar x libsz.a
 ar x libz.a
 ar -cq libnetcdf_ifort.a *.o


