[cmake-developers] FindOpenMP and gfortran
Alin Marin Elena
alinm.elena at gmail.com
Tue Nov 18 10:10:47 EST 2014
Dear All,
I tried today FindOpenMP from 3.1.0 rc2 and gfortran (4.8.3) both on a
opensuse box...
I had the surprise to get failure to find the openmp. After some
digging I have found the route causes.
1. gfortran thinks .F files are fixed form
a simple test CMakeLists.txt to show the issue
project(hello Fortran)
#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Utils")
find_package(OpenMP REQUIRED)
error::
Performing Fortran SOURCE FILE Test OpenMP_FLAG_DETECTED failed with
the following output:
Change Dir: /home/alin/playground/
testopenmpcmake/build-error/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTryCompileExec2926444443/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec2926444443.dir/build.make
CMakeFiles/cmTryCompileExec2926444443.dir/build
gmake[1]: Entering directory
'/home/alin/playground/testopenmpcmake/build-error/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/alin/playground/testopenmpcmake/build-error/CMakeFiles/CMakeTmp/CMakeFiles
1
Building Fortran object CMakeFiles/cmTryCompileExec2926444443.dir/src.F.o
/usr/bin/gfortran -DOpenMP_FLAG_DETECTED -fopenmp -c
/home/alin/playground/testopenmpcmake/build-error/CMakeFiles/CMakeTmp/src.F
-o CMakeFiles/cmTryCompil
eExec2926444443.dir/src.F.o
/home/alin/playground/testopenmpcmake/build-error/CMakeFiles/CMakeTmp/src.F:2.1:
program test
1
Error: Non-numeric character in statement label at (1)
/home/alin/playground/testopenmpcmake/build-error/CMakeFiles/CMakeTmp/src.F:2.1:
more to follow.
I have found two workarounds each of them have pros and cons in which
I will not enter as I do not have a strong feeling for any of the
solutions.
1. change .F to .F90 in
CheckFortranSourceCompiles.cmake
2. the fortran test in FindOpenMP.cmake shall be provided in fixed
form (add 6 empty spaces in front of the character of each line)
the original bug/feature was introduced by this
https://www.cmake.org/Bug/view.php?id=14656&history=1
regards,
Alin
Without Questions there are no Answers!
______________________________________________________________________
Dr. Alin Marin ELENA
http://alin.elenaworld.net/
______________________________________________________________________
More information about the cmake-developers
mailing list