0

I've been trying to create a static library (.lib) with some DSP classes of mine. The DSP classes use the Eigen library which in turn utilizes MKL and IPP.

My issue is that I can't find a way to create this static library that will be a "standalone", i.e. if I create an application project, I will only need to include my own DSP library .lib file and it's header file(s).

When I try to create a static library out of the static versions of IPP and MKL I get a LNK1189 error that the number of allowed symbols are exceeded.

So far the only thing that works is using the dynamic versions of IPP and MKL and of course adding the redist paths of IPP and MKL to the Windows environment path variable. Sadly, that cancels the whole point of using one set of header files (my own, that reference ipp headers) and my .lib file.

I will be more than happy to elaborate if it is not clear what I am trying to do.

Any help would be really appreciated.

lefteror
  • 3
  • 3

1 Answers1

0

Do you mean dynamic library build of your static library (your classes) and static IPP/MKL? So, you can't build your custom dynamic library because of 64K limit of symbols in DLL exceeded? Because, LNK1189 is a linker problem.

Regarding IPP, the simplest way I see to refuse from including of numerous CPU optimizations to your dynamic lib. There is a way to say compiler/linker what to take from IPP.

Look at tools/staticlib directory in your IPP installation, at readme file there. There is a description of what to do to minimize the size, and in turn, the number of public symbols in custom DLL.

But, using this method you can prepare your DLL for only one CPU architecture, say SSE42, or AVX, because there will be no CPU dispatcher in your DLL.

Regards, Sergey

Sergey Khlystov
  • 276
  • 2
  • 5
  • Hi Sergey and thanks for your answer. That is true about the nature of the error. My solution of choice would be a static library that contains everything I need to run my own DSP classes instead of a DLL, as well as not having to choose a specific architecture. An example of this is: If I use let's say ippsThreshold_64, I would like all architectures to be included in my .lib file, but not ippsTreshold_32 which I never used. Is it possible that creating a static library that utilizes IPP functions is still dispatching the correct version depending on the architecture? – lefteror Mar 07 '16 at 14:57
  • it is not easy to create a static library made of modules from other static libraries. For that, you need to know what particular object modules you need to extract from other libs and, then, to put into your lib. By the way, this is exactly what linker does when builds DLL. It doesn't take more functions then required. If Threshold_32 function is not used and called from within your lib (directly, or indirectly) it must not be included into custom DLL, unless this function is called from other IPP function internally. – Sergey Khlystov Mar 08 '16 at 07:15
  • Yes I found out the hard way. For now I am just going with concatenating statically the 3rd party libraries for less "setting-up" hassle. – lefteror Mar 08 '16 at 10:23