Skip to content

Commit

Permalink
allow prefix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ebknudsen committed Nov 24, 2023
1 parent f13753c commit 786c2c2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 13 deletions.
28 changes: 24 additions & 4 deletions Ubuntu_22.04/dagmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ WD=`pwd`
name=`basename $0`
package_name='dagmc'

install_prefix="/opt"
if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi
build_prefix="$HOME/openmc"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi

#if there is a .done-file then skip this step
if [ ! -e ${name}.done ]; then

Expand All @@ -23,10 +32,21 @@ if [ ! -e ${name}.done ]; then
ccores=$1
fi

mkdir -p $HOME/openmc/DAGMC
cd $HOME/openmc/DAGMC
git clone --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git
mkdir build
mkdir -p ${build_prefix}/openmc/DAGMC
cd ${build_prefix}/openmc/DAGMC
if [ ! -e DAGMC ]; then
git clone --branch develop https://github.com/svalinn/DAGMC.git
cd DAGMC
else
cd DAGMC; git pull
fi

for patch in `ls ${WD}/../patches/dagmc_*.patch`; do
patch -p1 < $patch
done

cd ..
mkdir -p build
cd build
cmake ../DAGMC -DBUILD_TALLY=ON \
-DMOAB_DIR=$HOME/openmc/MOAB \
Expand Down
30 changes: 21 additions & 9 deletions Ubuntu_22.04/double_down-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ WD=`pwd`
name=`basename $0`
package_name='double_down'

install_prefix="/opt"
if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi
build_prefix="$HOME/openmc"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi

#if there is a .done-file then skip this step
if [ ! -e ${name}.done ]; then
sudo apt-get install --yes doxygen\
Expand All @@ -27,18 +36,21 @@ if [ ! -e ${name}.done ]; then
ccores=$1
fi

mkdir -p $HOME/openmc/double-down
cd $HOME/openmc/double-down
git clone --single-branch --branch develop --depth 1 https://github.com/pshriwise/double-down.git
mkdir build
cd build
cmake ../double-down -DMOAB_DIR=$HOME/openmc/MOAB \
-DCMAKE_INSTALL_PREFIX=$HOME/openmc/double-down
mkdir -p ${build_prefix}/openmc/double-down
cd ${build_prefix}/openmc/double-down
if [ ! -d double-down ]; then
git clone --single-branch --branch develop --depth 1 https://github.com/pshriwise/double-down.git
fi

make -j $ccores
mkdir -p build
cd build
cmake ../double-down -DMOAB_DIR=${install_prefix} \
-DCMAKE_INSTALL_PREFIX=${install_prefix}
make -j ${ccores}
make install

cd ${WD}
#touch a lock file to avoid uneccessary rebuilds
cd $WD
touch ${name}.done
else
echo double-down appears to be already installed \(lock file ${name}.done exists\) - skipping.
Expand Down

0 comments on commit 786c2c2

Please sign in to comment.