Paul,
Looking at your CMakeLists.txt file - does moving the following:
add_library(Rayleigh2D_Module
Rayleigh2D_Modules/Rayleigh2D_Module.f90
Rayleigh2D_Modules/Rayleigh2D_Utils.f90
Rayleigh2D_Modules/SFL_Error_Handling.f90
Rayleigh2D_Modules/SFL_Fourier.f90
Rayleigh2D_Modules/SFL_ISO_Fortran_Env.f90
Rayleigh2D_Modules/SFL_Logical_Units.f90
Rayleigh2D_Modules/constants.f90
Rayleigh2D_Modules/derived_type_module.f90
Rayleigh2D_Modules/surface_correlated_module.f90
Rayleigh2D_Modules/surface_util_module.f90
Rayleigh2D_Modules/zbcg2_module.f90
Rayleigh2D_Modules/BiCGstab_module.f90
Rayleigh2D_Modules/R_save.f90
Rayleigh2D_Modules/version.f90
)
above the following help?
##################################################
# Library linking is handled below
##################################################
# Common libraries for all compilers
target_link_libraries (Rayleigh2D Rayleigh2D_Module FFT_Modules fftw3 hdf5
hdf5_hl hdf5_fortran hdf5hl_fortran z)
I think the target: Rayleigh2D_Module needs to be defined before use.
Allen
> Hi!
>
> We are currently trying to compile my fortran project with ifort while
> linking to hdf5. I am failing at compiling with cmake, which I would like to
> do, but I finally managed to compile with a single line in bash. I attach my
> CMakeLists.txt (which works for gfortran) and the bash command. If anyone can
> give some hints on how to link to hdf5 successfully, I would be very grateful!
>
> As a side note, it appears that on the cluster I am trying to use, only the
> h5pfc compiler is installed, not h5fc. I do not need mpi support, so if it is
> possible to skip the mpi linking, I would be happy with that - our end
> results are in the sub-GB region anyway. We are planning to extend our
> program to use MPI, but we do not need to write from more than one MPI
> process.
>
> Regards,
> Paul
>
> +++++++++++++++++
>
> Working command:
>
> h5pfc -openmp Rayleigh2D_Modules/version.f90 Rayleigh2D_Modules/constants.f90
> Rayleigh2D_Modules/derived_type_module.f90
> Rayleigh2D_Modules/SFL_ISO_Fortran_Env.f90
> Rayleigh2D_Modules/SFL_Logical_Units.f90
> Rayleigh2D_Modules/Rayleigh2D_Utils.f90 Rayleigh2D_Modules/R_save.f90
> Rayleigh2D_Modules/SFL_Error_Handling.f90 Rayleigh2D_Modules/SFL_Fourier.f90
> Rayleigh2D_Modules/surface_util_module.f90
> Rayleigh2D_Modules/surface_correlated_module.f90
> Rayleigh2D_Modules/Rayleigh2D_Module.f90 FFT_Modules/fft_nms.f
> FFT_Modules/fftpack.f90 Rayleigh2D.f90 -o Rayleigh2D -lmkl_intel_lp64
> -lmkl_intel_thread -lmkl_core -lguide -I. -L.
>
> $ h5pfc -show
> mpif90 -fPIC -I/share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/include
> -L/share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib
> /share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib/libhdf5hl_fortran.a
> /share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib/libhdf5_hl.a
> /share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib/libhdf5_fortran.a
> /share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib/libhdf5.a -lz -lm
> -lgpfs -Wl,-rpath -Wl,/share/apps/modulessoftware/hdf5/hdf-5.1.8.5-intel/lib
>
> $ mpif90 -show
> ifort -I/share/apps/modulessoftware/openmpi/openmpi-1.4.3-intel/include
> -I/share/apps/modulessoftware/openmpi/openmpi-1.4.3-intel/lib
> -L/share/apps/modulessoftware/openmpi/openmpi-1.4.3-intel/lib -lmpi_f90
> -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil
>
>
>
>
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org