Skip to content

Commit

Permalink
Merge pull request #32 from openmsr/debug_command_line_option
Browse files Browse the repository at this point in the history
Debug command line option
  • Loading branch information
Erik B Knudsen authored Sep 4, 2024
2 parents b9b5a9f + 25c3b21 commit 6d10bf6
Show file tree
Hide file tree
Showing 27 changed files with 596 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_from_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
include:
# - { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' }
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.10' }
- { os: ubuntu-22.04, CC: clang, CXX: clang++, python: '3.11' }
Expand Down
20 changes: 12 additions & 8 deletions Arch/dagmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ echo "Compiled & installed double-down, proceeding..."
WD=`pwd`
name=`basename $0`
package_name='dagmc'

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.
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
pacman -Qi python > /dev/null
Expand All @@ -37,10 +42,9 @@ if [ ! -e ${name}.done ]; then
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
git clone --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git
else
cd DAGMC; git pull
cd DAGMC; git pull; cd ..
fi

for patch in `ls ${WD}/../patches/dagmc_*.patch`; do
Expand All @@ -51,12 +55,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
18 changes: 11 additions & 7 deletions Arch/double_down-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ 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.
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 pacman -Sy --noconfirm embree doxygen
Expand All @@ -38,19 +44,17 @@ if [ ! -e ${name}.done ]; then
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
git clone --single-branch --branch develop --depth 1 https://github.com/pshriwise/double-down.git
fi

mkdir -p build
cd build
cmake ../double-down -DMOAB_DIR=${install_prefix} \
-DCMAKE_BUILD_TYPE=Debug\
-DCMAKE_INSTALL_PREFIX=${install_prefix}
cmake ../double-down -DMOAB_DIR=${install_prefix}\
-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
46 changes: 26 additions & 20 deletions Arch/embree-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
################################################################################
#!/bin/bash
set -ex
if [ "x" == "$1x" ]; then
ccores=1
else
ccores=$1
fi

WD=`pwd`
name=`basename $0`
Expand All @@ -19,26 +24,27 @@ if [ ! -e ${name}.done ]; then
tbb \
openimageio

#Should we run make in parallel? Default is yo use all available cores
ccores=`cat /proc/cpuinfo |grep CPU|wc -l`
if [ "x$1" != "x" ]; then
ccores=$1
fi
#if there is a .done-file then skip this step
if [ ! -e $0.done ]; then
cd $HOME
mkdir -p openmc
cd openmc
mkdir -p embree
cd embree
git clone --single-branch --branch v3.13.3 --depth 1 https://github.com/embree/embree.git
mkdir build
cd build
cmake ../embree -DCMAKE_INSTALL_PREFIX=$HOME/openmc/embree \
-DEMBREE_ISPC_SUPPORT=OFF \
-DEMBREE_TUTORIALS=OFF \
-DEMBREE_MAX_ISA=NONE
make -j $ccores
sudo make install
rm -rf embree/build embree/embree

#run actual install process
mkdir -p $HOME/openmc/embree
cd $HOME/openmc/embree
git clone --single-branch --branch v3.13.3 --depth 1 https://github.com/embree/embree.git
mkdir -p build
cd build
cmake ../embree -DCMAKE_INSTALL_PREFIX=/opt/embree\
-DEMBREE_ISPC_SUPPORT=OFF\
-DEMBREE_TUTORIALS=OFF
make -j ${ccores}
sudo make install
cd ${WD}
#touch a lock file to avoid uneccessary rebuilds
touch ${name}.done
cd ${WD}
touch ${0}.done
else
echo embree appears to be already installed \(lock file ${name}.done exists\) - skipping.
name=`basename $0`
echo embree appears to already be installed \(lock file ${name}.done exists\) - skipping.
fi
11 changes: 7 additions & 4 deletions Arch/moab-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ install_prefix="/opt"
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.
if [ "x" != "x$OPENMC_BUILD_PREFIX" ]; then
build_prefix=$OPENMC_BUILD_PREFIX
fi

echo will install to $LOCAL_INSTALL_PREFIX

build_type="Release"
if [ "xON" == "x$DEBUG_BUILD" ]; then
build_type="Debug"
fi
#check if there is a .done file indicating that we have already built this target
if [ ! -e ${name}.done ]; then
if ! pacman -Qi eigen netcdf hdf5-openmpi python-setuptools cython; then
Expand Down Expand Up @@ -47,12 +50,12 @@ if [ ! -e ${name}.done ]; then
mkdir -p build
cd build
cmake ../moab -DENABLE_HDF5=ON \
-DCMAKE_BUILD_TYPE=Debug\
-DENABLE_NETCDF=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_FORTRAN=OFF \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_BLASLAPACK=OFF \
-DCMAKE_BUILD_TYPE=${build_type}\
-DCMAKE_INSTALL_PREFIX=${install_prefix}
make -j ${ccores}
make install
Expand Down
52 changes: 29 additions & 23 deletions Arch/openmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,22 @@ 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="/dev/null/openmc" #this will never exist - and so use the default later.
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

Expand Down Expand Up @@ -57,27 +63,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 @@ -88,11 +94,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
66 changes: 46 additions & 20 deletions Debian10/dagmc-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,58 @@ set -ex
./double_down-install.sh
echo "Compiled & installed double-down, proceeding..."

sudo apt-get install --yes python
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.
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 $0.done ]; then
if [ ! -e ${name}.done ]; then

sudo apt-get install --yes python3

#Should we run make in parallel? Default is to use all available cores
ccores=`cat /proc/cpuinfo |grep CPU|wc -l`
if [ "x$1" != "x" ]; then
ccores=$1
fi

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

cd $HOME/openmc
mkdir DAGMC
cd DAGMC
git clone --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git
mkdir build
mkdir -p build
cd build
cmake ../DAGMC -DBUILD_TALLY=ON \
-DCMAKE_BUILD_TYPE=Debug\
-DMOAB_DIR=$HOME/openmc/MOAB \
-DDOUBLE_DOWN=ON \
-DBUILD_STATIC_EXE=OFF \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=$HOME/openmc/DAGMC/ \
-DDOUBLE_DOWN_DIR=$HOME/openmc/double-down
-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
cd ../..
rm -rf DAGMC/DAGMC /DAGMC/build

touch ${0}.done
cd ${WD}
touch ${name}.done
else
name=`basename $0`
echo DAGMC appears to already be installed \(lock file ${name}.done exists\) - skipping.
echo DAGMC appears already to be installed \(lock file ${name}.done exists\) - skipping.
fi

Loading

0 comments on commit 6d10bf6

Please sign in to comment.