Unidata / netcdf-fortran

Official GitHub repository for netCDF-Fortran libraries, which depend on the netCDF C library. Install the netCDF C library first.
Other
244 stars 98 forks source link

Intel LLVM does not like -lgfortran linker #439

Open HathewayWill opened 6 months ago

HathewayWill commented 6 months ago

To report a non-security related issue, please provide:

relevant files added

@edhartnett @edwardhartnett

autoreconf.log config.log configure.log

HathewayWill commented 6 months ago

I would think that the gnu compilers wouldn't cause a problem because the -lgcc linker can be in the CFLAGS command and it doesn't cause it to break. Only the -lgfortran.

Some relevant code that I am using:

    cd "${WRF_FOLDER}"/Downloads
    tar -xzvf v$Netcdf_C_Version.tar.gz
    cd netcdf-c-$Netcdf_C_Version/

    # these variables need to be set for the NetCDF-C install to work
    export CPPFLAGS=-I$DIR/grib2/include
    export LDFLAGS=-L$DIR/grib2/lib
    export LIBS="-lhdf5_hl -lhdf5 -lz -lcurl -lgcc -lm -ldl -lpnetcdf"
    autoreconf -i -f 2>&1 | tee autoreconf.log

    CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 CFLAGS=$CFLAGS ./configure --prefix=$DIR/NETCDF --disable-dap --enable-netcdf-4 --enable-netcdf4 --enable-shared --enable-static --enable-pnetcdf --enable-cdf5 --enable-parallel-tests 2>&1 | tee configure.log
    automake -a -f 2>&1 | tee automake.log
    make -j $CPU_HALF_EVEN 2>&1 | tee make.log
    make -j $CPU_HALF_EVEN install 2>&1 | tee make.install.log

    # other libraries below need these variables to be set
    export PATH=$DIR/NETCDF/bin:$PATH
    export NETCDF=$DIR/NETCDF

    echo " "
    ############################## NetCDF-Fortran library ############################

    cd "${WRF_FOLDER}"/Downloads
    tar -xvzf v$Netcdf_Fortran_Version.tar.gz
    cd netcdf-fortran-$Netcdf_Fortran_Version/

    # these variables need to be set for the NetCDF-Fortran install to work
    export LD_LIBRARY_PATH=$DIR/NETCDF/lib:$LD_LIBRARY_PATH
    export CPPFLAGS="-I$DIR/NETCDF/include -I$DIR/grib2/include"
    export LDFLAGS="-L$DIR/NETCDF/lib -L$DIR/grib2/lib"
    export LIBS="-lnetcdf -lpnetcdf -lcurl -lhdf5_hl -lhdf5 -lz -lm -ldl -lgcc "
    autoreconf -i -f 2>&1 | tee autoreconf.log
    CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 CFLAGS=$CFLAGS ./configure --prefix=$DIR/NETCDF --enable-netcdf-4 --enable-netcdf4 --enable-parallel-tests --enable-hdf5 2>&1 | tee configure.log
    automake -a -f 2>&1 | tee automake.log
    make -j $CPU_HALF_EVEN 2>&1 | tee make.log
    make -j $CPU_HALF_EVEN install 2>&1 | tee make.install.log

    echo " "
    #################################### System Environment Tests ##############

Log files with sucessful compiliation.

autoreconf.log config.log configure.log make.install.log make.log

HathewayWill commented 6 months ago

@WardF

Here's my issue that I opened with all the log files.

HathewayWill commented 6 months ago

@edhartnett @WardF

not sure why the linker for gfortran doesn't work. Seems to affect all versions of netcdf including cxx. Maybe it's an intel llvm problem?

WardF commented 5 months ago

Thanks for your patience; the netCDF-C release has been demanding a lot of my time. Let me review this.

HathewayWill commented 5 months ago

that's okay take your time, just trying to help @WardF