- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am trying to link my code statically. The code is dynamically compiled and works fine by the linking options below:
MKL = "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.so "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.so "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.so -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -liomp5 -lpthread -lm -DMKL_Complex16="std::complex" -static-intel
Now I tried the line below to get static code:
MKL = "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_solver_lp64.a -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -openmp -lpthread -lm -DMKL_Complex16="std::complex" -static-intel
and when I use above linking, I get many unresolved referenced to almost all MKL functions I have used. Is there anything wrong with the link above? Is it also possible to just provide the path, so the compiler can statically bind all libraries needed? I read somewhere that using "-static-intel" would do such thing, but it didn't help.
Thanks,
D.
I am trying to link my code statically. The code is dynamically compiled and works fine by the linking options below:
MKL = "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.so "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.so "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.so -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -liomp5 -lpthread -lm -DMKL_Complex16="std::complex
Now I tried the line below to get static code:
MKL = "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_solver_lp64.a -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -openmp -lpthread -lm -DMKL_Complex16="std::complex
and when I use above linking, I get many unresolved referenced to almost all MKL functions I have used. Is there anything wrong with the link above? Is it also possible to just provide the path, so the compiler can statically bind all libraries needed? I read somewhere that using "-static-intel" would do such thing, but it didn't help.
Thanks,
D.
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello danltu.se!
you forgot to use -Wl,--start-group/-Wl,--end-group linker options. So, your link line will look:
MKL = "-Wl,--start-group ~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_solver_lp64.a -Wl,--end-group -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -openmp -lpthread -lm -DMKL_Complex16="std::complex" -static-intel
Andrey
you forgot to use -Wl,--start-group/-Wl,--end-group linker options. So, your link line will look:
MKL = "-Wl,--start-group ~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_lp64.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_intel_thread.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_core.a "~/intel/Compiler/11.1/064/mkl/lib/em64t"/libmkl_solver_lp64.a -Wl,--end-group -L"~/intel/Compiler/11.1/064/mkl/lib/em64t" -openmp -lpthread -lm -DMKL_Complex16="std::complex
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Andrey, when I compile with the link you said I still get this error:
error while loading shared libraries: libguide.so: cannot open shared object file: No such file or directory
should I still add more libraries to be linked?
Thanks,
D.
error while loading shared libraries: libguide.so: cannot open shared object file: No such file or directory
should I still add more libraries to be linked?
Thanks,
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
danltu.se,
is it link error or you see this message then you are running your application?
Could you provide full link line, compiler version, os name and version?
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
No, I see this error when I run my application. I use Linux and Intel C++ compiler. I also used the link you provided in your previous post.
Thanks,
D.
No, I see this error when I run my application. I use Linux and Intel C++ compiler. I also used the link you provided in your previous post.
Thanks,
D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can find this binaries into/opt/intel/Compiler/11.1/072/lib/intel64.
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I can! But how can I statically link them? I have also used "-lguide" but it didn't help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
danltu.se,
compiler shouldn`t put dependencies to libguide to your application. Looks like this dependency is coming from somewhere else (for example, from third-party libs which you are using in your application). Could you provide FULL link line?
Andrey
compiler shouldn`t put dependencies to libguide to your application. Looks like this dependency is coming from somewhere else (for example, from third-party libs which you are using in your application). Could you provide FULL link line?
Andrey
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