@@ -34,21 +34,22 @@ function build_moab {
3434 -DCMAKE_INSTALL_PREFIX=${install_dir} /moab
3535 make
3636 make install
37- export LD_LIBRARY_PATH=${install_dir} /moab/lib:$LD_LIBRARY_PATH
38- export LIBRARY_PATH=${install_dir} /moab/lib:$LIBRARY_PATH
3937
40- echo " export LD_LIBRARY_PATH=${install_dir} /moab/lib:\$ LD_LIBRARY_PATH" >> ~ /.bashrc
41- echo " export LIBRARY_PATH=${install_dir} /moab/lib:\$ LIBRARY_PATH" >> ~ /.bashrc
42- echo " export CPLUS_INCLUDE_PATH=${install_dir} /moab/include:\$ CPLUS_INCLUDE_PATH" >> ~ /.bashrc
43- echo " export C_INCLUDE_PATH=${install_dir} /moab/include:\$ C_INCLUDE_PATH" >> ~ /.bashrc
38+ echo " if [ -n \"\$ {LD_LIBRARY_PATH-}\" ]" >> ~ /.bashrc
39+ echo " then" >> ~ /.bashrc >> ~ /.bashrc
40+ echo " export LD_LIBRARY_PATH=${install_dir} /moab/lib:\$ LD_LIBRARY_PATH" >> ~ /.bashrc
41+ echo " else" >> ~ /.bashrc
42+ echo " export LD_LIBRARY_PATH=${install_dir} /moab/lib" >> ~ /.bashrc
43+ echo " fi" >> ~ /.bashrc
4444
4545 PYTHON_VERSION=$( python -c ' import sys; print(sys.version.split(' ' )[0][0:3])' )
46- echo " if [ -z \"\$ PYTHONPATH\" ]" >> ~ /.bashrc
46+ echo " if [ -n \"\$ { PYTHONPATH-} \" ]" >> ~ /.bashrc
4747 echo " then" >> ~ /.bashrc >> ~ /.bashrc
48- echo " export PYTHONPATH=$install_dir /moab/lib/python${PYTHON_VERSION} /site-packages" >> ~ /.bashrc
49- echo " else" >> ~ /.bashrc
5048 echo " export PYTHONPATH=$install_dir /moab/lib/python${PYTHON_VERSION} /site-packages:\$ PYTHONPATH" >> ~ /.bashrc
49+ echo " else" >> ~ /.bashrc
50+ echo " export PYTHONPATH=$install_dir /moab/lib/python${PYTHON_VERSION} /site-packages" >> ~ /.bashrc
5151 echo " fi" >> ~ /.bashrc
52+ source ~ /.bashrc
5253}
5354
5455function build_dagmc {
@@ -85,37 +86,34 @@ function install_pyne {
8586 echo " export PATH=$HOME /.local/bin:\$ PATH" >> ~ /.bashrc
8687 echo " export LD_LIBRARY_PATH=$HOME /.local/lib:\$ LD_LIBRARY_PATH" >> ~ /.bashrc
8788 echo " alias build_pyne='python setup.py install --user -- -DMOAB_LIBRARY=$install_dir /moab/lib -DMOAB_INCLUDE_DIR=$install_dir /moab/include'" >> ~ /.bashrc
88- PYTHON_VERSION=$( python -c ' import sys; print(sys.version.split(' ' )[0][0:3])' )
89- echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION} /site-packages:\$ PYTHONPATH" >> ~ /.bashrc
89+ PYTHON_VERSION=$( python -c ' import sys; print(sys.version.split(' ' )[0][0:3])' )
90+ echo " if [ -n \"\$ {PYTHONPATH-}\" ]" >> ~ /.bashrc
91+ echo " then" >> ~ /.bashrc >> ~ /.bashrc
92+ echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION} /site-packages:\$ PYTHONPATH" >> ~ /.bashrc
93+ echo " else" >> ~ /.bashrc
94+ echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION} /site-packages" >> ~ /.bashrc
95+ echo " fi" >> ~ /.bashrc
9096}
9197
92- function nuc_data_make {
98+ function run_nuc_data_make {
9399
100+ cd
101+ source ~ /.bashrc
94102 # Generate nuclear data file
95- export LD_LIBRARY_PATH=$HOME /.local/lib:$LD_LIBRARY_PATH
96- ./scripts/nuc_data_make
103+ nuc_data_make
97104
98105}
99106
100107function test_pyne {
101-
108+
109+ source ~ /.bashrc
110+ cd $install_dir /pyne
102111 cd tests
103112
104- # check which python version to run correct tests
105- version=` python -c ' import sys; print(sys.version_info[:][0])' `
106-
107- # Run all the tests
108- if [ $version == ' 2' ] ; then
109- source ./travis-run-tests.sh python2
110- elif [ $version == ' 3' ] ; then
111- source ./travis-run-tests.sh python3
112- fi
113+ nosetests .
113114}
114115
115116
116- set -euo pipefail
117- IFS=$' \n\t '
118-
119117# system update
120118eval brew update
121119eval brew install $brew_package_list
@@ -125,14 +123,11 @@ eval sudo pip3 install $pip_package_list
125123install_dir=$HOME /opt
126124mkdir -p $install_dir
127125
128-
129126build_moab
130127
131128install_pyne $1
132129
133- source ~ /.bashrc
134-
135- nuc_data_make
130+ run_nuc_data_make
136131
137132test_pyne $1
138133
0 commit comments