- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to build a custom .so to link my C++ software against but I am having trouble.
Are there clear and detailed instructions to build a custom .so using CMake that I could find somewhere? If not, can someone guide me through the process. I have instructions for a custom dll from IPP version 6 and sample code from the IPP website but I can't make it work.
From what I understand, I need 4 files:
- exports.def (or .txt) containing the list of fucntions I need.
- funclist.h containing the declarations of the functions from the ipp*.h files.
- some sort of .c file (dllmain.c or init.c) to bring everything together. This is where I get lost...
- CMakeLists.txt to compile everything.
Are these the only files I need? What are they supposed to contain?
Thank you very much for your help!
Nicolas
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nikolas,
as I understand you would like to build custom shared library on Linux, so I provide instructions and examples for Linux:
1) define export.txt (you can use any filename) file with exact list of IPP functions which will be exported in your library, for example:
EXTERN( ippiGetLibVersion )
EXTERN( ippsGetLibVersion )
EXTERN( ippiMalloc_16s_C1 )
EXTERN( ippiFree )
EXTERN( ippiSet_16s_C1R )
EXTERN( ippiMul_16s_C1RSfs )
VERSION {
{
global:
ippiGetLibVersion;
ippsGetLibVersion;
ippiMalloc_16s_C1;
ippiFree;
ippiSet_16s_C1R;
ippiMul_16s_C1RSfs;
local: *;
};
}
2) define _init() function where you should call ippInit() to initialize IPP dispatcher (main.c):
#include "ipp.h" int _init(void) { ippInit(); return 1; } void _fini(void) { }
3) compile main.c with -fPIC option and build your shared library:
ld -shared export.txt -o libmylib.so main.o $(IPPROOT)/lib/intel64/libippi.a $(IPPROOT)/lib/intel64/libipps.a $(IPPROOT)/lib/intel64/libippcore.a -lc
That all.
Pavel

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