Skip to content

Commit

Permalink
homogenize between 20.04 and 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik B Knudsen committed Sep 4, 2024
1 parent 327ee0a commit e30f5dd
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 46 deletions.
4 changes: 2 additions & 2 deletions ubuntu-20.04/dagmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ echo "Compiled & installed double-down, proceeding..."
WD=`pwd`
name=`basename $0`
package_name='dagmc'

install_prefix="/usr/local/lib"
if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi

build_prefix="/dev/null/openmc" #this will never exist - and so use the default later.
build_prefix="$HOME"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi
Expand Down
6 changes: 2 additions & 4 deletions ubuntu-20.04/double_down-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ WD=`pwd`
name=`basename $0`
package_name='double_down'

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

build_prefix="/dev/null/openmc" #this will never exist - and so use the default later.
build_prefix="$HOME"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi
Expand Down
2 changes: 1 addition & 1 deletion ubuntu-20.04/moab-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi

build_prefix="/dev/null/openmc" #this will never exist - and so use the default later.
build_prefix="$HOME"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi
Expand Down
17 changes: 9 additions & 8 deletions ubuntu-20.04/openmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi

build_prefix="/dev/null/openmc" #this will never exist - and so use the default later.
build_prefix="$HOME"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi
Expand Down Expand Up @@ -87,14 +87,15 @@ if [ ! -e ${name}.done ]; then
fi
mkdir -p build
cd build
cmake -DOPENMC_USE_DAGMC=ON\
-DOPENMC_USE_OPENMP=ON\
-DOPENMC_USE_MPI=ON\
-DOPENMC_USE_MCPL=ON\
if [ $OPENMC_NOMPI ]; then
cmake -DOPENMC_USE_DAGMC=ON -DOPENMC_USE_OPENMP=ON -DOPENMC_USE_MPI=OFF\
-DCMAKE_BUILD_TYPE=${build_type}\
-DDAGMC_ROOT=${install_prefix}\
-DHDF5_PREFER_PARALLEL=off\
-DCMAKE_INSTALL_PREFIX=${install_prefix} ..
-DDAGMC_ROOT=${install_prefix} -DHDF5_PREFER_PARALLEL=off -DCMAKE_INSTALL_PREFIX=${install_prefix} ..
else
cmake -DOPENMC_USE_DAGMC=ON -DOPENMC_USE_OPENMP=ON -DOPENMC_USE_MPI=ON\
-DCMAKE_BUILD_TYPE=${build_type}\
-DDAGMC_ROOT=${install_prefix} -DHDF5_PREFER_PARALLEL=on -DCMAKE_INSTALL_PREFIX=${install_prefix} ..
fi
make -j $ccores
make install

Expand Down
14 changes: 9 additions & 5 deletions ubuntu-22.04/dagmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ install_prefix="/usr/local/lib"
if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi
build_prefix="$HOME/openmc"
build_prefix="$HOME"
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi

build_type="Release"
if [ "xON" = "x$DEBUG_BUILD" ]; then
build_type="Debug"
fi

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

Expand All @@ -40,9 +45,8 @@ if [ ! -e ${name}.done ]; then
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
cd DAGMC; git pull; cd ..
fi

for patch in `ls ${WD}/../patches/dagmc_*.patch`; do
Expand All @@ -53,12 +57,12 @@ if [ ! -e ${name}.done ]; then
mkdir -p build
cd build
cmake ../DAGMC -DBUILD_TALLY=ON \
-DCMAKE_BUILD_TYPE=Debug\
-DMOAB_DIR=${install_prefix} \
-DMOAB_DIR=${install_prefix}\
-DDOUBLE_DOWN=ON\
-DBUILD_STATIC_EXE=OFF\
-DBUILD_STATIC_LIBS=OFF\
-DCMAKE_INSTALL_PREFIX=${install_prefix}\
-DCMAKE_BUILD_TYPE=${build_type}\
-DDOUBLE_DOWN_DIR=${install_prefix}
make -j ${ccores}
make install
Expand Down
9 changes: 6 additions & 3 deletions ubuntu-22.04/double_down-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi

