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

undefined reference to `max_float_' #398

Open
mankoff opened this issue Apr 12, 2023 · 0 comments
Open

undefined reference to `max_float_' #398

mankoff opened this issue Apr 12, 2023 · 0 comments

Comments

@mankoff
Copy link

mankoff commented Apr 12, 2023

I'm not sure if I should be posting this here or to a mailing list.

I'm trying to build an old version of netcdf-fortran. I intend to upgrade, but for now am forced to work with older versions as I rebuild some legacy software. I have successfully (I think) built and installed HDF5 1.8.18, netcdf 4.4.0 (links to hdf5), netcdf-cxx 4.3.0 (also links to hdf5, but not to netcdf), and I'm now having trouble with netcdf-fortran 4.4.4 (linking to netcdf, not netcdf-cxx).

  • OS: Linux
  • Compilers:
module load comp/gcc/11.2.0
module load comp/intel/20.0.0.166
module load mpi/impi/20.0.0.166

Cmake seems OK with the following:

cmake .. \
  -D CMAKE_INSTALL_PREFIX=${MELI_ROOT}/opt/netcdf-fortran \
  -D CMAKE_C_FLAGS=-fPIC \
  -D NETCDF_C_LIBRARY=${MELI_ROOT}/opt/netcdf-4.4.0/lib/libnetcdf.so \
  -D netCDF_INCLUDE_DIR=${MELI_ROOT}/opt/netcdf-4.4.0/include \
Output of that command is:
CMake Deprecation Warning at CMakeLists.txt:9 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The Fortran compiler identification is Intel 19.1.0.20191121
-- The C compiler identification is Intel 19.1.0.20191121
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/bin/intel64/ifort - skipped
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/bin/intel64/icc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Looking for nc_def_opaque in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so
-- Looking for nc_def_opaque in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so - found
-- Looking for nccreate in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so
-- Looking for nccreate in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so - found
-- Looking for nc_set_log_level in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so
-- Looking for nc_set_log_level in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so - not found
-- Looking for oc_open in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so
-- Looking for oc_open in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so - found
-- Looking for nc_use_parallel_enabled in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so
-- Looking for nc_use_parallel_enabled in /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so - not found
CMake Deprecation Warning at fortran/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at libsrc/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at nf_test/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.




-- CMake Summary:

--      Build Type:                     DEBUG
--      Building Shared Libraries:      ON
--      Building netCDF-4:              ON
--      Building DAP Support:           ON
--      Logging Support:                OFF
--      Using Parallel IO:              OFF
--      Linking against:                /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so;

-- Configuring done
-- Generating done
-- Build files have been written to: /discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/build

But when I make, I get the following error:

[ 18%] Linking Fortran executable nf_test
/usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/bin/intel64/ifort -O2 -g CMakeFiles/nf_test.dir/test_get.F.o CMakeFiles/nf_test.dir/test_put.F.o CMakeFiles/nf_test.dir/nf_error.F.o CMakeFiles/nf_test.dir/nf_test.F.o CMakeFiles/nf_test.dir/test_read.F.o CMakeFiles/nf_test.dir/test_write.F.o CMakeFiles/nf_test.dir/util.F.o CMakeFiles/nf_test.dir/fortlib.c.o -o nf_test   -L/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/fortran  -L/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/libsrc  -L/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/build/fortran  -Wl,-rpath,/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/fortran:/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/libsrc:/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/build/fortran:/discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib ../fortran/libnetcdff.so.6.1.1 /discover/nobackup/kmankoff/opt/netcdf-4.4.0/lib/libnetcdf.so -lirng -ldecimal -lcilkrts -lstdc++ 
ld: CMakeFiles/nf_test.dir/util.F.o: in function `inrange_float_':
/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: undefined reference to `max_float_'
ld: /discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: undefined reference to `max_float_'
ld: /discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: undefined reference to `max_float_'
ld: /discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: undefined reference to `max_float_'
ld: /discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: undefined reference to `max_float_'
ld: CMakeFiles/nf_test.dir/util.F.o:/discover/nobackup/kmankoff/src/netcdf-fortran-4.4.4/nf_test/util.F:1351: more undefined references to `max_float_' follow
...

Any advice how I can build netcdf-fortran will be much appreciated.

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

1 participant