[CMake] Unable to run cmake using absoft f95 Fortran compiler

Brad King brad.king at kitware.com
Tue Sep 1 11:58:31 EDT 2009


venugopal gudimetla wrote:
> 
> 
> Hi Brad,
> 
>>This brings us back to
>> my question: does the compiler identify itself with any documented
>> preprocessor symbol?
> 
> I checked Absoft documentation and also asked Absoft support guys, there
> doesn't seem to be a pre-processor macro which identifies itself. Except
> fot using f95 -v option.

This sounds like a feature request for the Absoft team.
I've never encountered a compiler that supports the C preprocessor
but does not define a macro to identify itself.  CMake depends on
these macros to distinguish compilers without guessing special flags.
This case is particularly problematic because the Absoft compiler
falsely identifies itself as GNU.

For now I'll have to say CMake doesn't support this compiler.
You can submit a feature request here:

  http://www.cmake.org/Bug

-Brad

>> What is the actual link line that is failing? You can see it
>> by running "make VERBOSE=1".
> 
> I cut the paste the error output from make VERBOSE=1
> 
> /usr/bin/cmake
> -H/u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5
> -B/u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5
> --check-build-system CMakeFiles/Makefile.cmake 0
> -- *The Fortran compiler identification is GNU*
> -- Check for working Fortran compiler: /opt/absoft/bin/f95
> -- Check for working Fortran compiler: /opt/absoft/bin/f95 -- broken
> CMake Error at
> */usr/share/cmake/Modules/CMakeTestFortranCompiler.cmake:25* (MESSAGE):
>   The Fortran compiler "/opt/absoft/bin/f95" is not able to compile a simple
>   test program.
> 
>   It fails with the following output:
> 
>    Change Dir:
> /u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp
>  
> 
>   Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
> 
>   gmake[1]: Entering directory
>  
> `/u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp'
> 
> 
>   /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
>   CMakeFiles/cmTryCompileExec.dir/build
> 
>   gmake[2]: Entering directory
>  
> `/u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp'
> 
> 
>   /usr/bin/cmake -E cmake_progress_report
>  
> /u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp/CMakeFiles
>   1
> 
>   Building Fortran object
>   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o
> 
>   /opt/absoft/bin/f95 -o
>   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -c
>  
> /u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp/testFortranCompiler.f
> 
> 
>   Linking Fortran executable cmTryCompileExec
> 
>   /usr/bin/cmake -E cmake_link_script
>   CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
> 
>   /opt/absoft/bin/f95 -fPIC
>   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -o
> cmTryCompileExec
>   -rdynamic
> 
>   *ERROR: Unrecognized arguments: -rdynamic*
> 
>   gmake[2]: *** [cmTryCompileExec] Error 1
> 
>   gmake[2]: Leaving directory
>  
> `/u/xeon31/people/venugopal/cgns3.05/cgns/cgns/release/3.0.5/CMakeFiles/CMakeTmp'
> 
> 
>   gmake[1]: *** [cmTryCompileExec/fast] Error 2
> 
> Please help me get around with the error.
> 
> Best Regards,
> Venu
> 
> 
> i'm EMAILING FOR THE GREATER GOOD
> Join me <http://im.live.com/Messenger/IM/Home/?source=EML_WLHM_GreaterGood>
> 
> 
> 
>> Date: Mon, 31 Aug 2009 14:23:27 -0400
>> From: brad.king at kitware.com
>> To: gudimetlav at hotmail.com
>> CC: cmake at cmake.org
>> Subject: Re: [CMake] Unable to run cmake using absoft f95 Fortran compiler
>>
>> venugopal gudimetla wrote:
>> > Thank you very much for your quick response.
>>
>> BTW, Fortran support is greatly improved in CMake's development version.
>> If you can try the latest version from CVS HEAD, please do so.
>>
>> > Yeah I noticed too that for
>> > some reason Cmakes is assuming f95 to be a GNU compiler.
>>
>> CMake is not assuming anything. It actually compiles a test source
>> file with the ".F" extension so that the preprocessor runs. The source
>> uses preprocessor definitions to detect the compiler identification.
>> I think the compiler is defining __GNUC__.
>> > In the file
>> > /cmake/Modules/CMakeDetermineFortranCompiler.cmake, I didn't see any
>> > reference to Absoft compilers, even though f90/f95 compilers are being
>> > listed as possible compilers.
>>
>> Many Fortran compiler vendors provide tools called 'f90' and 'f95'.
>>
>> > 2. I also set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") in my
>> > CMakeLists.txt, which made no difference to the error message.
>>
>> What is the actual link line that is failing? You can see it
>> by running "make VERBOSE=1".
>>
>> -Brad




More information about the CMake mailing list