ROCm / hipfort

Fortran interfaces for ROCm libraries
https://rocm.docs.amd.com/projects/hipfort/en/latest/
Other
68 stars 37 forks source link

CMake configuration error #85

Open rdiarra opened 2 years ago

rdiarra commented 2 years ago

Hi,

I'm trying to install hipfort on an AMD platform.

I get following error during CMake configuration step :

-- HIPFORT -------------  cmake START -------------------
-- HIPFORT_COMPILER:       /usr/bin/gfortran
-- HIPFORT_AR:             /usr/bin/gcc-ar
-- HIPFORT_RANLIB:         /usr/bin/gcc-ranlib
-- HIPFORT_COMPILER_FLAGS: -ffree-form -cpp -ffree-line-length-none -fmax-errors=5
-- HIPFORT_BUILD_TYPE:     RELEASE
-- HIPFORT_INSTALL_DIR:    /home/rdiarra/hipfft_sample/hipfort/install
-- HIPFORT_VERSION:        0.4-0
-- HIPFORT ----------------------------------------------
-- The Fortran compiler identification is Cray 13.0
-- The C compiler identification is Clang 13.0.1
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.7.13/bin/ftn - skipped
-- Checking whether /opt/cray/pe/craype/2.7.13/bin/ftn supports Fortran 90
-- Checking whether /opt/cray/pe/craype/2.7.13/bin/ftn supports Fortran 90 - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/cray/pe/craype/2.7.13/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_INSTALL_PREFIX:/home/rdiarra/hipfft_sample/hipfort/install
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL but not MODULE mangling
-- Verifying Fortran/C Compiler Compatibility
-- Verifying Fortran/C Compiler Compatibility - Success
-- Checking whether /opt/cray/pe/craype/2.7.13/bin/ftn supports Fortran 08
-- Checking whether /opt/cray/pe/craype/2.7.13/bin/ftn supports Fortran 08 - yes
CMake Error at cmake/Modules/SetCompileFlag.cmake:109 (MESSAGE):
  No compile flags were found
Call Stack (most recent call first):
  cmake/Modules/SetFortranFlags.cmake:83 (SET_COMPILE_FLAG)
  CMakeLists.txt:114 (INCLUDE)

-- Configuring incomplete, errors occurred!

Loaded modules in my environment are :

Currently Loaded Modules:
  1) perftools-base/21.12.0   3) craype/2.7.13       5) craype-network-ofi   7) craype-x86-rome      9) cray-libsci/21.08.1.2  11) craype-accel-amd-gfx908
  2) cce/13.0.1               4) PrgEnv-cray/8.1.0   6) cray-mpich/8.1.13    8) cray-fftw/3.3.8.12  10) libfabric/1.13.1       12) rocm/4.5.0

How can I resolve this problem ? Thank

mxxw commented 1 year ago

I built hipfort with crayftn (ftn driver of CCE) and initially got the same error. The workaround was to give cmake the additional command line argument of -DHIPFORT_COMPILER_FLAGS="${YOUR_FAVORITE_FLAGS_HERE}". It would have been nice if the CMake error message "No compile flags were found" would have been followed by something like: You must specify the Fortran compiler flags to build hipfort with to cmake via '-DHIPFORT_COMPILER_FLAGS="..." ' , rather than leave the user guessing what flags cmake expects where for what purpose.

ppanchad-amd commented 1 month ago

@rdiarra Please test with the latest ROCm 6.1.3. If issue is resolved, please close the ticket. Thanks!