From f14554f7ac4d3990b9dba8ed360d401f609fe87f Mon Sep 17 00:00:00 2001 From: Nathan Ryan Date: Mon, 10 Aug 2020 13:38:03 -0500 Subject: [PATCH 01/25] create a macosx sh file --- .DS_Store | Bin 0 -> 6148 bytes macosx.sh | 119 ++++++++++++++++++++++++++++++++++ osx_10.15.6-stable.dockerfile | 65 +++++++++++++++++++ osx_10.15.6.sh | 24 +++++++ 4 files changed, 208 insertions(+) create mode 100644 .DS_Store create mode 100644 macosx.sh create mode 100644 osx_10.15.6-stable.dockerfile create mode 100644 osx_10.15.6.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..0b6841bba24cdcd19fc5b12926d37e475797a3ec GIT binary patch literal 6148 zcmeHK%Sr<=6g|<3tl-Oa{-@E80(KS0k- z(mJn--H1vqBqy(PlY25VnE+7LQMUpV0c4p3GfT`;O!_4yY|ggiiAwu8K@;^xf6!_7 z6Qf;&Q@|kU#gEB=QzoV`)oP4cu(JrSOhyGe%y(0{&oOQer;O+TH5?O5TthdyPW2XJ ztYd^WldN>4*D5oWv5hTs(Zd64U9PBuYu4^?!KnJ^MZIdhUP5|peBpJ-nOdBaUcTj9 zlnwh{nd*C*x?y%QUb8nd#j8a3u-9a~pI&E-SMN~RcQW3w@056DCsa1H6NQ*s zOQj>+1w3)DQbx)%8yQJC{)q9+7RxRhbh%T&Dc}^CC?MYlk4ezC7#P%_4rclaK+LdN z8_V+3ARN!4Z!s{)9-1;#qM<5##ZZRMcF&IUEd~Y+9m-xll$}}G8;a7i)4!*OL-__> z?i6qeL=~7f)uNpL_38KjD9P2F0#1Q{rGU!RnzbrJvS(`|I5}%QrgJ7S85bDT6lV4~ h)&)6=*O;`i&yxbtw-^{?3(frqXc=7Q6!=jEJ^+37+aLe{ literal 0 HcmV?d00001 diff --git a/macosx.sh b/macosx.sh new file mode 100644 index 0000000..548b675 --- /dev/null +++ b/macosx.sh @@ -0,0 +1,119 @@ +#!/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 + 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 + autoreconf -fi + mkdir -p build + cd build + ../configure --enable-shared --enable-dagmc --enable-pymoab --with-hdf5=$hdf5_libdir --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 + 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 " 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 +} + +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 + 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 + +} + +function nuc_data_make { + + # Generate nuclear data file + export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH + ./scripts/nuc_data_make + +} + +function test_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 +} + + +set -euo pipefail +IFS=$'\n\t' + +# system update +eval brew update $brew_package_list +eval brew install $apt_package_list +export PATH="$HOME/.local/bin:$PATH" +eval python -m pip install --user --upgrade pip +eval pip install --user $pip_package_list + +install_dir=$HOME/opt +mkdir -p $install_dir + +# need to put libhdf5.so on LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$hdf5_libdir +export LIBRARY_PATH=$hdf5_libdir +echo "export LD_LIBRARY_PATH=$hdf5_libdir" >> ~/.bashrc + +build_moab + +install_pyne $1 + +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" + diff --git a/osx_10.15.6-stable.dockerfile b/osx_10.15.6-stable.dockerfile new file mode 100644 index 0000000..f1d2962 --- /dev/null +++ b/osx_10.15.6-stable.dockerfile @@ -0,0 +1,65 @@ +FROM osx:10.15.6 + +ENV HOME /root + +RUN apt-get -y --force-yes update +RUN apt-get install -y --force-yes \ + software-properties-common wget + +# pyne specific dependencies (excluding python libraries) +RUN apt-get install -y build-essential git cmake vim emacs gfortran libblas-dev \ + python-pip liblapack-dev libhdf5-dev autoconf libtool + +# need to put libhdf5.so on LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu + +# upgrade pip and install python dependencies +ENV PATH $HOME/.local/bin:$PATH +RUN python -m pip install --user --upgrade pip +RUN pip install --user numpy scipy cython nose tables matplotlib jinja2 \ + setuptools future + +# make starting directory +RUN cd $HOME \ + && mkdir opt + +# build MOAB +RUN cd $HOME/opt \ + && mkdir moab \ + && cd moab \ + && git clone https://bitbucket.org/fathomteam/moab \ + && cd moab \ + && git checkout -b Version5.1.0 origin/Version5.1.0 \ + && autoreconf -fi \ + && cd .. \ + && mkdir build \ + && cd build \ + && ../moab/configure --enable-shared --enable-dagmc --enable-pymoab --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ + && make \ + && make install \ + && cd .. \ + && rm -rf build moab + +# put MOAB on the path +ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH +ENV LIBRARY_PATH $HOME/opt/moab/lib:$LIBRARY_PATH + +# Install PyNE +RUN cd $HOME/opt \ + && git clone https://github.com/pyne/pyne.git \ + && cd pyne \ + && TAG=$(git describe --abbrev=0 --tags) \ + && git checkout tags/`echo $TAG` -b `echo $TAG` \ + && python setup.py install --user -- -DMOAB_LIBRARY=$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=$HOME/opt/moab/include + +RUN 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=\$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=\$HOME/opt/moab/include'" >> ~/.bashrc + +ENV LD_LIBRARY_PATH $HOME/.local/lib:$LD_LIBRARY_PATH + +RUN cd $HOME/opt/pyne && ./scripts/nuc_data_make \ + && cd tests \ + && ./travis-run-tests.sh python2 \ + && echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from $HOME/opt/pyne" diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh new file mode 100644 index 0000000..d9956ac --- /dev/null +++ b/osx_10.15.6.sh @@ -0,0 +1,24 @@ +#!/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 +# is either "dev" or "stable": +# $ ./osx_10.15.6.sh +# After the build finishes run: +# $ source ~/.bashrc +# or open a new terminal. + +# Use package manager for as many packages as possible +brew_package_list="software-properties-common python-software-properties wget \ + build-essential git cmake vim emacs gcc openblas \ + lapack autoconf libtool" + +pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ + setuptools h5py" + +hdf5_libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial + + +source macosx.sh $1 From eabc212be804e5aab2fc6f758f3664e0b9ada7f3 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 13:39:24 -0500 Subject: [PATCH 02/25] Create macosx install script from mint script --- macosx.sh | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ osx_10.15.6.sh | 24 ++++++++++ 2 files changed, 143 insertions(+) create mode 100644 macosx.sh create mode 100644 osx_10.15.6.sh diff --git a/macosx.sh b/macosx.sh new file mode 100644 index 0000000..548b675 --- /dev/null +++ b/macosx.sh @@ -0,0 +1,119 @@ +#!/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 + 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 + autoreconf -fi + mkdir -p build + cd build + ../configure --enable-shared --enable-dagmc --enable-pymoab --with-hdf5=$hdf5_libdir --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 + 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 " 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 +} + +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 + 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 + +} + +function nuc_data_make { + + # Generate nuclear data file + export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH + ./scripts/nuc_data_make + +} + +function test_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 +} + + +set -euo pipefail +IFS=$'\n\t' + +# system update +eval brew update $brew_package_list +eval brew install $apt_package_list +export PATH="$HOME/.local/bin:$PATH" +eval python -m pip install --user --upgrade pip +eval pip install --user $pip_package_list + +install_dir=$HOME/opt +mkdir -p $install_dir + +# need to put libhdf5.so on LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$hdf5_libdir +export LIBRARY_PATH=$hdf5_libdir +echo "export LD_LIBRARY_PATH=$hdf5_libdir" >> ~/.bashrc + +build_moab + +install_pyne $1 + +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" + diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh new file mode 100644 index 0000000..d9956ac --- /dev/null +++ b/osx_10.15.6.sh @@ -0,0 +1,24 @@ +#!/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 +# is either "dev" or "stable": +# $ ./osx_10.15.6.sh +# After the build finishes run: +# $ source ~/.bashrc +# or open a new terminal. + +# Use package manager for as many packages as possible +brew_package_list="software-properties-common python-software-properties wget \ + build-essential git cmake vim emacs gcc openblas \ + lapack autoconf libtool" + +pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ + setuptools h5py" + +hdf5_libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial + + +source macosx.sh $1 From 401d66e118ca99ea4761080f576fdf417f07a8d9 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 14:13:37 -0500 Subject: [PATCH 03/25] change dependency list name --- macosx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx.sh b/macosx.sh index 548b675..986e403 100644 --- a/macosx.sh +++ b/macosx.sh @@ -92,8 +92,8 @@ set -euo pipefail IFS=$'\n\t' # system update -eval brew update $brew_package_list -eval brew install $apt_package_list +eval brew update +eval brew install $brew_package_list export PATH="$HOME/.local/bin:$PATH" eval python -m pip install --user --upgrade pip eval pip install --user $pip_package_list From f6b8edd2e6dc571eab87f6c85766dfc7e6b3dadd Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 14:39:32 -0500 Subject: [PATCH 04/25] Update brew and pip install lines to include elements of the ubuntu packages Packages replaced: - build-essential - python-software-properties - software-properties-common These packages are not for MacOS, and are not available through brew install or pip, so I went through the different parts of them and picked out what seemed to be relavent (as well as what was able to be installed through brew and pip) to Mac and added it. --- osx_10.15.6.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh index d9956ac..93b1c02 100644 --- a/osx_10.15.6.sh +++ b/osx_10.15.6.sh @@ -11,9 +11,9 @@ # or open a new terminal. # Use package manager for as many packages as possible -brew_package_list="software-properties-common python-software-properties wget \ - build-essential git cmake vim emacs gcc openblas \ - lapack autoconf libtool" +brew_package_list="glib python3 wget \ + git cmake vim emacs gcc openblas \ + lapack autoconf libtool make" pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ setuptools h5py" From 74321823abb08958d727fc8f92fe87cd466a1456 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 16:05:11 -0500 Subject: [PATCH 05/25] Apply suggestions from code review Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/macosx.sh b/macosx.sh index 986e403..8863ba8 100644 --- a/macosx.sh +++ b/macosx.sh @@ -95,8 +95,8 @@ IFS=$'\n\t' eval brew update eval brew install $brew_package_list export PATH="$HOME/.local/bin:$PATH" -eval python -m pip install --user --upgrade pip -eval pip install --user $pip_package_list +eval pip3 install --user --upgrade pip3 +eval pip3 install --user $pip_package_list install_dir=$HOME/opt mkdir -p $install_dir @@ -116,4 +116,3 @@ 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" - From 48abe72da69d3c282b5cca9bae3ab8728106799b Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 16:08:12 -0500 Subject: [PATCH 06/25] Update build moab script and add build dagmc to operate with cmake --- macosx.sh | 51 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/macosx.sh b/macosx.sh index 8863ba8..fdb30e3 100644 --- a/macosx.sh +++ b/macosx.sh @@ -18,26 +18,36 @@ function check_repo() { function build_moab { # Install MOAB - cd $install_dir + 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 - autoreconf -fi mkdir -p build cd build - ../configure --enable-shared --enable-dagmc --enable-pymoab --with-hdf5=$hdf5_libdir --prefix=$install_dir/moab + cmake ../ -DENABLE_HDF5=ON -DHDF5_ROOT=${hdf5_libdir} \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_PYMOAB=ON \ + -DENABLE_BLASLAPACK=OFF \ + -DENABLE_FORTRAN=OFF \ + -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 - 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])') + 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 " export PYTHONPATH=$install_dir/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc @@ -46,6 +56,25 @@ function build_moab { echo "fi" >> ~/.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 From 1d3b0d8a79272e3ffbafac55ad80d5576ae56245 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Mon, 10 Aug 2020 16:18:30 -0500 Subject: [PATCH 07/25] Add eigen to list of brew package installs --- osx_10.15.6.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh index 93b1c02..6b3bc86 100644 --- a/osx_10.15.6.sh +++ b/osx_10.15.6.sh @@ -11,7 +11,7 @@ # or open a new terminal. # Use package manager for as many packages as possible -brew_package_list="glib python3 wget \ +brew_package_list="glib python3 wget eigen \ git cmake vim emacs gcc openblas \ lapack autoconf libtool make" From df3f162e096786bb9b10687e01380341dea253df Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 08:46:28 -0500 Subject: [PATCH 08/25] Add hdf5 to the packages --- osx_10.15.6.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh index 6b3bc86..4339b6f 100644 --- a/osx_10.15.6.sh +++ b/osx_10.15.6.sh @@ -13,7 +13,7 @@ # 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" + lapack autoconf libtool make hdf5" pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ setuptools h5py" From 655ac358d9254cb0a7bf7fac945cf4dae5b084c9 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 09:21:49 -0500 Subject: [PATCH 09/25] Remove references to hdf5_libdir --- macosx.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/macosx.sh b/macosx.sh index fdb30e3..bda4261 100644 --- a/macosx.sh +++ b/macosx.sh @@ -26,7 +26,7 @@ function build_moab { cd moab-repo mkdir -p build cd build - cmake ../ -DENABLE_HDF5=ON -DHDF5_ROOT=${hdf5_libdir} \ + cmake ../ -DENABLE_HDF5=ON \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_PYMOAB=ON \ -DENABLE_BLASLAPACK=OFF \ @@ -130,10 +130,6 @@ eval pip3 install --user $pip_package_list install_dir=$HOME/opt mkdir -p $install_dir -# need to put libhdf5.so on LD_LIBRARY_PATH -export LD_LIBRARY_PATH=$hdf5_libdir -export LIBRARY_PATH=$hdf5_libdir -echo "export LD_LIBRARY_PATH=$hdf5_libdir" >> ~/.bashrc build_moab From 798a9489fdf80fbe06845bcfacf9b1fb6e8e4e22 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 09:22:17 -0500 Subject: [PATCH 10/25] Remove references to hdf5_libdir --- osx_10.15.6.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh index 4339b6f..a771521 100644 --- a/osx_10.15.6.sh +++ b/osx_10.15.6.sh @@ -18,7 +18,5 @@ brew_package_list="glib python3 wget eigen \ pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ setuptools h5py" -hdf5_libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial - source macosx.sh $1 From 8fa80d84f3fd7fce2077dcc40017cfb27cf1f314 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:10:57 -0500 Subject: [PATCH 11/25] Apply suggestions from code review Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macosx.sh b/macosx.sh index bda4261..afb27b5 100644 --- a/macosx.sh +++ b/macosx.sh @@ -124,8 +124,7 @@ IFS=$'\n\t' eval brew update eval brew install $brew_package_list export PATH="$HOME/.local/bin:$PATH" -eval pip3 install --user --upgrade pip3 -eval pip3 install --user $pip_package_list +eval pip3 install $pip_package_list install_dir=$HOME/opt mkdir -p $install_dir From 0892a60649454f9a7f41a45d164cbee4b8163e34 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:37:47 -0500 Subject: [PATCH 12/25] Update macosx.sh Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx.sh b/macosx.sh index afb27b5..be172fe 100644 --- a/macosx.sh +++ b/macosx.sh @@ -124,7 +124,7 @@ IFS=$'\n\t' eval brew update eval brew install $brew_package_list export PATH="$HOME/.local/bin:$PATH" -eval pip3 install $pip_package_list +eval sudo pip3 install $pip_package_list install_dir=$HOME/opt mkdir -p $install_dir From de30a2c433601b425c34cd2ffb98e80fa9ddd980 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:29:43 -0500 Subject: [PATCH 13/25] Update macosx.sh Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx.sh b/macosx.sh index be172fe..0f77214 100644 --- a/macosx.sh +++ b/macosx.sh @@ -48,7 +48,7 @@ function build_moab { 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 "if [ -z \"\$PYTHONPATH\" ]" >> ~/.bashrc echo "then" >> ~/.bashrc >> ~/.bashrc echo " export PYTHONPATH=$install_dir/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc echo "else" >> ~/.bashrc From e1b4d0ec1e747fcdbc35658bd64300c298ace654 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:31:51 -0500 Subject: [PATCH 14/25] Apply suggestions from code review Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/macosx.sh b/macosx.sh index 0f77214..9297023 100644 --- a/macosx.sh +++ b/macosx.sh @@ -90,7 +90,8 @@ function install_pyne { 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 " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION}/site-packages:\$PYTHONPATH" >> ~/.bashrc } function nuc_data_make { @@ -132,6 +133,7 @@ mkdir -p $install_dir build_moab +source ~/.bashrc install_pyne $1 nuc_data_make From d0ef93a86c2259e0b68bc4df1379cda15ce61eda Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:37:37 -0500 Subject: [PATCH 15/25] Remove reference to python 2 --- macosx.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/macosx.sh b/macosx.sh index 9297023..0d5f6f8 100644 --- a/macosx.sh +++ b/macosx.sh @@ -36,12 +36,7 @@ function build_moab { 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 From 6542c3802a75f43eb497808727f72db5cec663ec Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 13:46:52 -0500 Subject: [PATCH 16/25] Delete osx_10.15.6-stable.dockerfile --- osx_10.15.6-stable.dockerfile | 65 ----------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 osx_10.15.6-stable.dockerfile diff --git a/osx_10.15.6-stable.dockerfile b/osx_10.15.6-stable.dockerfile deleted file mode 100644 index f1d2962..0000000 --- a/osx_10.15.6-stable.dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -FROM osx:10.15.6 - -ENV HOME /root - -RUN apt-get -y --force-yes update -RUN apt-get install -y --force-yes \ - software-properties-common wget - -# pyne specific dependencies (excluding python libraries) -RUN apt-get install -y build-essential git cmake vim emacs gfortran libblas-dev \ - python-pip liblapack-dev libhdf5-dev autoconf libtool - -# need to put libhdf5.so on LD_LIBRARY_PATH -ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu -ENV LIBRARY_PATH /usr/lib/x86_64-linux-gnu - -# upgrade pip and install python dependencies -ENV PATH $HOME/.local/bin:$PATH -RUN python -m pip install --user --upgrade pip -RUN pip install --user numpy scipy cython nose tables matplotlib jinja2 \ - setuptools future - -# make starting directory -RUN cd $HOME \ - && mkdir opt - -# build MOAB -RUN cd $HOME/opt \ - && mkdir moab \ - && cd moab \ - && git clone https://bitbucket.org/fathomteam/moab \ - && cd moab \ - && git checkout -b Version5.1.0 origin/Version5.1.0 \ - && autoreconf -fi \ - && cd .. \ - && mkdir build \ - && cd build \ - && ../moab/configure --enable-shared --enable-dagmc --enable-pymoab --with-hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial --prefix=$HOME/opt/moab \ - && make \ - && make install \ - && cd .. \ - && rm -rf build moab - -# put MOAB on the path -ENV LD_LIBRARY_PATH $HOME/opt/moab/lib:$LD_LIBRARY_PATH -ENV LIBRARY_PATH $HOME/opt/moab/lib:$LIBRARY_PATH - -# Install PyNE -RUN cd $HOME/opt \ - && git clone https://github.com/pyne/pyne.git \ - && cd pyne \ - && TAG=$(git describe --abbrev=0 --tags) \ - && git checkout tags/`echo $TAG` -b `echo $TAG` \ - && python setup.py install --user -- -DMOAB_LIBRARY=$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=$HOME/opt/moab/include - -RUN 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=\$HOME/opt/moab/lib -DMOAB_INCLUDE_DIR=\$HOME/opt/moab/include'" >> ~/.bashrc - -ENV LD_LIBRARY_PATH $HOME/.local/lib:$LD_LIBRARY_PATH - -RUN cd $HOME/opt/pyne && ./scripts/nuc_data_make \ - && cd tests \ - && ./travis-run-tests.sh python2 \ - && echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from $HOME/opt/pyne" From a66978bafd99c85dc098cd9d26b5268e9fc246a2 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Tue, 11 Aug 2020 13:47:44 -0500 Subject: [PATCH 17/25] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 0b6841bba24cdcd19fc5b12926d37e475797a3ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%Sr<=6g|<3tl-Oa{-@E80(KS0k- z(mJn--H1vqBqy(PlY25VnE+7LQMUpV0c4p3GfT`;O!_4yY|ggiiAwu8K@;^xf6!_7 z6Qf;&Q@|kU#gEB=QzoV`)oP4cu(JrSOhyGe%y(0{&oOQer;O+TH5?O5TthdyPW2XJ ztYd^WldN>4*D5oWv5hTs(Zd64U9PBuYu4^?!KnJ^MZIdhUP5|peBpJ-nOdBaUcTj9 zlnwh{nd*C*x?y%QUb8nd#j8a3u-9a~pI&E-SMN~RcQW3w@056DCsa1H6NQ*s zOQj>+1w3)DQbx)%8yQJC{)q9+7RxRhbh%T&Dc}^CC?MYlk4ezC7#P%_4rclaK+LdN z8_V+3ARN!4Z!s{)9-1;#qM<5##ZZRMcF&IUEd~Y+9m-xll$}}G8;a7i)4!*OL-__> z?i6qeL=~7f)uNpL_38KjD9P2F0#1Q{rGU!RnzbrJvS(`|I5}%QrgJ7S85bDT6lV4~ h)&)6=*O;`i&yxbtw-^{?3(frqXc=7Q6!=jEJ^+37+aLe{ From 7c30f0131e65da04d503c2f37792cd1511d47c5d Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Wed, 12 Aug 2020 09:17:18 -0500 Subject: [PATCH 18/25] this should now be working --- macosx.sh | 57 ++++++++++++++++++++++++-------------------------- osx_10.15.6.sh | 2 +- 2 files changed, 28 insertions(+), 31 deletions(-) mode change 100644 => 100755 macosx.sh mode change 100644 => 100755 osx_10.15.6.sh diff --git a/macosx.sh b/macosx.sh old mode 100644 new mode 100755 index 0d5f6f8..e8cd9f9 --- a/macosx.sh +++ b/macosx.sh @@ -1,6 +1,7 @@ #!/bin/bash # This script contains common code for building PyNE on various Debian-derived systems # +set +u function check_repo() { @@ -34,21 +35,22 @@ 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 - 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 + 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 [ -z \"\$PYTHONPATH\" ]" >> ~/.bashrc + echo "if [ -n \"\${PYTHONPATH-}\" ]" >> ~/.bashrc echo "then" >> ~/.bashrc >> ~/.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 "else" >> ~/.bashrc + echo " export PYTHONPATH=$install_dir/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc echo "fi" >> ~/.bashrc + source ~/.bashrc } function build_dagmc { @@ -85,37 +87,34 @@ function install_pyne { 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 " export PYTHONPATH=~/.local/lib/python${PYTHON_VERSION}/site-packages:\$PYTHONPATH" >> ~/.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 nuc_data_make { +function run_nuc_data_make { + cd + source ~/.bashrc # Generate nuclear data file - export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH - ./scripts/nuc_data_make + nuc_data_make } function test_pyne { - + + source ~/.bashrc + 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 + nosetests . } -set -euo pipefail -IFS=$'\n\t' - # system update eval brew update eval brew install $brew_package_list @@ -125,13 +124,11 @@ eval sudo pip3 install $pip_package_list install_dir=$HOME/opt mkdir -p $install_dir - build_moab -source ~/.bashrc install_pyne $1 -nuc_data_make +run_nuc_data_make test_pyne $1 diff --git a/osx_10.15.6.sh b/osx_10.15.6.sh old mode 100644 new mode 100755 index a771521..7c777d7 --- a/osx_10.15.6.sh +++ b/osx_10.15.6.sh @@ -15,7 +15,7 @@ brew_package_list="glib python3 wget eigen \ git cmake vim emacs gcc openblas \ lapack autoconf libtool make hdf5" -pip_package_list="numpy scipy cython nose tables matplotlib jinja2 \ +pip_package_list="future numpy scipy cython nose tables matplotlib jinja2 \ setuptools h5py" From 71b765e63f6921b740c00294b6fd072bf4cd59aa Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Wed, 12 Aug 2020 09:21:40 -0500 Subject: [PATCH 19/25] cleaning --- macosx.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/macosx.sh b/macosx.sh index e8cd9f9..5f4db7e 100755 --- a/macosx.sh +++ b/macosx.sh @@ -1,7 +1,6 @@ #!/bin/bash # This script contains common code for building PyNE on various Debian-derived systems # -set +u function check_repo() { From 3d32f49d057dfd1c95253b965a5cdb38cbdc7a0a Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Wed, 12 Aug 2020 13:19:38 -0500 Subject: [PATCH 20/25] Update macosx.sh Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/macosx.sh b/macosx.sh index 5f4db7e..75d0be2 100755 --- a/macosx.sh +++ b/macosx.sh @@ -125,6 +125,7 @@ mkdir -p $install_dir build_moab +build_dagmc install_pyne $1 run_nuc_data_make From b6f7e7721dcde33589621931bc93670bb1fd1447 Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Thu, 13 Aug 2020 16:15:33 -0500 Subject: [PATCH 21/25] Update macosx.sh Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx.sh b/macosx.sh index 75d0be2..b08123d 100755 --- a/macosx.sh +++ b/macosx.sh @@ -110,7 +110,7 @@ function test_pyne { cd $install_dir/pyne cd tests - nosetests . + travis_travis-run-tests.sh python3 } From e1facd1eff9ffd826a9ab5ab796a78e62c51a8ec Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Fri, 14 Aug 2020 12:05:18 -0500 Subject: [PATCH 22/25] Add the curly brackets around variables --- macosx.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/macosx.sh b/macosx.sh index b08123d..2d12cda 100755 --- a/macosx.sh +++ b/macosx.sh @@ -6,10 +6,10 @@ function check_repo() { repo_name=$1 - if [ -d $repo_name ] ; then + 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 - rm -rf $repo_name + rm -rf ${repo_name} fi fi @@ -45,9 +45,9 @@ function build_moab { 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 " 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 " export PYTHONPATH=${install_dir}/moab/lib/python${PYTHON_VERSION}/site-packages" >> ~/.bashrc echo "fi" >> ~/.bashrc source ~/.bashrc } @@ -74,7 +74,7 @@ function build_dagmc { function install_pyne { # Install PyNE - cd $install_dir + cd ${install_dir} check_repo pyne git clone https://github.com/pyne/pyne.git cd pyne @@ -83,9 +83,9 @@ function install_pyne { 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 - 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 + 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 @@ -107,7 +107,7 @@ function run_nuc_data_make { function test_pyne { source ~/.bashrc - cd $install_dir/pyne + cd ${install_dir}/pyne cd tests travis_travis-run-tests.sh python3 @@ -116,12 +116,12 @@ function test_pyne { # system update eval brew update -eval brew install $brew_package_list -export PATH="$HOME/.local/bin:$PATH" -eval sudo pip3 install $pip_package_list +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 +install_dir=${HOME}/opt +mkdir -p ${install_dir} build_moab @@ -133,4 +133,4 @@ 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" +echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from ${install_dir}/pyne" From 1f4b1136447c44e66c1e6b7b76e16d7edd4e92b8 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Fri, 14 Aug 2020 13:25:55 -0500 Subject: [PATCH 23/25] this should be the last one --- macosx.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/macosx.sh b/macosx.sh index 2d12cda..eed1250 100755 --- a/macosx.sh +++ b/macosx.sh @@ -7,8 +7,8 @@ function check_repo() { repo_name=$1 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 + 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 @@ -82,11 +82,17 @@ function install_pyne { 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 + + + python setup.py install --user -- -DMOAB_LIBRARY=${install_dir}/moab/lib + -DMOAB_INCLUDE_DIR=${install_dir}/moab/include + --dagmc ${install_dir}/dagmc \ + --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 - PYTHON_VERSION=$(python -c 'import sys; print(sys.version.split('')[0][0:3])') + + 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 @@ -107,10 +113,10 @@ function run_nuc_data_make { function test_pyne { source ~/.bashrc - cd ${install_dir}/pyne + cd $install_dir/pyne cd tests - travis_travis-run-tests.sh python3 + ./travis-run-tests.sh python3 } @@ -120,12 +126,13 @@ eval brew install ${brew_package_list} export PATH="${HOME}/.local/bin:${PATH}" eval sudo pip3 install ${pip_package_list} -install_dir=${HOME}/opt +nstall_dir=${HOME}/opt mkdir -p ${install_dir} build_moab build_dagmc + install_pyne $1 run_nuc_data_make @@ -133,4 +140,4 @@ 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" +echo "PyNE build complete. PyNE can be rebuilt with the alias 'build_pyne' executed from $install_dir/pyne" From 2e4facc021483dfbd74843c3da466726ebc382f4 Mon Sep 17 00:00:00 2001 From: "Paul P.H. Wilson" Date: Fri, 14 Aug 2020 14:15:59 -0500 Subject: [PATCH 24/25] convergence in macos and ubuntu scripts --- macosx.sh | 21 +++++++++++---------- ubuntu_mint.sh | 36 +++++++++++------------------------- 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/macosx.sh b/macosx.sh index eed1250..ddc922b 100755 --- a/macosx.sh +++ b/macosx.sh @@ -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 @@ -36,7 +36,7 @@ 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 @@ -44,7 +44,7 @@ function build_moab { 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 @@ -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 @@ -94,17 +94,17 @@ 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 @@ -112,13 +112,14 @@ function run_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 @@ -126,7 +127,7 @@ 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 @@ -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." diff --git a/ubuntu_mint.sh b/ubuntu_mint.sh index 23bd75e..c1978e2 100755 --- a/ubuntu_mint.sh +++ b/ubuntu_mint.sh @@ -34,14 +34,7 @@ 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 @@ -49,11 +42,12 @@ function build_moab { 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 { @@ -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 } @@ -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." From 1c06a88ed77820fc309a714a44cd0d845fadd58a Mon Sep 17 00:00:00 2001 From: Nathan Ryan <55766947+nsryan2@users.noreply.github.com> Date: Fri, 14 Aug 2020 15:25:12 -0500 Subject: [PATCH 25/25] Apply suggestions from code review Co-authored-by: Baptiste Mouginot <15145274+bam241@users.noreply.github.com> --- macosx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx.sh b/macosx.sh index ddc922b..5ae6cc9 100755 --- a/macosx.sh +++ b/macosx.sh @@ -84,8 +84,8 @@ function install_pyne { fi - python setup.py install --user -- -DMOAB_LIBRARY=${install_dir}/moab/lib - -DMOAB_INCLUDE_DIR=${install_dir}/moab/include + python setup.py install --user -- -DMOAB_LIBRARY=${install_dir}/moab/lib \ + -DMOAB_INCLUDE_DIR=${install_dir}/moab/include \ --dagmc ${install_dir}/dagmc \ --clean