Skip to content

Commit 134b60c

Browse files
Merge pull request #67 from computationalmodelling/BUG-065
BUG-065: Change ubuntu_install_script.sh to add the path without clobbering existing PYTHONPATH
2 parents 11d2ec5 + 121841c commit 134b60c

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

bin/ubuntu_install_script.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1+
echo "Super user authentication required to add packages (you will be \
2+
prompted for confirmation)."
13
sudo bash install-ubuntu-packages.sh
24
bash install-fftw.sh
35
bash install-sundials-2.5.sh
46
sudo pip install cython --upgrade
5-
cd ..
7+
pushd .. > /dev/null
68
make
7-
echo "export PYTHONPATH=$(dirname $PWD):$PYTHONPATH" >> $HOME/.bashrc
9+
10+
# Adds Fidimag environment variables to profile.d, if they're not already
11+
# there.
12+
FIDIMAG_PROFILE_PATH=/etc/profile.d/fidimag.sh
13+
if [ ! -e "$FIDIMAG_PROFILE_PATH" ]; then
14+
echo "Warning: Adding Fidimag to path at $FIDIMAG_PROFILE_PATH."
15+
echo "Super user authentication required to add paths."
16+
sudo mkdir --parents "$(dirname $FIDIMAG_PROFILE_PATH)"
17+
sudo bash -c "echo \"export PYTHONPATH=$PWD/:\\\$PYTHONPATH\"\
18+
> $FIDIMAG_PROFILE_PATH"
19+
sudo bash -c "echo \"export LD_LIBRARY_PATH=$PWD/local/lib:\
20+
\\\$LD_LIBRARY_PATH\" >> $FIDIMAG_PROFILE_PATH"
21+
sudo chmod 0644 "$FIDIMAG_PROFILE_PATH"
22+
echo "Path written to $FIDIMAG_PROFILE_PATH."
23+
else
24+
echo "Path added previously. Skipping."
25+
fi

0 commit comments

Comments
 (0)