Skip to content

Instantly share code, notes, and snippets.

@tp5uiuc
Last active September 27, 2022 20:39
Show Gist options
  • Select an option

  • Save tp5uiuc/8ec359f3200fa55691f78ff44b55ece4 to your computer and use it in GitHub Desktop.

Select an option

Save tp5uiuc/8ec359f3200fa55691f78ff44b55ece4 to your computer and use it in GitHub Desktop.
Build Elastica on systems
#!/usr/bin/env bash
declare -A compilers
compilers[gcc]=/opt/homebrew/opt/gcc/bin/g++-12
compilers[clang]=/opt/homebrew/opt/llvm/bin/clang++
declare -A cmake_build_types
cmake_build_types[debug]="Debug"
# cmake_build_types[release]="Release"
# cmake_build_types[relwithdebuginfo]="RelWithDebInfo"
declare -A smp_options
# smp_options[smp_enabled]="ON"
smp_options[smp_disabled]="OFF"
# CMAKE="${HOME}/Desktop/third_party/vcpkg/downloads/tools/cmake-3.21.1-linux/cmake-3.21.1-linux-x86_64/bin/cmake"
CMAKE="cmake"
for compiler in "${!compilers[@]}"; do
for cmake_build_type in "${!cmake_build_types[@]}"; do
for smp_option in "${!smp_options[@]}"; do
BUILD_PATH="build_${compiler}_${cmake_build_type}_${smp_option}"
mkdir -p "${BUILD_PATH}" && cd "$_" || exit
CXX=${compilers[$compiler]}
CMAKE_BUILD_TYPE=${cmake_build_types[$cmake_build_type]}
SMP_OPTION=${smp_options[$smp_option]}
${CMAKE} .. -DCMAKE_CXX_COMPILER="${CXX}"\
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"\
-DBUILD_TESTING=ON\
-DELASTICA_BUILD_DOCUMENTATION=OFF\
-DELASTICA_BUILD_EXAMPLES=ON\
-DELASTICA_BUILD_BENCHMARKS=OFF\
-DELASTICA_BUILD_PYTHON_BINDINGS=ON\
-DELASTICA_ENABLE_PROFILING=ON\
-DELASTICA_SMP="${SMP_OPTION}"\
-DDEBUG_SYMBOLS=ON\
-DENABLE_WARNINGS=ON
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cd ..
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment