[CMake] IBM Fortran and the C Preprocessor

Will Dicharry wdicharry at stellarscience.com
Wed Jun 24 18:21:27 EDT 2009


Brad King wrote:
> 
> As Bill said, the toolchain file is meant for cross compiling.  It can
> probably be used for normal configuration, but that is not well-tested.
> I just tried something similar to your example and the compiler id check
> works.
> 
> $ cat mytool.cmake
> set(CMAKE_SYSTEM_NAME AIX)
> set(CMAKE_Fortran_COMPILER xlf90)
> set(CMAKE_Fortran_FLAGS "-q64" CACHE STRING "")
> $ cat CMakeLists.txt
> cmake_minimum_required(VERSION 2.6)
> project(FOO Fortran)
> add_definitions(-DTADA)
> add_executable(foo foo.f)
> $ mkdir b; cd b
> $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../mytool.cmake

It turns out that the problem is not the toolchain file, it's the flag. 
  Running the following reproduces the problem on both IBMs I have 
access to:

$ FC=mpxlf90 FFLAGS="-qfixed=72" cmake ..

However,

$ FC=mpxlf90 FFLAGS="-q64" cmake ..

works just fine on both systems.  How does CMake determine the compiler ID?

--Will

-- 
Will Dicharry
Software Developer
Stellar Science Ltd Co
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3344 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090624/8612a48b/attachment.bin>


More information about the CMake mailing list