View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015312CMakeCMakepublic2014-12-16 17:002016-06-10 14:31
ReporterAlan Scott 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformAllOSAllOS VersionAll
Product VersionCMake 3.0.2 
Target VersionFixed in Version 
Summary0015312: setting CMAKE_AR doesn't work
DescriptionFrom a user (Dave K):

when using the intel compilers, you need to use their "ar" tool, xiar. The first issue is that the intel ar utility is not automatically recognized when the compiler is intel. The second issue is that setting the CMAKE_AR variable does not propagate to the CMakeFiles/<version>/CMakeCCompiler and CMakeCXXCompiler files (so it's effectively ignored)

This becomes evident when using -ip and -ipo optimization flags (since they fail with static libraries linked with ar vs xiar)

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0037470)
Nils Gladitz (developer)
2014-12-16 17:23
edited on: 2014-12-16 17:25

You can try setting INTERPROCEDURAL_OPTIMIZATION [1] (or the configuration specific variants) which should add -ipo and trigger use of xiar.

[1] http://www.cmake.org/cmake/help/v3.0/prop_dir/INTERPROCEDURAL_OPTIMIZATION.html [^]

P.S. also exists as target property.

(0037471)
Alan Scott (reporter)
2014-12-16 17:39

Thanks, that adds a second workaround for the bug that we know about. Note that it looks like it needs to be set in the CMakeLists.txt as it's not explicitly exposed to cmake/ccmake.

It would be nicer if either CMAKE_AR propagated correctly and was used (vs ignored) or was auto-detected.
(0037473)
Brad King (manager)
2014-12-17 08:39

The INTERPROCEDURAL_OPTIMIZATION property is the intended interface for enabling ipo, not a workaround. The code to detect and use xiar for ipo is here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Platform/Linux-Intel.cmake;hb=v3.0.2#l21 [^]

Also one can set CMAKE_AR on the *first* run in a given build tree. That is when CMakeFiles/${version}/CMake${lang}Compiler.cmake is created.
(0042689)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-12-16 17:00 Alan Scott New Issue
2014-12-16 17:23 Nils Gladitz Note Added: 0037470
2014-12-16 17:25 Nils Gladitz Note Edited: 0037470
2014-12-16 17:39 Alan Scott Note Added: 0037471
2014-12-17 08:39 Brad King Note Added: 0037473
2016-06-10 14:29 Kitware Robot Note Added: 0042689
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team