[CMake] Supporting the Intel Compiler -- building static libraries
David Cole
david.cole at kitware.com
Fri Apr 18 07:45:06 EDT 2008
This is one of those things where you have to have the setting right before
any possible TRY_COMPILE actions in any CMakeLists files. It's
*conceptually* equivalent to changing the compiler.
What you tried by using -DCMAKE_AR should work if you start with an empty
binary tree. (And starting with an empty binary tree is a reasonable thing
to do when essentially everything needs to be rebuilt anyway.)
Does that make sense?
HTH,
David
On Thu, Apr 17, 2008 at 5:44 PM, Blezek, Daniel J., Ph.D. <
Blezek.Daniel at mayo.edu> wrote:
> Hi all,
>
> We're using the Intel compiler for some of our builds of ITK. The
> "-fast" option tries to statically link. So I thought I'd build Insight
> statically. The problem occurred when I tried to use the static libraries
> generated by "/usr/bin/ar", and the symbols could not be found. Turns out
> that the Intel compiler requires you to use their version of ar, namely
> xiar.
>
> I tried all the obvious things like changing "CMAKE_AR" in my cache
> file, defining an AR environment variable, a -DCMAKE_AR=xiar to CMake, etc.
> Turns out that the value is cached in CMakeFiles/CMakeCXXCompiler.cmake, but
> no good way to change it (the CMakeCXXCompiler.cmake overrides
> CMakeCache.txt) short of editing the file (which is what I ended up doing).
>
> Could the CMake developers provide an easy way to override the CMAKE_AR
> command to make linking statically with the Intel compiler straightforward?
>
> Thanks much,
> -dan
>
> *Daniel Blezek, PhD*
> Medical Imaging Informatics Innovation Center
> Enterprise Imaging Systems Unit
>
> P 127 or (77) 8 8886
> T 507 538 8886
> E blezek.daniel at mayo.edu
>
> Mayo Clinic
> 200 First St. S.W.
> Harwick SL-44
> Rochester, MN 55905
> mayoclinic.org
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080418/c05db4fd/attachment-0001.htm>
More information about the CMake
mailing list