CMake configuration error
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
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.
@rdiarra Please test with the latest ROCm 6.1.3. If issue is resolved, please close the ticket. Thanks!
@rdiarra Hi, have your issue been resolved? It seems to be a really odd issue based on your output. The problematic code https://github.com/ROCm/hipfort/blob/release/rocm-rel-6.0/cmake/Modules/SetFortranFlags.cmake#L83 suggest that dummy compilation tests are failing for the "-O0" flag. This is not normal and is likely problem or the environment e.g. file/dir permission of the ./build/CMakeFiles/CMakeTmp directory.
To debug, please try to following steps:
- Create a dummy file with
vi ./build/CMakeFiles/CMakeTmp/test.f90 - Paste the following into the file; save and exit.
program dummyprog
i = 5
end program dummyprog
- Try to build the file with -O0 flag
cd ./build/CMakeFiles/CMakeTmp && /opt/cray/pe/craype/2.7.13/bin/ftn -O0 ./test.f90
Report any error message you see.
Thanks!
Hi, this issue will be closed for now due to inactivity. Please feel free to re-open or add a follow up in the future. Thank you!