[CMake] Different flags for compiling and linking with Fortran
xavier lacoste
xl64100 at gmail.com
Thu Jun 15 09:29:13 EDT 2017
Hello Chuck,
Indeed I had an old 2.8.12.2 version I upgraded to 3.8.2 and get correct
detection of xlc.
But still the same error with xlf linking with -fpp if I have FFLAGS="-fpp"
:
[lacoste at caimanp8 test]$ cmake --version
cmake version 3.8.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[lacoste at caimanp8 test]$ module load xlc
[lacoste at caimanp8 test]$ module load xlf
[lacoste at caimanp8 test]$ FFLAGS="-cpp" cmake .
-- The C compiler identification is XL 13.1.5
-- The CXX compiler identification is XL 13.1.5
-- Check for working C compiler: /opt/ibm/xlC/13.1.5/bin/xlc_r
-- Check for working C compiler: /opt/ibm/xlC/13.1.5/bin/xlc_r -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/ibm/xlC/13.1.5/bin/xlC_r
-- Check for working CXX compiler: /opt/ibm/xlC/13.1.5/bin/xlC_r -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is XL 15.1.5
-- Check for working Fortran compiler: /opt/ibm/xlf/15.1.5/bin/xlf90_r
-- Check for working Fortran compiler: /opt/ibm/xlf/15.1.5/bin/xlf90_r --
broken
CMake Error at
/home/lacoste/cmake/share/cmake-3.8/Modules/CMakeTestFortranCompiler.cmake:44
(message):
The Fortran compiler "/opt/ibm/xlf/15.1.5/bin/xlf90_r" is not able to
compile a simple test program.
It fails with the following output:
Change Dir: /home/lacoste/test/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_38cf1/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_38cf1.dir/build.make
CMakeFiles/cmTC_38cf1.dir/build
gmake[1]: Entering directory `/home/lacoste/test/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_38cf1.dir/testFortranCompiler.f.o
/opt/ibm/xlf/15.1.5/bin/xlf90_r -cpp -qthreaded -qhalt=e -c
/home/lacoste/test/CMakeFiles/CMakeTmp/testFortranCompiler.f -o
CMakeFiles/cmTC_38cf1.dir/testFortranCompiler.f.o
** testfortran === End of Compilation 1 ===
1501-510 Compilation successful for file testFortranCompiler.f.
Linking Fortran executable cmTC_38cf1
/home/lacoste/cmake/bin/cmake -E cmake_link_script
CMakeFiles/cmTC_38cf1.dir/link.txt --verbose=1
/opt/ibm/xlf/15.1.5/bin/xlf90_r -Wl,-export-dynamic -cpp -qthreaded
-qhalt=e CMakeFiles/cmTC_38cf1.dir/testFortranCompiler.f.o -o cmTC_38cf1
/opt/ibm/xlf/15.1.5/bin/.orig/xlf90_r: 1501-294 (S) No input file
specified. Please use -qhelp for more information.
gmake[1]: *** [cmTC_38cf1] Error 249
gmake[1]: Leaving directory `/home/lacoste/test/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_38cf1/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:11 (ENABLE_LANGUAGE)
-- Configuring incomplete, errors occurred!
See also "/home/lacoste/test/CMakeFiles/CMakeOutput.log".
See also "/home/lacoste/test/CMakeFiles/CMakeError.log".
2017-06-15 15:06 GMT+02:00 Chuck Atkins <chuck.atkins at kitware.com>:
> Hi Xavier,
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
>>
> ...
>
>> -- The C compiler identification is Clang 3.8.0
>> -- The CXX compiler identification is Clang 3.8.0
>> ...
>>
> -- The Fortran compiler identification is XL
>>
>
> What version of CMake are you using? Give that the C and C++ compilers
> are detected as Clang then I suspect it's rather old. They should also be
> detected as XL like the Fortran compiler. Do you get the same XL Fortran
> errors using a new version of CMake?
>
> ----------
> Chuck Atkins
> Staff R&D Engineer, Scientific Computing
> Kitware, Inc.
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170615/cc0d46c3/attachment.html>
More information about the CMake
mailing list