LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2017, 06:46 AM   #1
matti_chr
LQ Newbie
 
Registered: Sep 2017
Location: Hannover, Germany
Distribution: Linux Mint Sonya 64bit
Posts: 5

Rep: Reputation: Disabled
Problems using "make" and executing program


Hello everyone,

I am from Germany and very new to Linux. In school I had some courses with programming in Java and i did some work with Matlab etc. Further than this i have no experience with programming etc.

For a project I need Linux to run the program FEAP, I got some files including "makefile". Because of that I installed Linux Mint Sonya 64bit on my "old" notebook Toshiba A200. Installation went well.
Additionally I installed Intel Fortran Compiler (because I need it). After some problems with the program itself i could fix myself, I am now facing some problems:
  1. While running the makefile:
    ifort -o ../feap -L/usr/X11R6/lib64 -lX11 -lm ../64b/*.o -L../lib -lmkl_solver -lmkl_lapack -lmkl_em64t -lguide -lpthread ../lib/feaplib.a
    ifort: warning #10315: specifying -lm before files may supersede the Intel(R) math library and affect performance
  1. When I execute the "feap":
    ./feap: error while loading shared libraries: libguide.so: cannot open shared object file: No such file or directory

Thanks in advance!
Maybe the questions are "stupid" or if there are some informations missing: Sorry

Last edited by matti_chr; 09-21-2017 at 06:48 AM. Reason: more info
 
Old 09-21-2017, 07:12 AM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX, NuTyX
Posts: 1,488
Blog Entries: 2

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
The make message is a warning, not an error, so it shouldn't affect your build. The second message is the important one.

Error messages in Linux tend to be very informative once you have learned to look at them properly and this is a case in point. It tells you that libguide.so, one of the libraries which feap is supposed to link to, can't be found. You will have to find out what package this library belongs to (try googling the name) and install it.

There are no stupid questions! There are only stupid people who won't learn. You have given your post a reasonable title and quoted the messages you received, so you strike me as an intelligent person who should be able to learn from this.
 
3 members found this post helpful.
Old 09-21-2017, 07:23 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,979
Blog Entries: 12

Rep: Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044
Hi matti_chr and welcome to LQ.

Your system should have an environment variable named LD_LIBRARY_PATH set. If not, then this should be set to point to the system directories.

Please search your system for libguide.so to see if it is already there, or if you need to install it. If it is there, then check to see if you have the LD_LIBRARY_PATH environment variable and whether or not it includes a path to where this library resides. It should be there because this is part of the Intel FORTRAN compiler. What I recommend is that you check the documentation for that compiler to determine if it recommends you update your LD_LIBRARY_PATH once you've installed the compiler, so as to include the library directories which were installed.

Additionally if you're going to perform FORTRAN programming, you should become familiar with the compiler documentation, https://software.intel.com/sites/def...6366-ifort.txt

I'm moving this question to the Programming forum to get it additional exposure.
 
2 members found this post helpful.
Old 09-21-2017, 07:51 AM   #4
matti_chr
LQ Newbie
 
Registered: Sep 2017
Location: Hannover, Germany
Distribution: Linux Mint Sonya 64bit
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you both for your quick friendly reply and help.

1) I thought that this warning is "just a warning", thank you for the confirmation, so I can focus on the error.

2) I read the Error message Linux gave me. I looked for the lipguide.so, it exists. So my next thought that probably I need to "tell" where to find. On this point I decided to ask for help.
So I think I need to set the LD_LIBRARY_PATH, right? But how? Maybe the answer is simple...

Thank you!
 
Old 09-21-2017, 07:56 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,979
Blog Entries: 12

Rep: Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044
This should be in your .bashrc file located in your user home directory.

You can see that file using the 'ls -a' command.

You should be able to edit it with whichever editor you are normally using.

If there is no variable saying this, then do recommend you check your documentation for the tools to inform you how to set that up, however a line such as:
Code:
LD_LIBRARY_PATH=/lib:/usr/lib
Where you put in all relevant paths separated by a full colon, if you have more than one path to put into it. That is an example only and you should either add to whatever you have already, thus using the colon to separate paths, or you should create it only using the path to the library where you have found the file.

Last edited by rtmistler; 09-21-2017 at 07:57 AM.
 
Old 09-21-2017, 08:28 AM   #6
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,155

Rep: Reputation: Disabled
You may need to run ldconfig.
 
1 members found this post helpful.
Old 09-21-2017, 08:29 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,320

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
@OP: Exactly where did you find this libguide.so in your filesystem?
 
Old 09-21-2017, 08:46 AM   #8
matti_chr
LQ Newbie
 
Registered: Sep 2017
Location: Hannover, Germany
Distribution: Linux Mint Sonya 64bit
Posts: 5

Original Poster
Rep: Reputation: Disabled
Ok, the program is running. What I did for the LD_LIBRARY_PATH, I used the following command in the terminal:

export LD_LIBRARY_PATH=/home/matti/Dokumente/feap81/lib


@NevemTeve: above you can the the directory of the libguide.so

Thank you all so far for your help from all over the world, I really appreciate that!
 
Old 09-21-2017, 09:47 AM   #9
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX, NuTyX
Posts: 1,488
Blog Entries: 2

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
I wouldn't do it that way. If you have LD_LIBRARY_PATH set, it should include all the library paths that you use. Otherwise, other programs might start playing up.

By default, /lib and /usr/lib are always searched for libraries. If you have other library locations on your system (for example /opt/lib), they need to be specified somewhere.

Another way would be to put these paths into /etc/ld.so.conf and then run ldconfig. That way you don't need LD_LIBRARY_PATH.

You might find this reference useful.
 
1 members found this post helpful.
Old 09-21-2017, 10:07 AM   #10
matti_chr
LQ Newbie
 
Registered: Sep 2017
Location: Hannover, Germany
Distribution: Linux Mint Sonya 64bit
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thumbs down

For my understanding:

Quote:
I wouldn't do it that way. If you have LD_LIBRARY_PATH set, it should include all the library paths that you use. Otherwise, other programs might start playing up.
With my command I set the path just to the specific library and other programs can have problems, correct?

Quote:
By default, /lib and /usr/lib are always searched for libraries. If you have other library locations on your system (for example /opt/lib), they need to be specified somewhere.
Means because I set up the path by command, other programs do not search in this default libraries?

What would be the "best" (or not problem causing) solution?

Following quote is from your link:
Quote:
The best way to use LD_LIBRARY_PATH is to set it on the command line or script immediately before executing the program. This way you can keep the new LD_LIBRARY_PATH isolated from the rest of your system.
Because of that I thought using a command before the program causes the least trouble
 
Old 09-21-2017, 10:18 AM   #11
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,320

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
@OP: So you have installed this 'feap' program manually into your own home-directory? Then it is no wonder that it doesn't find its own shared libraries.
You could try something like this (if the executable is /home/matti/Dokumente/feap81/bin/feap):
Code:
cd /home/matti/Dokumente/feap81/bin
mv feap feap.bin
cat >feap <<DONE
#!/bin/sh
export LD_LIBRARY_PATH=/home/matti/Dokumente/feap81/lib
exec /home/matti/Dokumente/feap81/bin/feap.bin "$@"
DONE
chmod +x feap

Last edited by NevemTeve; 09-21-2017 at 10:59 AM. Reason: chmod +x is necessary, too
 
1 members found this post helpful.
Old 09-21-2017, 10:35 AM   #12
matti_chr
LQ Newbie
 
Registered: Sep 2017
Location: Hannover, Germany
Distribution: Linux Mint Sonya 64bit
Posts: 5

Original Poster
Rep: Reputation: Disabled
@NevemTeve:
I am thankful for every hint.
I was given some files on USB-Stick for the feap program. Those files include the libguide.so and the makefile. I copied this files to /home/matti/dokumente/feap81.
  1. What is wrong with that? Where should I copy it to?
I then used the make command for the makefile and everything was done automatically. After that I had the problem with the library which I can solve with the command.

Thank you for the code, but would you maybe comment what it will do before I just copy and paste? I understand that it will "move" (mv) someway...
 
Old 09-21-2017, 10:37 AM   #13
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: Debian, Crux, LFS, AntiX, NuTyX
Posts: 1,488
Blog Entries: 2

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
Quote:
Originally Posted by matti_chr View Post
For my understanding:
With my command I set the path just to the specific library and other programs can have problems, correct?
If they are looking for libraries off the standard path (e.g in /opt/lib or /usr/local/lib, you might have problems, yes. It's always better, if you already have a LD_LIBRARY_PATH variable, to add new libraries to that existing path.
Quote:
Means because I set up the path by command, other programs do not search in this default libraries?
The linker always searches the two default libraries (/lib and /usr/lib) because they are hard-coded into the program. Other library locations are only searched if they are specified either in /etc/ld.so.conf or in the LD_LIBRARY_PATH environmental variable.
Quote:
What would be the "best" (or not problem causing) solution?
Depends on what you really want! Putting a library path into /etc/ld.so.conf makes it available to all users. LD_LIBRARY_PATH is for a single user. In addition, the paths named in this variable take precedence over the ones in /etc/ld.so.conf, which might make a difference if you had different versions of a library in different places..
Quote:
Because of that I thought using a command before the program causes the least trouble
Ah! So you are going to use it as a one-off environmental variable on the command line. Then I withdraw my objection. Doing that can't affect any other program.
 
1 members found this post helpful.
Old 09-21-2017, 11:00 AM   #14
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,320

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
@OP: This thing is called loader script or launcher script: it sets some environment-variables, then executes the actual binary program.

If it is properly created, running /home/matti/Dokumente/feap81/bin/feap will start the launcher script, that will set LD_LIBRARY_PATH then execute the binary program. Note: you have to correct the file-names so they match your installation.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
executing "DOS/Windows executable" files from "/media" Ruarscampbell Linux - Newbie 10 07-05-2011 06:48 PM
[SOLVED] "Allow executing file as program" stuck Steve W Linux - Newbie 3 05-18-2011 04:03 AM
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 08:54 AM
problem with executing "make menuconfig" foxy17 Slackware 9 09-14-2003 08:17 AM
Anybody having problems with "make" in RedHat 7.3? "cc" not found ? Rampage2884 Linux - General 4 05-14-2002 03:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration