LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 08-22-2007, 07:35 PM   #1
cheeta05r
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Rep: Reputation: 0
Unale to permanently set LD_LIBRARY_PATH


Below are the commands I use to set the library path for Matlab libraries. Every time I boot up the system I have to enter these commands. How do I export them permanently? I am running Fedora 7.

[cheeta05r@localhost ~]# export LD_LIBRARY_PATH=/usr/local/matlab74_sv/sys/os/glnx86:$LD_LIBRARY_PATH
[cheeta05r@localhost ~]# export LD_LIBRARY_PATH=/usr/local/matlab74_sv/bin/glnx86:$LD_LIBRARY_PATH

Thanks in advance.

Last edited by cheeta05r; 08-25-2007 at 09:46 AM.
 
Old 08-22-2007, 07:55 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Add those commands to your ~/.bash_profile. After that logout and back in again.
 
Old 08-22-2007, 08:10 PM   #3
cheeta05r
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
That didn't work. I entered those two lines in my Bash_profile as seen below.


/usr/share/doc/bash-3.2/startup-files/Bash_profile
Code:
# Startup file for bash login shells.
#
default_dir=/usr/local/lib/

if [ -n "$PS1" ]; then
	PS1='\u@\h(\#)\$ '
	IGNOREEOF=3
fi

LOGIN_SHELL=true

# If the user has her own init file, then use that one, else use the
# canonical one.
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
elif [ -f ${default_dir}Bashrc ]; then
	. ${default_dir}Bashrc;
fi

export LD_LIBRARY_PATH=/usr/local/matlab74_sv/sys/os/glnx86:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/matlab74_sv/bin/glnx86:$LD_LIBRARY_PATH
 
Old 08-22-2007, 08:50 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
The file you are supposed to put the commands is a hidden file located in your home directory (~ is a shortcut for your home directory). If you want the variable to be global, you can put the commands in /etc/profile or create a file (e.g. matlab.sh) in /etc/profile.d, enter the commands in there and make the file executable.
 
Old 08-22-2007, 10:12 PM   #5
cheeta05r
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
So I added the lines to the hidden file located in my home directory as seen below. This didn't work. To test it I've logged out and logged back in, then try running the executable file requiring the libraries.

This really seems like something that shouldn't be this hard. Thanks in advance for helping me out with this.


[cheeta05r@localhost ~]# ls -a
.bash_profile

Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

export LD_LIBRARY_PATH=/usr/local/matlab74_sv/bin/glnx86:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/local/matlab74_sv/sys/os/glnx86:$LD_LIBRARY_PATH
 
Old 08-23-2007, 03:30 AM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If you have added the lines to ~/.bash_profile, then logged out and back in again, what is the output of doing
Code:
$echo $LD_LIBRARY_PATH
 
Old 08-23-2007, 08:07 PM   #7
cheeta05r
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Neither of the below commands produced any result.

Code:
[cheeta05r@localhost ~]# $echo $LD_LIBRARY_PATH
[cheeta05r@localhost ~]# echo $LD_LIBRARY_PATH

[cheeta05r@localhost ~]#
 
Old 08-30-2007, 08:16 PM   #8
cheeta05r
LQ Newbie
 
Registered: Jul 2007
Posts: 9

Original Poster
Rep: Reputation: 0
BTW by putting the below lines in .bashrc I was able to get it to work.

export LD_LIBRARY_PATH=/usr/local/matlab74_sv/sys/os/glnx86:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/matlab74_sv/bin/glnx86:$LD_LIBRARY_PATH
 
  


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
Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) senthilpr_in Linux - Newbie 4 02-26-2007 12:46 PM
set LD_LIBRARY_PATH to what? itz2000 Linux - Newbie 3 11-15-2006 08:34 PM
how to set LD_LIBRARY_PATH environment variable snakeo2 Linux - Newbie 3 05-25-2005 07:08 PM
Permanently Set a Export Setting (LD_LIBRARY_PATH) nistelrooy Linux - General 1 11-25-2004 11:33 AM
How to set PATH permanently chandhru Linux - Newbie 3 09-24-2002 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 03:59 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
Open Source Consulting | Domain Registration