- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Robert,
Does it work if you remove -ipo and -ipo-jobs20 options?
Best regards,
Viet Hoang

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