Closed Lipeng-Lai closed 2 weeks ago
Which version of HDF5 do you use? Did you intall it manually or is it a module/package? Is HDF5 compiled with the same compiler as easi (i.e. gcc 9.4.0)?
Which version of HDF5 do you use? Did you intall it manually or is it a module/package? Is HDF5 compiled with the same compiler as easi (i.e. gcc 9.4.0)?
I use hdf5-1.10.8,and manully install, I followed the instructions in https://seissol.readthedocs.io/en/latest/installing-dependencies.html to compile using mpicc,
InstallingHDF5
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.8/src/hdf5-1.10.8.tar.bz2
tar -xaf hdf5-1.10.8.tar.bz2
cd hdf5-1.10.8
CPPFLAGS="-fPIC ${CPPFLAGS}" CC=mpicc FC=mpif90 ./configure --enable-parallel --prefix=$HOME --with-zlib --disable-shared --enable-fortran
make -j8
make install
cd..
. For easi, I also followed the tutorial configuration for the first time.
# $EASI_SRC is the directory into which you've cloned the easi source
cmake -DCMAKE_PREFIX_PATH=$HOME -DCMAKE_INSTALL_PREFIX=$HOME -DASAGI=ON -DIMPALAJIT=ON -DLUA=ON $EASI_SRC
make -j4 install
Later I saw your reply and I used
CC=mpicc FC=mpif90 cmake -DCMAKE_PREFIX_PATH=$HOME -DCMAKE_INSTALL_PREFIX=$HOME -DASAGI=ON -DIMPALAJIT=ON -DLUA=ON $EASI_SRC
make -j4 install
The error message is
wc@VM-4-3-ubuntu:~/easi$ make -j4 install
[92%] Built target ease
[96%] Linking CXX executable easicube
/usr/bin/ld: /home/wc/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `hdf5free':
nc4file.c:(.text+0x1f): undefined reference to `H5free_memory'
/usr/bin/ld: /home/wc/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `get_netcdf_type':
nc4file.c:(.text+0x7a): undefined reference to `H5Tget_class'
/usr/bin/ld: nc4file.c:(.text+0x9f): undefined reference to `H5Tis_variable_str'
/usr/bin/ld: nc4file.c:(.text+0xed): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0xf4): undefined reference to `H5T_NATIVE_SCHAR_g'
/usr/bin/ld: nc4file.c:(.text+0x106): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x138): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x13f): undefined reference to `H5T_NATIVE_SHORT_g'
/usr/bin/ld: nc4file.c:(.text+0x151): undefined reference to `H5Tequal'
Please can you tell me the reason? I am new to this, thank you
Hi, what happens if you enter make VERBOSE=1
?
Hi, what happens if you enter
make VERBOSE=1
?
ok, I enter make VERBOSE=1
in $HOME/easi
, Now it looks like this
wc@VM-4-3-ubuntu:~/easi$ make VERBOSE=1
/usr/bin/cmake -S/home/wc/easi -B/home/wc/easi --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/wc/easi/CMakeFiles /home/wc/easi/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/wc/easi'
make -f CMakeFiles/easi.dir/build.make CMakeFiles/easi.dir/depend
make[2]: Entering directory '/home/wc/easi'
cd /home/wc/easi && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/wc/easi /home/wc/easi /home/wc/easi /home/wc/easi /home/wc/easi/CMakeFiles/easi.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/wc/easi'
make -f CMakeFiles/easi.dir/build.make CMakeFiles/easi.dir/build
make[2]: Entering directory '/home/wc/easi'
make[2]: Nothing to be done for 'CMakeFiles/easi.dir/build'.
make[2]: Leaving directory '/home/wc/easi'
[ 92%] Built target easi
make -f CMakeFiles/easicube.dir/build.make CMakeFiles/easicube.dir/depend
make[2]: Entering directory '/home/wc/easi'
cd /home/wc/easi && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/wc/easi /home/wc/easi /home/wc/easi /home/wc/easi /home/wc/easi/CMakeFiles/easicube.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/wc/easi'
make -f CMakeFiles/easicube.dir/build.make CMakeFiles/easicube.dir/build
make[2]: Entering directory '/home/wc/easi'
[ 96%] Linking CXX executable easicube
/usr/bin/cmake -E cmake_link_script CMakeFiles/easicube.dir/link.txt --verbose=1
/usr/bin/mpiCC CMakeFiles/easicube.dir/tools/easicube.cpp.o -o easicube libeasi.a /home/wc/lib/libhdf5_hl.a /home/wc/lib/libhdf5.a /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so -lm /home/wc/lib/libasagi.a /usr/lib/x86_64-linux-gnu/libnuma.so /home/wc/lib/libnetcdf.a /home/wc/lib/libyaml-cpp.a /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so /home/wc/lib/libimpalajit.a /home/wc/lib/liblua.a -lm -ldl
/usr/bin/ld: /home/wc/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `hdf5free':
nc4file.c:(.text+0x1f): undefined reference to `H5free_memory'
/usr/bin/ld: /home/wc/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `get_netcdf_type':
nc4file.c:(.text+0x7a): undefined reference to `H5Tget_class'
/usr/bin/ld: nc4file.c:(.text+0x9f): undefined reference to `H5Tis_variable_str'
/usr/bin/ld: nc4file.c:(.text+0xed): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0xf4): undefined reference to `H5T_NATIVE_SCHAR_g'
/usr/bin/ld: nc4file.c:(.text+0x106): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x138): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x13f): undefined reference to `H5T_NATIVE_SHORT_g'
/usr/bin/ld: nc4file.c:(.text+0x151): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x183): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x18a): undefined reference to `H5T_NATIVE_INT_g'
/usr/bin/ld: nc4file.c:(.text+0x19c): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x1ce): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x1d5): undefined reference to `H5T_NATIVE_FLOAT_g'
/usr/bin/ld: nc4file.c:(.text+0x1e7): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x219): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x220): undefined reference to `H5T_NATIVE_DO
Thanks; I have an idea where the problem could lie... That is, there may be something with the linking order in our CMake script.
If you go to https://github.com/SeisSol/easi/blob/7012d143a82ec92421509b43a5333dd51e348c0e/CMakeLists.txt#L198 (easi/CMakeLists.txt
, line 198), and replace the line with
target_link_libraries(easicube PUBLIC PkgConfig::ASAGI PkgConfig::NETCDF ${HDF5_C_HL_LIBRARIES} ${HDF5_C_LIBRARIES})
Does it work then? The linking order of the static libraries needs to be changed, since Netcdf depends on Hdf5. ASAGI depends on the former both, so its placement is fine. (cf. also https://github.com/microsoft/onnxruntime/blob/main/docs/cmake_guideline.md#static-library-order-matters for the issue)
Hi I got the same problem when installing on CSCS. The solution you provided is not working as well. However, after I turn off the ASAGI. It works. What could be another solution?
If you just want to install SeisSol, then you can also set EASICUBE=OFF
. That should avoid the above error. (easicube is a small helper program which is not ultimately needed for compiling SeisSol)
Thanks. However, would this avoid the use of ASAGI?
No, ASAGI can be included (i.e. ASAGI=ON
, and EASICUBE=OFF
). The error, at least as shown above, only affects a utility program.
great, thanks.
This problem may be fixed by #56 (and besides, it's generally avoided now by #55 ). There was another place where the Hdf5 libraries were linked before the Netcdf libraries, besides the one mentioned in this thread. Thus, the line mentioned here had no effect after all.
A local test showed that for the new master, Hdf5 is now included after Netcdf.
Closing for now—feel free to re-open or file a new issue if the problem should re-appear.
"Error occurred when I executed the following command in the Compilation module."
The following are errors such as H5.... The error message is very long, so I intercepted part of it. How should I modify it?