Helpful instructions for installing libraries to support ASCAT_sir processing In theory, standard system libraries should be used. These instructions are for installing these libraries locally. For convenience, downloads of recent linux version are included. hdf5-1.10.1.tar.gz netcdf-c-4.5.0.tar.gz netcdf-fortran-4.4.4.tar.gz lloyd-yajl-2.1.0-0-ga0ecdde.zip gsl-2.4.tar.gz First locally install HDF5, then netcdf-c, then netcdf-fortran using w/gcc and gfortran support. Finally create yajl and gsl. Note: png, jpeg, z, and curl libraries are also used, but they usually part of a standard linux install so are not separately included. ##################### # set default compiler flags CC="gcc" CFLAGS="-m64 -O2" LDFLAGS="" LIBS="" CPPFLAGS="" CPP="" # note: including the -ff2c interfaces g77 and gfortran but breaks hdf4 # testing, so not used F77="gfortran" FFLAGS="-m64 -O2" # "-ffixed-line-length-255 -frecord-marker=4 -ff2c" F90="gfortran" F90FLAGS="-m64 -O2" # "-ffixed-line-length-255 -frecord-marker=4 -ff2c" F90LIBS="" export CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP F77 FFLAGS F90 F90FLAGS F90LIBS # define install location HDFDIR="/home/long/src/linux/ascat/current_sir_practice/ascat_sir/libs" export HDFDIR NOTE: For this "local" install, the shared libraries have been disabled. However, this is not, in general, required. # HDF5 gunzip hdf5-1.10.1.tar.gz tar xvf hdf5-1.10.1.tar cd hdf5-1.10.1 ./configure --disable-shared --enable-static-exec --prefix=${HDFDIR} --enable-fortran make clean make make check make install cd .. # NETCDF4-C gunzip netcdf-c-4.5.0.tar.gz tar xf netcdf-c-4.5.0.tar cd netcdf-c-4.5.0 # modify flags to point to hdf4 and hdf5 libraries CFLAGS="-m64 -O2 -I${HDFDIR}/include" LDFLAGS="-L${HDFDIR}/lib -L/usr/lib64/" #LIBS="-lhdf5 -lhdf5_hl -lhdf5_fortran -lhdf5hl_fortran -lmfhdf -ldf -ljpeg -lm" LIBS="-lhdf5 -lhdf5_hl -lhdf5_fortran -lhdf5hl_fortran -ljpeg -lm" export CFLAGS LDFLAGS LIBS ## Note: --enable-hdf4 does not work -- does not pass checks #configure --disable-shared --prefix=${HDFDIR} --enable-fortran --enable-hdf4 ./configure --disable-shared --prefix=${HDFDIR} --enable-fortran # --enable-hdf4 make clean make make install # note: got some errors when doing testing, install anywaq make check cd .. # NETCDF4-fortran gunzip netcdf-fortran-4.4.4.tar.gz tar xf netcdf-fortran-4.4.4.tar cd netcdf-fortran-4.4.4 CFLAGS="-m64 -O2 -I${HDFDIR}/include" LDFLAGS="-L${HDFDIR}/lib -L/usr/lib64/" #LIBS="-lhdf5 -lhdf5_hl -lhdf5_fortran -lhdf5hl_fortran -lmfhdf -ldf -ljpeg -lm" LIBS="-lhdf5 -lhdf5_hl -lhdf5_fortran -lhdf5hl_fortran -ljpeg -lnetcdf -lm" export CFLAGS LDFLAGS LIBS ./configure --enable-static --disable-shared --prefix=${HDFDIR} # --disable-f03 make clean make make install make check cd .. # YAJL unzip lloyd-yajl-2.1.0-0-ga0ecdde.zip cd lloyd-yajl-66cb08c # Unfortunately, yajl requires cmake, which requires installing it from # http://cmake.org # I found that on my system, I could edit the configure file to change # line 41 from "cmake -DCMAKE..." to "cmake3 -DCMAKE..." and then # execute configure ./configure --enable-static --disable-shared --prefix=${HDFDIR} make # make install # note: yajl does not recognize the local install prefix flag and tries # to create its sharable output in /usr/local/lib/, which causes an error. # Instead, we can do a manual "install" (copy) of key files into # our local library area cp build/yajl-2.1.0/lib/libyajl_s.a ${HDFDIR}/lib/ cp -R build/yajl-2.1.0/include/yajl ${HDFDIR}/include/ # GSL gunzip gsl-2.4.tar.gz tar xf gsl-2.4.tar cd gsl-2.4 ./configure --enable-static --disable-shared --prefix=${HDFDIR} make # note: I got a "fail" error on one part of the checking, but this # does not seem to affect the results make check make install