- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to make my gfortran compiled program to use intel mkl's pow implementation.
I managed to use LD_PRELOAD trick as follows (same line, gnu.out is my executable):
LD_PRELOAD=/software/x86_64/intel/parallel_studio_xe_2020_update4/compilers_and_libraries_2020.4.304/linux/compiler/lib/intel64_lin/libimf.so ./gnu.out
But I would like to use only pow implementation - this way, I can control which functions I change implementation to.
So ideally, here is what I want:
LD_PRELOAD=/path/to/part_of_libm.so ./gnu.out
when part_of_libm.so only includes the implementation of pow, and no other functions.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the following example will create *.so for pow
extract object files from archive
mkdir temp
cd temp
ar x /path/to/parallel_studio_xe_.../compilers_and_libraries_.../linux/compiler/lib/intel64_lin/libimf.a
ar x /path/to/parallel_studio_xe_.../compilers_and_libraries_.../linux/compiler/lib/intel64_lin/libirc.a cpu_feature_disp.o
create shared object from object files
gcc -shared -o libpow.so pow*.o libm_feature_flag.o cpu_feature_disp.o logq_table.o scaleq_table.o const_q_table.o logl_table.o rcpq_table.o rcp_table.o expl_table.o expq_table.o
load needed library and run
LD_PRELOAD=/path/to/libpowf.so ./a.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As suggested by @OrenMustaki, you would need to extract the object files of the library file and create a library file out of those object files that are required.
Let us know if your issue is resolved.
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked, but how can I tell which o files do I need? Is there an automated way to do so? @RahulV_intel @OrenMustaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To create a custom shared library/objects, follow the link below:
On Linux:
On Windows:
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Any updates on this? Feel free to let us know if you face any issues.
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are assuming that the solution provided helped and would no longer be monitoring this issue. Please raise a new thread if you have further issues.
Regards,
Rahul

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page