[Insight-users] Bug in CMakeLists.txt for vxl libs

Mike Jackson imikejackson at gmail.com
Wed Mar 7 14:09:28 EST 2007


--  
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Mar 7, 2007, at 1:50 PM, Karthik Krishnan wrote:

> Thanks for locating this.
>
> On 3/7/07, Mike Jackson <imikejackson at gmail.com> wrote:
> InsightToolkit-3.0.1/Utilities/vxl/config/cmake/config/CMakeLists.txt
>
> There is a section in the above file that checks for the math library:
> IF(UNIX)
>    SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};m")
> ENDIF(UNIX)
>
> Although generally true, using the latest Intel compiler on OS X
> (9.1.036) will add Intel's own libimf.a for math functions. Is there
> a way to detect that the Intel Compiler is being used and not run
> this section of cmake code?
>
>
>    IF(CMAKE_C_COMPILER MATCHES "icc")
>      # c compiler is icc
>      ...
>
>    IF(CMAKE_CXX_COMPILER MATCHES "icpc")
>      # c++ compiler is icc
>      ...
>
Thanks.. I'll look into this.


> I don't know if you need to add a few OsX version check or icc  
> version checks or both in there too..
>
>   ie.
> Is this specific to the Intel math library, libmf version 9.1
> and/or Is it specifc to the Intel math lib libmf on OsX
> and/or Is it specifc to the Intel math lib libmf on OsX Tiger ??

For those who don't know, OS X 10.4 was the first OS X to run on  
Intel, so the OS X version MUST be at least 10.4 (Tiger). The version  
of the Intel Compiler is at last 9.1 as that was the first version to  
run (non-beta) on OS X.

I took out the IF(UNIX) thing and the libs are still trying to link  
against libm. I have no idea where it is coming from at this point.

According to the intel docs, as long as #include <mathimf.h> is  
somewhere in the includes, the intel compiler will use its own math  
library (by statically linking), obviating the need for libm.
   So where all would I start looking to remove the addition of libm  
into the link_libraries?


> Nobody I guess has really tried building with the intel compiler on  
> OsX. ICC in itself has very few users.
  I finally have my intel mini in an accessible location to the  
internet and I would be more than happy to setup a dash board for ITK  
(and vtk for that matter) that uses icc/icpc on OS X. I just need  
some hand holding to get it done.

I also tried to compile as static libs instead of shared and all the  
warnings about duplicate definitions went away until I started  
linking some of the itk apps, like itkTestDriver, then I get the  
following:

Linking CXX executable ../../bin/itkTestDriver
cd /Users/Shared/OpenSource/ITK301-Intel/Code/IO && /usr/local/bin/ 
cmake -P CMakeFiles/itkTestDriver.dir/cmake_clean_target.cmake
cd /Users/Shared/OpenSource/ITK301-Intel/Code/IO && /usr/bin/icpc   - 
w0  -xP -fno-common -vec-report0 -headerpad_max_install_names    
"CMakeFiles/itkTestDriver.dir/itkTestDriver.o"   -o ../../bin/ 
itkTestDriver  -L. -L/Users/Shared/OpenSource/ITK301-Intel/bin - 
lITKIO -lITKNrrdIO -litkgdcm -litkjpeg12 -litkjpeg16 -litkopenjpeg - 
litkpng -litktiff -litkjpeg8 -lITKSpatialObject -lITKNumerics - 
lITKCommon -litkvnl_inst -litkvnl_algo -litkv3p_netlib -litkvnl - 
litkvcl -lm -lpthread -framework AppKit -lITKMetaIO -litksys - 
lITKDICOMParser -lITKEXPAT -lITKniftiio -lITKznz -litkzlib -lm
ld: warning multiple definitions of symbol ___isnanf
/opt/intel/cc/9.1.036/lib/libimf.a(isnan.o) definition of ___isnanf  
in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib 
(xmm_misc.o) definition of ___isnanf
ld: warning multiple definitions of symbol ___isnan
/opt/intel/cc/9.1.036/lib/libimf.a(isnan.o) definition of ___isnan in  
section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib 
(xmm_misc.o) definition of ___isnan
ld: warning multiple definitions of symbol ___isnand
/opt/intel/cc/9.1.036/lib/libimf.a(isnan.o) definition of ___isnand  
in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib 
(xmm_misc.o) definition of ___isnand
ld: warning multiple definitions of symbol _finite
/opt/intel/cc/9.1.036/lib/libimf.a(isfinite.o) definition of _finite  
in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib 
(xmm_misc.o) definition of _finite
ld: warning multiple definitions of symbol _pow
/opt/intel/cc/9.1.036/lib/libimf.a(pow_stub.o) definition of _pow in  
section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../..//libm.dylib 
(xmm_power.o) definition of _pow
/usr/local/bin/cmake -E cmake_progress_report /Users/Shared/ 
OpenSource/ITK301-Intel/CMakeFiles
[100%] Built target itkTestDriver

Any help is appreciated..


>
> Thanks
> --
> karthik
>
> or am I missing something completely?
>
> --
> Mike Jackson
> imikejackson & gmail * com
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> -- 
> Karthik Krishnan
> R&D Engineer,
> Kitware Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070307/4bbbf2a9/attachment-0001.html


More information about the Insight-users mailing list