- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this possible to instruct the icc complier to use the standard math library instead of libimf?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this:
1. do not use the "mathimf.h" from icc
2. use -nodefaultlibs -llibrary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. I do not include "mathimf.c", but I do "math.h".
2. Tried linking with -nodefaultlibs -limf
but I get the following error on linking:
/usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i586-suse-linux/4.1.2/../../../crt1.o: In function `_start':
(.text+0x11): undefined reference to `__libc_csu_init'
make: *** [...] Error 1
I am using OpenSuse 10.2, 32 bit, and icc 10.0
Any further help will be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Another suggestion is to use the -static-intel option for the 10.0 compilers (this was -i-static 9.1 & earlier). This will statically link in all of the functions in all Intel provided libraries that your application requires. You can look at the exe size with and without this option to see how much code is being pulled in from libimf, it's possible no code is for you app. Hopefully this will solve your code size issue by avoiding having to redistribute libimf.
When you specify -nodefaultlibs, you need to specify all libraries needed to link, so you would need to pass libc & other libs. You can see which libs are required by running icc -dryrun hello.c - this shows how ld is called. You will need to pass these options to icc (via -Xlinker option), & remove libimf. This is more work, so hopefully statically linking the Intel provide libs solves the problems. Let us know if this works or doesn't, and we can see if there are other ways to solve this.
best regards,
_|ohnO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
only 80 KB overhead on a 1.4 MB binary.
I didn't know that linkers got so smart that they now statically link just what you use, not the whole blob.
Thank you for your help,
Duan Peterc
http://www.arahne.si
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I statically link libimf using GCC compiler.
I have a simple program that I want to statically link with Libimf
#include <stdio.h>
#include <math.h>
int main(){
int c=0;
float k = 6.25;
float sin_value = powf(2.15,k);
printf("POW(2.15,6.25) : %f \n", sin_value);
return 0;
}
gcc powf-example.c -static /pathtointelLibrary/libimf.a
gives the following error
undefined reference to `__intel_cpu_feature_indicator_x'
libm_feature_flag.c:(.text+0x5a): undefined reference to `__intel_cpu_features_init_x'
libm_feature_flag.c:(.text+0x80): undefined reference to `__intel_cpu_features_init_x'
libm_feature_flag.c:(.text+0xa5): undefined reference to `__intel_cpu_features_init_x'
libm_feature_flag.c:(.text+0xc4): undefined reference to `__intel_cpu_features_init_x'
libm_feature_flag.c:(.text+0xe3): undefined reference to `__intel_cpu_features_init_x'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the same issue with the static version of libimf:
undefined reference to `__intel_cpu_feature_indicator_x'
libm_feature_flag.c:(.text+0x5a): undefined reference to `__intel_cpu_features_init_x'
But linking against the shared version libimf.so succeeds. Symbols __intel_cpu_feature_indicator_x and __intel_cpu_features_init_x are undefined in both libimf.a and libimf.so. So why it is possible to link against libimf.so, but not possible to link against libimf.a?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page