-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Cannot compile with mpif90 that is based on clang/flang (clang: error: unknown argument: '-soname') #5086
Comments
Hi @AnastKap! Thanks for the bug report! Unfortunately, we will be dropping support for the Autotools in HDF5 2.0 (March 2025). If we do a 1.14.6 patch release, I'll try to get your changes in. |
Even though this isn't a merge, I've slapped the "merge to 1.14.6" label on it so we don't forget it. |
In line with Dana's comments, do you know if building with CMake works successfully? Also, some issues are being resolved for flang and HDF5, GEOS-ESM/ESMA-Baselibs#220 (comment), llvm/llvm-project#77282 are the issues I'm aware of. |
For the first part of the question about the CMake, I have to try it. Two things I want to say on that:
I think the link you provided about resolved problems for flang are only for the flang backend. I am using another backend, which is based on flang. |
You should not need external libraries. You could try:
or go the ccmake route. However, I don't think a lower version of CMake will work since it probably uses 3.18 features. |
Thanks for testing this! If the CMake schema is not compatible with your workflow, please let us know. We need feedback before dropping Autotools support. |
I am trying to link my application with the shared libraries produced from the CMake of the HDF5. The linking process is not successful due to the following error: [ 1%] Linking Fortran executable sod2d
ld.lld: error: unable to find library -lhdf5
ld.lld: error: unable to find library -lhdf5_hl
ld.lld: error: unable to find library -lhdf5_fortran
ld.lld: error: unable to find library -lhdf5_hl_fortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/app_sod2d/CMakeFiles/sod2d.dir/build.make:1078: src/app_sod2d/sod2d] Error 1
make[1]: *** [CMakeFiles/Makefile2:112: src/app_sod2d/CMakeFiles/sod2d.dir/all] Error 2
make: *** [Makefile:130: all] Error 2 Note: I've set properly the I searched in the build folder with /home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_fortran_debug.so.310.3.1
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_f90cstub_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_f90cstub_debug.so.310.3.1
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_fortran_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_debug.so.310.5.0
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_fortran_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_cpp_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_f90cstub_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_fortran_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_f90cstub_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_cpp_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_f90cstub_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_fortran_debug.so.310.3.1
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_fortran_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_debug.so.310.5.0
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_cpp_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_tools_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_f90cstub_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_f90cstub_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_cpp_debug.so.310.0.5
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_tools_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_f90cstub_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_tools_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_test_fortran_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_cpp_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_cpp_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_fortran_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_fortran_debug.so
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_hl_debug.so.310
/home/hdf-test/hdf5-hdf5_1.14.5/build/bin/libhdf5_f90cstub_debug.so.310.3.1 In other words, all the shared libraries' base names end in |
We sincerely hope that adhering to CMake only in 2 will ultimately yield functional support for using SZIP that ships with Libaec. At present, there exist significant difficulties in compiling the HDF5 code (1.14.5) against Libaec when CMake is employed. For now, using autotools to set up the compilation is the only practical way to connect the HDF5 library to SZIP provided by Libaec. |
Hello to all,
I encountered a problem when trying to compile the source code. It is an issue regarding the "-soname" option, which is partly solved, but not for all cases.
Problem statement
I am trying to build the HDF5 library with the following commands:
CPP=mpic++ CC=mpicc CXX=mpicxx FC=mpif90 CFLAGS=-fPIC FCFLAGS=-fPIC ./configure --prefix=/home/apps/libraries/hdf5/1.14.5/gnu --enable-threadsafe --enable-cxx --enable-fortran --enable-unsupported --enable-parallel make -j 12 --trace && make install
However, I get the following error:
Setup
rocm/rocm-terminal:6.2.1
, with Linux 5.15.0-119-generic and Ubuntu 20.04.6 LTSamdclang, amdflang
andamdclang++
version 18.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-6.2.1 24355 77cf9ad00e298ed06e06aec0f81009510f545714)Solution
In the configure script it seems that the problem was fixed, at least for the flang compiler, via line 39952:
However, I am not using the flang compiler, but the mpif90 compiler build with amdflang, as can be seen by running
mpif90 --version
:The proposed solution is to check whether the version invocation of the compiler contains the "clang" or "flang" string, which means that it internally uses flang. This can be done by changing the same line to:
Additionally, I encountered the following problem in the linking stage while compiling with the changes proposed:
In order to fix this, I added in the configure step the linker flag -lquadmath via:
I don't know if the last part should be included in the building procedure, but I mentioned it in order to have it in mind.
The text was updated successfully, but these errors were encountered: