From e30f5dd663314268c9f1108aecf9d3e18a4726ea Mon Sep 17 00:00:00 2001 From: Erik B Knudsen Date: Wed, 4 Sep 2024 13:57:45 +0200 Subject: [PATCH] homogenize between 20.04 and 22.04 --- ubuntu-20.04/dagmc-install.sh | 4 +-- ubuntu-20.04/double_down-install.sh | 6 ++-- ubuntu-20.04/moab-install.sh | 2 +- ubuntu-20.04/openmc-install.sh | 17 ++++----- ubuntu-22.04/dagmc-install.sh | 14 +++++--- ubuntu-22.04/double_down-install.sh | 9 +++-- ubuntu-22.04/openmc-install.sh | 54 +++++++++++++++++------------ 7 files changed, 60 insertions(+), 46 deletions(-) diff --git a/ubuntu-20.04/dagmc-install.sh b/ubuntu-20.04/dagmc-install.sh index f8f3cf9..689c253 100755 --- a/ubuntu-20.04/dagmc-install.sh +++ b/ubuntu-20.04/dagmc-install.sh @@ -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 diff --git a/ubuntu-20.04/double_down-install.sh b/ubuntu-20.04/double_down-install.sh index 8c80a96..b9def77 100755 --- a/ubuntu-20.04/double_down-install.sh +++ b/ubuntu-20.04/double_down-install.sh @@ -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 diff --git a/ubuntu-20.04/moab-install.sh b/ubuntu-20.04/moab-install.sh index a6afa2a..c47d022 100755 --- a/ubuntu-20.04/moab-install.sh +++ b/ubuntu-20.04/moab-install.sh @@ -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 diff --git a/ubuntu-20.04/openmc-install.sh b/ubuntu-20.04/openmc-install.sh index 2000ec2..7f8a0bc 100755 --- a/ubuntu-20.04/openmc-install.sh +++ b/ubuntu-20.04/openmc-install.sh @@ -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 @@ -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 diff --git a/ubuntu-22.04/dagmc-install.sh b/ubuntu-22.04/dagmc-install.sh index 94dbb23..791eb0c 100755 --- a/ubuntu-22.04/dagmc-install.sh +++ b/ubuntu-22.04/dagmc-install.sh @@ -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 @@ -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 @@ -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 diff --git a/ubuntu-22.04/double_down-install.sh b/ubuntu-22.04/double_down-install.sh index 81e227e..c8d4625 100755 --- a/ubuntu-22.04/double_down-install.sh +++ b/ubuntu-22.04/double_down-install.sh @@ -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\ @@ -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. diff --git a/ubuntu-22.04/openmc-install.sh b/ubuntu-22.04/openmc-install.sh index 21ab22c..df2ba1a 100755 --- a/ubuntu-22.04/openmc-install.sh +++ b/ubuntu-22.04/openmc-install.sh @@ -20,19 +20,26 @@ 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\ @@ -40,6 +47,7 @@ if [ ! -e ${name}.done ]; then python3-scipy\ python3-pandas\ python3-h5py\ + python3-h5py-mpi\ python3-matplotlib\ python3-uncertainties @@ -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 @@ -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