[cmake-developers] patch that adds -KPIC flag to SunPro Fortran compiler

Brad King brad.king at kitware.com
Tue Mar 24 08:52:45 EDT 2015


On 03/24/2015 04:38 AM, Steven Vancoillie wrote:
> On Mar 23 [10:33], Brad King wrote:
>> * The _VERBOSE_FLAG is -v for most languages and -# for ASM.
> 
> The verbose flags for SunPro compilers are documented as:
>   Sun C compiler: -# (-v enables stricter semantic checks)
>   Sun CXX compiler: -# (-v turns on -verbose=diags, seems similar)
>   Sun ASM compiler: none (-v/-# are not recognized)
>   Sun Fortran compiler: -v (-# works too)
> Since the current verbose flags are thus not correct, I've left
> this alone in this patch, as it should be pure refactoring. Maybe
> they can go in a separate patch?

Okay.  The purpose of this flag for CMake is to be able to see the
ld invocation that the compiler front-end produces.  This is used
while enabling a language to collect the implicit linker search
paths and libraries that the compiler front-end uses.  We can
change the flags from their current setting as long as this works.
Look at CMakeFiles/*/CMake*Compiler.cmake for the detection results
and in CMakeFiles/CMakeOutput.log for a log of the extraction process.

Please first create a patch to fix all the flags with corresponding
explanations and documentation references.  Then a second patch can
do the refactoring and consolidation of duplicate flags.

> The _CREATE_PREPROCESSED_SOURCE rule for Fortran is now overwritten
> again in the Fortran-specific file to use the -F option.

Good.

> I've attached the new patch. This does not strictly follow your
> rule, as now there will be a CMAKE_ASM_COMPILE_OPTIONS_PIC variable
> set because of the macro (before this was not set). Should I unset it
> again in the ASM-specific file?

Yes.  If there is no verbose flag for ASM either then that should
be unset too.

Thanks,
-Brad



More information about the cmake-developers mailing list