build_type="Release"
if [ "xON" = "x$DEBUG_BUILD" ]; then
build_type="Debug"
fi
#if there is a .done-file then skip this step
if [ ! -e ${name}.done ]; then
sudo apt-get install --yes doxygen\
Expand All @@ -45,13 +49,12 @@ if [ ! -e ${name}.done ]; then
mkdir -p build
cd build
cmake ../double-down -DMOAB_DIR=${install_prefix} \
-DCMAKE_BUILD_TYPE=Debug\
-DCMAKE_BUILD_TYPE=${build_type}\
-DCMAKE_INSTALL_PREFIX=${install_prefix}
make -j ${ccores}
make install

#touch a lock file to avoid uneccessary rebuilds
cd $WD
cd ${WD}
touch ${name}.done
else
echo double-down appears to be already installed \(lock file ${name}.done exists\) - skipping.
Expand Down
54 changes: 31 additions & 23 deletions ubuntu-22.04/openmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,34 @@ echo "Compiled & installed dagmc, proceeding..."

WD=`pwd`
name=`basename $0`
package_name='openmc'
install_prefix="/usr/local/lib"
if [ "x" != "x$LOCAL_INSTALL_PREFIX" ]; then
install_prefix=$LOCAL_INSTALL_PREFIX
fi

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

build_type="Release"
if [ "xON" = "x$DEBUG_BUILD" ]; then
build_type="Debug"
fi

echo will install openmc to $install_prefix
echo will build openmc from $build_prefix

#if there is a .done-file then skip this step
if [ ! -e ${name}.done ]; then
sudo apt-get install --yes libpng-dev libpng++-dev\
imagemagick\
python3-lxml\
python3-scipy\
python3-pandas\
python3-h5py\
python3-h5py-mpi\
python3-matplotlib\
python3-uncertainties

Expand All @@ -50,27 +58,27 @@ if [ ! -e ${name}.done ]; then
fi

#Should --openmc_build be passed as argument, it assumes a git version is already checked-out
if [ -e $build_prefix/openmc/openmc ]; then
cd $build_prefix/openmc/openmc
if [ -e ${build_prefix}/openmc/openmc ]; then
cd ${build_prefix}/openmc/openmc
else
#source install
mkdir -p $build_prefix/openmc
cd $build_prefix/openmc
if [ -e openmc ]; then
#repo exists checkout the given version and get new updates
#(updates are of course only relevant for development branches.)
cd openmc
git checkout $openmc_version
#if this is a branch - make sure it is up to date
if git show-ref --verify refs/heads/$openmc_version; then
git pull
fi
else
#clone the repo and checkout the given version
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
cd openmc
git checkout $openmc_version
fi
#source install
mkdir -p $build_prefix/openmc
cd $build_prefix/openmc
if [ -e openmc ]; then
#repo exists checkout the given version and get new updates
#(updates are of course only relevant for development branches.)
cd openmc
git checkout $openmc_version
#if this is a branch - make sure it is up to date
if git show-ref --verify refs/heads/$openmc_version; then
git pull
fi
else
#clone the repo and checkout the given version
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
cd openmc
git checkout $openmc_version
fi
fi

if [ -e build ]; then
Expand All @@ -81,11 +89,11 @@ if [ ! -e ${name}.done ]; then
cd build
if [ $OPENMC_NOMPI ]; then
cmake -DOPENMC_USE_DAGMC=ON -DOPENMC_USE_OPENMP=ON -DOPENMC_USE_MPI=OFF\
-DCMAKE_BUILD_TYPE=Debug\
-DCMAKE_BUILD_TYPE=${build_type}\
-DDAGMC_ROOT=${install_prefix} -DHDF5_PREFER_PARALLEL=off -DCMAKE_INSTALL_PREFIX=${install_prefix} ..
else
cmake -DOPENMC_USE_DAGMC=ON -DOPENMC_USE_OPENMP=ON -DOPENMC_USE_MPI=ON\
-DCMAKE_BUILD_TYPE=Debug\
-DCMAKE_BUILD_TYPE=${build_type}\
-DDAGMC_ROOT=${install_prefix} -DHDF5_PREFER_PARALLEL=on -DCMAKE_INSTALL_PREFIX=${install_prefix} ..
fi
make -j $ccores
Expand Down

0 comments on commit e30f5dd

Please sign in to comment.