-
Notifications
You must be signed in to change notification settings - Fork 23
Add Mac os x installation scripts #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 27 commits
60efffc
f14554f
eabc212
401d66e
f6b8edd
7432182
48abe72
1d3b0d8
df3f162
655ac35
798a948
8fa80d8
0892a60
de30a2c
e1b4d0e
d0ef93a
234e758
cadaae6
cfb92d1
6542c38
a66978b
7c30f01
7f9cbba
71b765e
d0ad7a6
3d32f49
b6f7e77
e1facd1
1f4b113
266a31a
2e4facc
b6a126c
1c06a88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
#!/bin/bash | ||
# This script contains common code for building PyNE on various Debian-derived systems | ||
# | ||
|
||
function check_repo() { | ||
|
||
repo_name=$1 | ||
|
||
if [ -d $repo_name ] ; then | ||
nsryan2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
read -p "Delete the existing $repo_name directory and all contents? (y/n) " -n 1 -r | ||
if [[ $REPLY =~ ^[Yy]$ ]] ; then | ||
rm -rf $repo_name | ||
fi | ||
fi | ||
|
||
} | ||
|
||
function build_moab { | ||
|
||
# Install MOAB | ||
cd ${install_dir} | ||
mkdir -p moab | ||
cd moab | ||
check_repo moab-repo | ||
git clone --branch Version5.1.0 --single-branch https://bitbucket.org/fathomteam/moab moab-repo | ||
cd moab-repo | ||
mkdir -p build | ||
cd build | ||
cmake ../ -DENABLE_HDF5=ON \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DENABLE_PYMOAB=ON \ | ||
-DENABLE_BLASLAPACK=OFF \ | ||
-DENABLE_FORTRAN=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=${install_dir}/moab | ||
make | ||
make install | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Difference from Ubuntu: why not update the ENV Variables directly here (instead of sourcing .bashrc below)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should update the linux version accordingly: I see 2 advantages:
|
||
echo "if [ -n \"\${LD_LIBRARY_PATH-}\" ]" >> ~/.bashrc | ||
echo "then" >> ~/.bashrc >> ~/.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 " 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 | ||
echo "fi" >> ~/.bashrc | ||
source ~/.bashrc | ||
} | ||
|
||
function build_dagmc { | ||
|
||
# Install DAGMC | ||
cd ${install_dir} | ||
check_repo dagmc | ||
mkdir -p dagmc | ||
cd dagmc | ||
git clone https://github.com/svalinn/DAGMC.git dagmc-repo | ||
cd dagmc-repo | ||
git checkout develop | ||
mkdir build | ||
cd build | ||
cmake .. -DMOAB_DIR=${install_dir}/moab \ | ||
-DBUILD_STATIC_LIBS=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=${install_dir}/dagmc | ||
make | ||
make install | ||
} | ||
|
||
function install_pyne { | ||
|
||
# Install PyNE | ||
cd $install_dir | ||
check_repo pyne | ||
git clone https://github.com/pyne/pyne.git | ||
cd pyne | ||
if [ $1 == 'stable' ] ; then | ||
TAG=$(git describe --abbrev=0 --tags) | ||
git checkout tags/`echo $TAG` -b `echo $TAG` | ||
fi | ||
python setup.py install --user -- -DMOAB_LIBRARY=$install_dir/moab/lib -DMOAB_INCLUDE_DIR=$install_dir/moab/include | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like an "old-fashioned" way to configure setup.py. Why not the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixing this right now |
||
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 | ||
PYTHON_VERSION=$(python -c 'import sys; print(sys.version.split('')[0][0:3])') | ||
echo "if [ -n \"\${PYTHONPATH-}\" ]" >> ~/.bashrc | ||
echo "then" >> ~/.bashrc >> ~/.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 | ||
} | ||
|
||
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_travis-run-tests.sh python3 | ||
} | ||
|
||
|
||
# system update | ||
eval brew update | ||
eval brew install $brew_package_list | ||
export PATH="$HOME/.local/bin:$PATH" | ||
eval sudo pip3 install $pip_package_list | ||
|
||
install_dir=$HOME/opt | ||
mkdir -p $install_dir | ||
|
||
build_moab | ||
|
||
nsryan2 marked this conversation as resolved.
Show resolved
Hide resolved
nsryan2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
build_dagmc | ||
install_pyne $1 | ||
|
||
run_nuc_data_make | ||
|
||
test_pyne $1 | ||
|
||
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" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# This script builds the repo version of PyNE (with the MOAB optional | ||
# dependency) from scratch on MacOS 10.15.6. The folder $HOME/opt is created | ||
# and PyNE is installed within. | ||
# | ||
# Run this script from any directory by issuing the command where <version> | ||
# is either "dev" or "stable": | ||
# $ ./osx_10.15.6.sh <version> | ||
# After the build finishes run: | ||
# $ source ~/.bashrc | ||
# or open a new terminal. | ||
|
||
# Use package manager for as many packages as possible | ||
brew_package_list="glib python3 wget eigen \ | ||
git cmake vim emacs gcc openblas \ | ||
lapack autoconf libtool make hdf5" | ||
|
||
pip_package_list="future numpy scipy cython nose tables matplotlib jinja2 \ | ||
setuptools h5py" | ||
|
||
|
||
source macosx.sh $1 |
Uh oh!
There was an error while loading. Please reload this page.