- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying my hand at building and using library files (.so extension), using ifort 10.1.011 on 64-bit RH Enterprise Linux 5.
I have defined both LD_LIBRARY_PATH and LIBRARY_PATH to point to the directory where the library resides, but the linker still does not find it. Here is a copy of the linker command & output, and of two ls commands. As you can see, if I do an ls using the values of the environment variables, the file is there:
(output from make:)
ifort -o profile_test profile_test.o libprofiles.so libtecplot_utils.so
ld: libtecplot_utils.so: No such file: No such file or directory
make: *** [profile_test] Error 1
> ls `echo $LD_LIBRARY_PATH | cut -d: -f1`
libtecplot_utils.so
> ls $LIBRARY_PATH
libtecplot_utils.so
Is there some other environment variable that I need to set? Or am I missing something that ld is trying to tell me.
I am also confused about the roles of LD_LIBRARY_PATH and LIBRARY_PATH. Are they both for the same purpose?
Thank you,
Mirko
I have defined both LD_LIBRARY_PATH and LIBRARY_PATH to point to the directory where the library resides, but the linker still does not find it. Here is a copy of the linker command & output, and of two ls commands. As you can see, if I do an ls using the values of the environment variables, the file is there:
(output from make:)
ifort -o profile_test profile_test.o libprofiles.so libtecplot_utils.so
ld: libtecplot_utils.so: No such file: No such file or directory
make: *** [profile_test] Error 1
> ls `echo $LD_LIBRARY_PATH | cut -d: -f1`
libtecplot_utils.so
> ls $LIBRARY_PATH
libtecplot_utils.so
Is there some other environment variable that I need to set? Or am I missing something that ld is trying to tell me.
I am also confused about the roles of LD_LIBRARY_PATH and LIBRARY_PATH. Are they both for the same purpose?
Thank you,
Mirko
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At link time, you must employ the usual unix/linux syntax to specify the path and library name e.g.
ifort -L ..... *.o -ltecplot_utils
or specify the full path name of the .so, when it is not on a -L path.
LD_LIBRARY_PATH doesn't have effect at link time; you will need it at run time.
ifort -L
or specify the full path name of the .so, when it is not on a -L path.
LD_LIBRARY_PATH doesn't have effect at link time; you will need it at run time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Of course!
what confused me was that during my initial testing, I had the library in the same directory with the other code. So, I was able to link to it by just refering explicitly to it (without the -l option).
Off course, that broke down, once I placed it in the library directory.
Thank you very much
Mirko
what confused me was that during my initial testing, I had the library in the same directory with the other code. So, I was able to link to it by just refering explicitly to it (without the -l option).
Off course, that broke down, once I placed it in the library directory.
Thank you very much
Mirko

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