Configure library externally

From Lumen wiki
Jump to navigationJump to search

In this page we explain how to configure HDF5 and NetCDFc and NetCDF-Fortran

Gfortran Installation

export INSTALL_DIR={your installation directory}

Configuration of HDF5 1.14.6 with gfortran:

./configure --prefix=${INSTALL_DIR} --enable-fortran --disable-shared --enable-static --without-pic --disable-cxx --enable-parallel CC=mpicc CPP="mpicc -E" CFLAGS="-O2 -std=gnu99 -D_C_US -D_FORTRAN_US" FC=mpif90 --enable-build-mode=production

Configure NetCDFC-4.9.0 with gfortran

./configure --prefix=${INSTALL_DIR} --without-pic --enable-static --disable-shared --disable-dap --enable-netcdf-4 CC=gcc CPP="gcc -E" CFLAGS="-O2 -std=gnu99 -D_C_US -D_FORTRAN_US" FC=mpif90 CPPFLAGS="-DpgiFortran -I${INSTALLDIR}" LIBS="-L${INSTALL_DIR} -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5" F77=mpif90 LDFLAGS="-Wl,--copy-dt-needed-entries"

Configure NetCDF-fortran 4.6.2 with gfortran

./configure --prefix=${INSTALL_DIR} --libdir="${INSTALL_DIR}/lib" --without-pic --enable-static --disable-shared CC=gcc CFLAGS="-O2 -std=gnu99 -D_C_US -D_FORTRAN_US" CPP="mpif90 -E" FC=mpif90 CPPFLAGS="-DpgiFortran -I${INSTALLDIR}/include" LIBS="-L${INSTALL_DIR}/lib/ -lnetcdf -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -hdf5" F77=mpif90


Intel ONEAPI Installation


export INSTALLDIR={your installation directory}

Configuration of HDF5 1.14.6 with intel:

/configure --prefix=${INSTALL_DIR} --enable-fortran --enable-parallel CC=mpiicx CPP="mpiicx -E" FC=mpiifx --enable-build-mode=production --enable-fortran --disable-shared --enable-static --without-pic --disable-cxx

Configure NetCDFC-4.9.0 with intel

./configure --prefix=${INSTALL_DIR} --without-pic --enable-static --disable-shared --disable-dap --disable-libxml2 --enable-netcdf-4  CC=mpiicx CPP="mpiicx -E" CFLAGS="-O2 -std=gnu99 -D_C_US -D_FORTRAN_US" FC=mpiifort CPPFLAGS="-DpgiFortran -I${INSTALL_DIR}/include" LIBS="-L${INSTALL_DIR}/lib -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5" F77=mpiifx


Configure NetCDF-fortran 4.6.2 with intel

./configure --prefix=${INSTALL_DIR} --libdir=/home/attacc/local_intel/lib --without-pic --enable-static --disable-shared CC=mpiicx CFLAGS="-O2 -std=gnu99 -D_C_US -D_FORTRAN_US" CPP="mpiicx -E" FC=mpiifx CPPFLAGS="-DpgiFortran -I${INSTALL_DIR}/include" LIBS="-L${INSTALL_DIR}/lib/ -lnetcdf -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5" F77=mpiifx


Linking libraries to Lumen

/configure --with-netcdf-path="${INSTALL_DIR}" --with-netcdff-path="${INSTALL_DIR}" --with-hdf5-path="${INSTALL_DIR}"