Quantcast
Viewing all articles
Browse latest Browse all 1175

Static library created with icpc, cannot use it using g++

The objects in the library are compiled as follows:

icpc -c  -fPIC -Wno-unused-function -Wall -pthread -static-intel -O3 -axCORE-AVX2 -fma -fp-model fast=2 -funroll-all-loops -unroll-aggressive -D__AVX2__ -ffat-lto-objects -xHost -ipo -ipo-jobs20 -qopenmp-link=dynamic -o "fileN.o""fileN.cpp"

The library is created:

gcc-ar ruvs ./libtest.a file*.o

When I try to compile with g++:

g++   -Wall -pthread -O3 -march=native -mtune=native -flto=8 -minline-stringops-dynamically -fvariable-expansion-in-unroller -fweb -fgcse-sm -fgcse-las -fgcse-after-reload -fipa-pta -ftree-loop-distribution -ftree-loop-im -ftree-loop-ivcanon -fivopts -funswitch-loops -frename-registers -funroll-loops   -o MyProgram ../lib/libtest.a
./lib/libtest.a(kmp_stub.o): In function `ompc_set_num_threads':
(.text+0x0): multiple definition of `ompc_set_num_threads'
../lib/libtest.a(kmp_csupport.o):(.text+0x11f0): first defined here
collect2: error: ld returned 1 exit status

The thought problem seemed to be with openMP, if I try to make openMP dynamic with 

-qopenmp-link=dynamic

I get the same errors.

How can I create a working static library with icpc?

Thanks.

 

Thread Topic: 

Question

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>