Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions macosx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function check_repo() {

if [ -d ${repo_name} ] ; then
read -p "Delete the existing ${repo_name} directory and all contents? (y/n) " -n 1 -r
if [[ ${REPLY} =~ ^[Yy]$ ]] ; then
if [[ $REPLY =~ ^[Yy]$ ]] ; then
rm -rf ${repo_name}
fi
fi
Expand Down Expand Up @@ -36,15 +36,15 @@ function build_moab {
make install

echo "if [ -n \"\${LD_LIBRARY_PATH-}\" ]" >> ~/.bashrc
echo "then" >> ~/.bashrc >> ~/.bashrc
echo "then" >> ~/.bashrc
echo " export LD_LIBRARY_PATH=${install_dir}/moab/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
echo "else" >> ~/.bashrc
echo " export LD_LIBRARY_PATH=${install_dir}/moab/lib" >> ~/.bashrc
echo "fi" >> ~/.bashrc

PYTHON_VERSION=$(python -c 'import sys; print(sys.version.split('')[0][0:3])')
echo "if [ -n \"\${PYTHONPATH-}\" ]" >> ~/.bashrc
echo "then" >> ~/.bashrc >> ~/.bashrc
echo "then" >> ~/.bashrc
echo " export PYTHONPATH=${install_dir}/moab/lib/python${PYTHON_VERSION}/site-packages:\$PYTHONPATH" >> ~/.bashrc
echo "else" >> ~/.bashrc
echo " export PYTHONPATH=${install_dir}/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc
Expand Down Expand Up @@ -80,7 +80,7 @@ function install_pyne {
cd pyne
if [ $1 == 'stable' ] ; then
TAG=$(git describe --abbrev=0 --tags)
git checkout tags/`echo $TAG` -b `echo $TAG`
git checkout tags/`echo ${TAG}` -b `echo ${TAG}`
fi


Expand All @@ -94,39 +94,40 @@ function install_pyne {

PYTHON_VERSION=$(python -c 'import sys; print(sys.version.split('')[0][0:3])')
echo "if [ -n \"\${PYTHONPATH-}\" ]" >> ~/.bashrc
echo "then" >> ~/.bashrc >> ~/.bashrc
echo "then" >> ~/.bashrc
echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION}/site-packages:\$PYTHONPATH" >> ~/.bashrc
echo "else" >> ~/.bashrc
echo " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc
echo "fi" >> ~/.bashrc
source ~/.bashrc
}

function run_nuc_data_make {

cd
source ~/.bashrc
# Generate nuclear data file
nuc_data_make

}

function test_pyne {

source ~/.bashrc
cd $install_dir/pyne
cd tests

./travis-run-tests.sh python3
}

set -euo pipefail
IFS=$'\n\t'

# system update
eval brew update
eval brew install ${brew_package_list}
export PATH="${HOME}/.local/bin:${PATH}"
eval sudo pip3 install ${pip_package_list}

nstall_dir=${HOME}/opt
install_dir=${HOME}/opt
mkdir -p ${install_dir}

build_moab
Expand All @@ -137,7 +138,7 @@ install_pyne $1

run_nuc_data_make

test_pyne $1
test_pyne

echo "Run 'source ~/.bashrc' to update environment variables. PyNE may not function correctly without doing so."
echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from $install_dir/pyne"
echo "PyNE build complete."
36 changes: 11 additions & 25 deletions ubuntu_mint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,20 @@ function build_moab {
-DCMAKE_INSTALL_PREFIX=${install_dir}/moab
make
make install
export LD_LIBRARY_PATH=${install_dir}/moab/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=${install_dir}/moab/lib:$LIBRARY_PATH
if [ -z \$PYTHONPATH ]
then
export PYTHONPATH=${install_dir}/moab/lib/python2.7/site-packages
else
export PYTHONPATH=${install_dir}/moab/lib/python2.7/site-packages:\$PYTHONPATH
fi

echo "export LD_LIBRARY_PATH=${install_dir}/moab/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
echo "export LIBRARY_PATH=${install_dir}/moab/lib:\$LIBRARY_PATH" >> ~/.bashrc
echo "export CPLUS_INCLUDE_PATH=${install_dir}/moab/include:\$CPLUS_INCLUDE_PATH" >> ~/.bashrc
echo "export C_INCLUDE_PATH=${install_dir}/moab/include:\$C_INCLUDE_PATH" >> ~/.bashrc

PYTHON_VERSION=$(python -c 'import sys; print(sys.version.split('')[0][0:3])')
echo "if [ -z \$PYTHONPATH ]" >> ~/.bashrc
echo "then" >> ~/.bashrc >> ~/.bashrc
echo "then" >> ~/.bashrc
echo " export PYTHONPATH=$install_dir/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc
echo "else" >> ~/.bashrc
echo " export PYTHONPATH=$install_dir/moab/lib/python${PYTHON_VERSION}/site-packages:\$PYTHONPATH" >> ~/.bashrc
echo "fi" >> ~/.bashrc
source ~/.bashrc
}

function build_dagmc {
Expand Down Expand Up @@ -92,31 +86,23 @@ function install_pyne {
--clean
echo "export PATH=${HOME}/.local/bin:\$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=${HOME}/.local/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
echo "alias build_pyne='python setup.py install --user -- -DMOAB_LIBRARY=${install_dir}/moab/lib -DMOAB_INCLUDE_DIR=${install_dir}/moab/include'" >> ~/.bashrc

source ~/.bashrc
}

function nuc_data_make {
function run_nuc_data_make {

cd
# Generate nuclear data file
export LD_LIBRARY_PATH=${HOME}/.local/lib:${LD_LIBRARY_PATH}
./scripts/nuc_data_make
nuc_data_make

}

function test_pyne {

cd $install_dir/pyne
cd tests

# check which python version to run correct tests
version=`python -c 'import sys; print(sys.version_info[:][0])'`

# Run all the tests
if [ ${version} == '2' ] ; then
source ./travis-run-tests.sh python2
elif [ ${version} == '3' ] ; then
source ./travis-run-tests.sh python3
fi
./travis-run-tests.sh python3
}


Expand Down Expand Up @@ -144,9 +130,9 @@ build_dagmc

install_pyne $1

nuc_data_make
run_nuc_data_make

test_pyne

echo "Run 'source ~/.bashrc' to update environment variables. PyNE may not function correctly without doing so."
echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from ${install_dir}/pyne"
echo "PyNE build complete."