Reputation: 11377
Should it generally be possible to run a program from the source directory (src) after having invoked ./configure
and make
(but not make install
)? I'm trying to fix a bug in an application and it seems unnecessary to run make install
after each code change. Unfortunately I can't run the application in the source directory since it tries to access files in the lib
installation directory (which do not exist before make install
). Is the application wrongly configured or do I have to reinstall it after each change to the source code?
Upvotes: 1
Views: 88
Reputation: 30867
It all depends on the application and what components or files it expects to be visible and where. But assuming no required configuration or dependencies, then yes, you can run the program in-place.
To add a directory to your lib
search path, add to the environment variable LD_LIBRARY_PATH
. Like so:
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/user/myproject/lib" ./someprogram
Note that specifiying a variable assignment on the command line in front of the program you run sets that variable for that run only. (Note, no semicolon -- this is a single command.) If you want to set the variable for the entire session, use
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/user/myproject/lib"
I'd recommend against this, though. It can lead to problems and confusion.
Upvotes: 2