Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel LLVM does not like -lgfortran linker #439

Open
HathewayWill opened this issue May 12, 2024 · 5 comments
Open

Intel LLVM does not like -lgfortran linker #439

HathewayWill opened this issue May 12, 2024 · 5 comments
Assignees

Comments

@HathewayWill
Copy link

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

  • the version of the software with which you are encountering an issue
    4.6.1

  • environmental information (i.e. Operating System, compiler info, java version, python version, etc.)
    ubuntu 22.04.4
    HDF5_Version=1.14.4
    HDF5_Sub_Version=2
    Zlib_Version=1.3.1
    Netcdf_C_Version=4.9.2
    Netcdf_Fortran_Version=4.6.1
    Mpich_Version=4.2.1
    Libpng_Version=1.6.39
    Jasper_Version=1.900.1
    Pnetcdf_Version=1.13.0

  • a description of the issue with the steps needed to reproduce it
    When compilling netcdf-fortran && netcdf-c with the -lgfortran flag it raises an error saying unable to compile using intel llvm compilers.
    When using the intel classic compilers it did not have this issue. Which is intel compilers before 2023

relevant files added

@edhartnett @edwardhartnett

autoreconf.log
config.log
configure.log

@HathewayWill
Copy link
Author

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
Copy link
Author

@WardF

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

@HathewayWill
Copy link
Author

HathewayWill commented May 24, 2024

@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 WardF self-assigned this Jun 25, 2024
@WardF
Copy link
Member

WardF commented Jun 25, 2024

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

@HathewayWill
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants