- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've been using intel composer for few years on windows. I've recently switched to linux and i'm evaluating the parallel studio xe.
My question is when i compile and output an executable on linux it does not work on another computer unless the mkl library is also installed on it. On windows i could give the executable to our clients without them needing to install the mkl library. Is it possible to have an executable on linux that works on every linux computer without installing the libraries ?
Any help is appreciated.
Thanks,
AZ
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As on Windows, you need to specify that you want to link to static libraries. My guess is that you are linking to the MKL shared objects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve, on windows i use MVS IDE where i can easily set the libraries to be static. On Linux i use a terminal where i give the command: ifort -mkl -qopenmp source.f90 -o output
i guess from your reply this command does not specify the library to be static. I would be thankful if you can tell me what do i need to add to make it work.
Many thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding -static-intel . I am unsure if that affects MKL, it may. Otherwise you should check out the MKL Link Line Advisor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-static-intel didn't work
so i used the link line advisor (full command below) and it didn't work either, please advise what i'm doing wrong:
ifort -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl -c Source.f90 -o output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suggest you ask in the MKL forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The presence of -c in the command line shown in #5 makes the whole undertaking pointless, since that option inhibits linking, and all the other options pertain to linking. Furthermore, since you also have a -o option, the object file resulting from the compilation is given an incorrect suffix, possibly rendering it useless.
Either no linking took place, or there is a different linking command in a makefile (?) that does not do what you want it to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you mecej4, could you please advise how should i change the command line? I tried separating -c source.f90 into another command line but i still get the same error when running the code on a different machine where mkl is not installed !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So far, you have not shown us the command that produced an executable file, nor have you told us much about the source files and library routines that they use. We do not know the compiler version and the platform details. Without all this information being provided, there is no way that I can advise you what to do.
If you are going to do development in a command line environment, you need to learn about file types, file suffixes, and the basic procedures involved in producing object files and linking those to produce an executable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the source is very simple for testing
program test
use omp_lib
implicit none
integer::i
i=omp_get_thread_num()
write(*,*)'test',i
end
to compile i write: ifort source.f90 -mkl -qopenmp
i'm using intel parallel studio xe 2019 as i've mentioned in the title
problem when i run a.out on a different computer where the parallel studio is not installed i get the following: error while loading shared libraries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your program does not use MKL.Therefore, none of the extra MKL libraries that you specified in #5 were necessary.
What is the name of the missing shared library on the "different" machine? What is the output of the command
ldd ./a.out
when run on the development machine?
It is probable that the only shared library needed is libiomp5.so. If so, you have to copy that file (assuming that your license permits this) to the second machine. Such dependencies are not uncommon on Linux, even when you compiled using static libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this one doesn't, my original program calls pardiso solver, i've reduced the program to this simple one trying to find the root of the problem still couldn't.
For this one true the missing library is libiomp5.so, and even if i copy this file from intel parallel studio folder to the same directory where the executable is i get the same error message. Even on the same development machine, if i open a new terminal trying to run the executable i get the same error message unless i do "source psxevars.sh" then it works on the development machine but not on another machine where parallel studio is not installed.
When i type ldd ./a.out i get the following:
linux-vdso.so.1 (0x00007fff5dff4000)
libiomp5.so => /home/ali/intel/compilers_and_libraries_2019.2.187/linux/compiler/lib/intel64_lin/libiomp5.so (0x00007fe23d7ed000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe23d44f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe23d230000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe23ce3f000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe23cc27000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe23ca23000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe23dbd5000)
Hope you can help with this !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the second machine, where did you install libiomp5.so? If that was not in /usr/lib64 (for 64 bit) or /usr/lib, you need to make sure that the environment variable LD_LIBRARY_PATH contains the path to the directory within which libiomp5.so is located, and that the shared library has the correct permissions set.
On the development machine, one of the tasks that source psxevars.sh accomplishes is to set LD_LIBRARY_PATH. To see this, use the command echo $LD_LIBRARY_PATH before and after the command source psxevars.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i've copied the libiomp5.so to usr/lib, now when i run a.out i get "wrong ELF class" !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That means that you either used a 32bit library on a 64bit system or vice versa.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In situations like this, the Unix/Linux file command can be helpful in knowing more about the nature of a file:
$ file /usr/lib/libiomp5.so
If the file is a 64-bit shared library, you should move it from /usr/lib to /usr/lib64 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you this fixed this problem, however if i just introduce the pardiso solver from the manual it works on the development machine but on the virgin machine i get:
"kmp_aligned_malloc version VERSION not defined in file libiomp5.so with link time reference"
i don't know if this could be fixed by copying another library ?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page