You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to compile the library under WSL2 with gfortran 9.4.0 and using fpm (0.7.0) and I encountered an error with the example_ex_fcn file:
...
libh5fortran.a done.
char_repeat_read failed.
[ 88%] Compiling...
/usr/bin/ld: build/gfortran_XXXXXXX/h5fortran/example_ex_fcn.c.o: in function main': ex_fcn.cpp:(.text+0x0): multiple definition of main'; build/gfortran_XXXXXXX/h5fortran/example_char_repeat_read.f90.o:char_repeat_read.f90:(.text.startup+0x0): first defined here
/usr/bin/ld: cannot find -lhdf5_hl_fortran
/usr/bin/ld: cannot find -lhdf5_fortran
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5collect2: error: ld returned 1 exit status
Compilation failed for object " char_repeat_read "stopping due to failed compilation
STOP 1
The instructions to build HDF5 with CMake worked like a charm. I compiled it to a different folder holding different libraries, lets say: //mnt/d/tmp/third_party_hdf5/release/
And the cloned h5fortran project is at
//mnt/d/tmp/fortran-lang/h5fortran
link = ["hdf5_hl_fortran", "hdf5_fortran", "hdf5_hl", "hdf5"] #uncommented this one instead of the default since in the build dir I do have hl ...
I also tried completing the command line with
export HDF5LIB="//mnt/d/tmp/third_party_hdf5/release/lib/"
export HDF5INC="//mnt/d/tmp/third_party_hdf5/release/include/"
fpm build --profile release --flag "-I$HDF5INC -L$HDF5LIB"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to compile the library under WSL2 with gfortran 9.4.0 and using fpm (0.7.0) and I encountered an error with the example_ex_fcn file:
...
libh5fortran.a done.
char_repeat_read failed.
[ 88%] Compiling...
/usr/bin/ld: build/gfortran_XXXXXXX/h5fortran/example_ex_fcn.c.o: in function
main': ex_fcn.cpp:(.text+0x0): multiple definition of
main'; build/gfortran_XXXXXXX/h5fortran/example_char_repeat_read.f90.o:char_repeat_read.f90:(.text.startup+0x0): first defined here/usr/bin/ld: cannot find -lhdf5_hl_fortran
/usr/bin/ld: cannot find -lhdf5_fortran
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5collect2: error: ld returned 1 exit status
Compilation failed for object " char_repeat_read "stopping due to failed compilation
STOP 1
The instructions to build HDF5 with CMake worked like a charm. I compiled it to a different folder holding different libraries, lets say: //mnt/d/tmp/third_party_hdf5/release/
And the cloned h5fortran project is at
//mnt/d/tmp/fortran-lang/h5fortran
in the fpm.toml file I added the following line:
[library]
include-dir = ["../../../tmp/third_party_hdf5/release/include","../../../tmp/third_party_hdf5/release/include/static","../../../tmp/third_party_hdf5/release/lib"]
[build]
auto-tests = false
external-modules = ["hdf5", "h5lt"]
link = ["hdf5_hl_fortran", "hdf5_fortran", "hdf5_hl", "hdf5"] #uncommented this one instead of the default since in the build dir I do have hl ...
I also tried completing the command line with
export HDF5LIB="//mnt/d/tmp/third_party_hdf5/release/lib/"
export HDF5INC="//mnt/d/tmp/third_party_hdf5/release/include/"
fpm build --profile release --flag "-I$HDF5INC -L$HDF5LIB"
To no avail
Any clues? Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions