Skip to content

Commit

Permalink
Merge pull request pyne#1534 from gonuke/fix_bare_python
Browse files Browse the repository at this point in the history
better reference to python
  • Loading branch information
bquan0 authored May 1, 2024
2 parents d334cbd + ccb023e commit 94655cf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 43 deletions.
9 changes: 1 addition & 8 deletions .github/actions/build-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ inputs:
description: The docker stage that will be used as the docker image for testing.
required: true
default: ''
hdf5:
description: Information about which version of HDF5 will be used for testing.
required: true
default: ''
runs:
using: "composite"
steps:
Expand All @@ -22,17 +18,14 @@ runs:
if [[ "${{ inputs.stage }}" == "dagmc" ]]; then
export ADD_FLAG="${ADD_FLAG} --dagmc /root/opt/dagmc"
fi
if [[ "${{ inputs.hdf5 }}" == "_hdf5" ]]; then
export ADD_FLAG="${ADD_FLAG} --hdf5 /root/opt/hdf5/hdf5-1_14_3"
fi
export ADD_FLAG="${ADD_FLAG} "
echo "ADD_FLAG=${ADD_FLAG}" >> $GITHUB_ENV
- name: Building PyNE
shell: bash -l {0}
run: |
cd $GITHUB_WORKSPACE
python setup.py install --user --clean ${{ env.ADD_FLAG}}
python setup.py install --user --clean --hdf5 /root/opt/hdf5/hdf5-1_14_3 ${{ env.ADD_FLAG}}
export PATH="$PATH:/github/home/.local/bin"
cd ../
nuc_data_make
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ jobs:
uses: ./.github/actions/build-test
with:
stage: ${{ matrix.stage }}
hdf5: ${{ matrix.hdf5 }}
2 changes: 0 additions & 2 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ on:
paths:
- 'docker/*'
- '.github/workflows/docker_publish.yml'
- '.github/actions/build-test/action.yml'
push:
paths:
- 'docker/*'
- '.github/workflows/docker_publish.yml'
- '.github/actions/build-test/action.yml'

env:
DOCKER_IMAGE_BASENAME: ghcr.io/${{ github.repository_owner }}/pyne_ubuntu_22.04_py3
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Next Version
* new download location for KAERI data archive
* do not try to download missing (super heavy) data from KAERI
* update material_library writing interface
* reference python_executable rather than assuming `python` exists ()

v0.7.8
======
Expand Down
46 changes: 15 additions & 31 deletions scripts/ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ apt_package_list="software-properties-common \
gfortran \
libblas-dev \
liblapack-dev \
libeigen3-dev \
libhdf5-dev \
hdf5-tools"
libeigen3-dev"

# list of python package required for PyNE and its depedencies (installed using pip3 python package manager)
pip_package_list="numpy==1.23 \
scipy \
\'cython<3\' \
cython \
nose \
pytest \
tables \
Expand Down Expand Up @@ -60,8 +58,7 @@ echo "export PATH=$HOME/.local/bin:\$PATH" >> ~/.bashrc
# build HDF5 if necessary
build_hdf5=$2
hdf5_libdir=$HOME/opt/hdf5/$build_hdf5
if [ $build_hdf5 != "NO" ]; then \
cd $install_dir \
cd $install_dir \
&& mkdir hdf5 \
&& cd hdf5 \
&& git clone --single-branch --branch $build_hdf5 https://github.com/HDFGroup/hdf5.git \
Expand All @@ -70,35 +67,26 @@ if [ $build_hdf5 != "NO" ]; then \
&& make -j 3 \
&& make install \
&& cd .. \
&& rm -rf hdf5; \
fi
&& rm -rf hdf5;

# put HDF5 on the path
export LD_LIBRARY_PATH=$hdf5_libdir/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$hdf5_libdir/lib:$LIBRARY_PATH
# # need to put libhdf5.so on LD_LIBRARY_PATH (Making sure that LD_LIBRARY_PATH is defined first)
# if [ -z $LD_LIBRARY_PATH ]; then
# export LD_LIBRARY_PATH="${hdf5_libdir}"
# else
# export LD_LIBRARY_PATH="${hdf5_libdir}:$LD_LIBRARY_PATH"
# fi

export PYNE_HDF5_ARGS="--hdf5 ${hdf5_libdir}"; \

############
### MOAB ###
############
# pre-setup
export MOAB_HDF5_ARGS=""
if [ $build_hdf5 != "NO" ]; then \
export MOAB_HDF5_ARGS="-DHDF5_ROOT=$hdf5_libdir"; \
fi
export MOAB_HDF5_ARGS="-DHDF5_ROOT=$hdf5_libdir"
cd ${install_dir}
check_repo moab
mkdir -p moab
cd moab

# clone and version
git clone --depth 1 --single-branch -b 5.3.0 https://bitbucket.org/fathomteam/moab moab-repo
export moab_version=5.5.1
git clone --depth 1 --single-branch -b ${moab_version} https://bitbucket.org/fathomteam/moab moab-repo
cd moab-repo
mkdir -p build
cd build
Expand All @@ -121,6 +109,7 @@ rm -rf moab-repo
# Adding MOAB/lib to $LD_LIBRARY_PATH and $LIBRARY_PATH
export LD_LIBRARY_PATH="${install_dir}/moab/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${install_dir}/moab/lib:$LIBRARY_PATH"
export PYNE_MOAB_ARGS="--moab $HOME/opt/moab"

#############
### DAGMC ###
Expand Down Expand Up @@ -154,31 +143,26 @@ rm -rf dagmc-repo

# Adding DAGMC/lib to $LD_LIBRARY_PATH and $LIBRARY_PATH
export LD_LIBRARY_PATH="${install_dir}/dagmc/lib:$LD_LIBRARY_PATH"
export PYNE_DAGMC_ARGS="--dagmc $HOME/opt/dagmc"

# Adding dagmc/bin to $PATH
export PATH="${install_dir}/dagmc/bin:$PATH"

####################
### OpenMC API #####
####################
if [ $build_hdf5 != "NO" ]; then \
export HDF5_ROOT="$hdf5_libdir"; \
fi
export HDF5_ROOT="$hdf5_libdir"
export openmc_version=v0.14.0
cd ${install_dir}
git clone https://github.com/openmc-dev/openmc.git
git clone --depth 1 --branch ${openmc_version} https://github.com/openmc-dev/openmc.git
cd openmc
git checkout tags/v0.13.0
pip install --user .

############
### PyNE ###
############

# pre-setup
export PYNE_HDF5_ARGS=""
if [ $build_hdf5 != "NO" ]; then \
export PYNE_HDF5_ARGS="--hdf5 ${hdf5_libdir}"; \
fi
cd ${install_dir}
check_repo pyne
mkdir -p pyne
Expand All @@ -192,8 +176,8 @@ if [ $1 == 'stable' ] ; then
fi

python setup.py install --user \
--moab ${install_dir}/moab \
--dagmc ${install_dir}/dagmc \
${PYNE_MOAB_ARGS} \
${PYNE_DAGMC_ARGS} \
${PYNE_HDF5_ARGS} \
--clean -j 3

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(PYNE_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" ${PYNE_INCLUDE_DIRS}
PARENT_SCOPE)

execute_process(COMMAND python "${CMAKE_CURRENT_LIST_DIR}/../pyne/pyne_version.py" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../pyne/pyne_version.py" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

pyne_download_platform()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down

0 comments on commit 94655cf

Please sign in to comment.