Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

ICC 9.1.x signbit and libimf

Intel_C_Intel
Employee
378 Views
I am trying to compile a library that uses the "signbit()" function. It is my understanding that under gcc this is a macro but with icc signbit() is an actual function that is implemented in the 'libimf.dylib' library. I did notice that icc/icpc adds the '-limf' argument to my linker command. Which is fine but I am getting the following error:

ld: Undefined symbols:
___signbit

Here is my link line:
/usr/bin/icpc -headerpad_max_install_names "CMakeFiles/Test.dir/main.o" -o Test -L/opt/intel/cc/9.1.040/lib -limf

I have verified that the path is correct and the file 'libimf.dylib' does exist.

This is with icc 9.1.040 on OS X 10.4.10 (intel) on a MacBook Pro.

I was actually trying to compile the opensource package "ParaView 3.1.0" when this error hit. The problem is down in the libXML2 library compilation and has to do with linking against libimf.

Any pointers about what I might be doing wrong would be helpful. I also noticed in the math.h file that is included with icc that there is a line:

#if defined(__PURE_SYS_C99_HEADERS__) ...

Which if I define on the command line I can get things to compile ok (because I no longer need the imf library at that point).. Is there a compiler/linker switch to get that constant defined? I tried searching the docs but came up short.

Any help to solve this would be great.

Mike Jackson
Senior Research Engineer
IMTS (www.imts.us)
0 Kudos
3 Replies
TimP
Honored Contributor III
378 Views
For once, the option you asked about is the same as gcc:
-std=c99
In recent icc versions, __signbit() appears in libimf. I don't know about old versions such as yours, but I wouldn't trust them.
0 Kudos
Intel_C_Intel
Employee
378 Views
The last time I tried the 10.x version (a few months back when it was release) there was a bug in the compiler that prevented the compilation of Qt (www.trolltech.com) so I reverted back to the latest 9.1.x version that I could find. I guess I will have to try out the latest 10.x version and see if that solves the problem.

Thanks for the suggestion.
Mike Jackson
0 Kudos
Intel_C_Intel
Employee
378 Views
So I tried 10.0.018 and I still get the same undefined symbol:

510:[mjackson@Thor:intel]$ /usr/bin/icpc -g -dynamiclib -o libTestLib.dylib -install_name /Users/mjackson/Task_7/Workspace/SignBitTest/intel/libTestLib.dylib "CMakeFiles/TestLib.dir/Test.o" -limf -L/opt/intel/cc/10.0.018/lib
xilibtool: executing 'libtool'
ld: Undefined symbols:
___signbit
libtool: internal link edit command failed

Thanks though.. I was hoping it would work
0 Kudos
Reply