11# Everything before this line will be provided by the new-env script
2-
2+
33# ---- Modules ----
44module purge
55module load cpe/25.09
@@ -12,28 +12,24 @@ module load cmake
1212module load ninja
1313module load CCE-GPU-5.0.0
1414module load boost/1.88.0-mpi
15-
15+
1616# ---- AdaptiveCpp config ----
1717export ACPP_VERSION=v24.10.0
1818export ACPP_TARGETS=" hip:gfx90a"
1919export ACPP_GIT_DIR=$BUILD_DIR /.env/acpp-git
2020export ACPP_BUILD_DIR=$BUILD_DIR /.env/acpp-builddir
2121export ACPP_INSTALL_DIR=$BUILD_DIR /.env/acpp-installdir
22-
22+
2323export C_INCLUDE_PATH=$ROCM_PATH /llvm/include
2424export CPLUS_INCLUDE_PATH=$ROCM_PATH /llvm/include
25-
25+
2626export MPICH_GPU_SUPPORT_ENABLED=1
2727
2828export BOOST_ROOT_PATH=" ${BOOST_ROOT:-/ opt/ software/ gaia/ prod/ 5.0.0/ boost-1.88.0-cce-18.0.0-ml3z} "
29-
30- # The Boost installation on Adastra only ships tagged library names
31- # (libboost_context-mt-x64.so etc.) but ld.lld expects untagged names
32- # (libboost_context.so). We create symlinks in a writable directory and
33- # prepend it to the linker search path.
3429export BOOST_SYMLINK_DIR=$BUILD_DIR /.env/boost-symlinks
35-
30+
3631function setupboost {
32+ # here I lost 2hrs of my life
3733 mkdir -p " ${BOOST_SYMLINK_DIR} "
3834 for tagged in " ${BOOST_ROOT_PATH} /lib" /libboost_* -mt-x64.so; do
3935 # e.g. libboost_context-mt-x64.so -> libboost_context.so
@@ -44,19 +40,19 @@ function setupboost {
4440 fi
4541 done
4642}
47-
43+
4844setupboost
49-
45+
5046export LD_LIBRARY_PATH=" ${BOOST_SYMLINK_DIR} :${BOOST_ROOT_PATH} /lib:${LD_LIBRARY_PATH} "
51-
47+
5248# ---- Compiler setup ----
5349function setupcompiler {
5450 echo " ---- Running AdaptiveCpp compiler setup ----"
5551 echo " -- Module list"
5652 module list
57-
53+
5854 clone_acpp || return
59-
55+
6056 cmake -S ${ACPP_GIT_DIR} -B ${ACPP_BUILD_DIR} \
6157 -DCMAKE_INSTALL_PREFIX=${ACPP_INSTALL_DIR} \
6258 -DROCM_PATH=$ROCM_PATH \
@@ -75,16 +71,16 @@ function setupcompiler {
7571 -DBoost_NO_SYSTEM_PATHS=TRUE \
7672 -DWITH_SSCP_COMPILER=OFF \
7773 -DLLVM_DIR=${ROCM_PATH} /llvm/lib/cmake/llvm/ || return
78-
74+
7975 (cd ${ACPP_BUILD_DIR} && $MAKE_EXEC " ${MAKE_OPT[@]} " && $MAKE_EXEC install) || return
8076}
81-
77+
8278if [ ! -f " $ACPP_INSTALL_DIR /bin/acpp" ]; then
8379 echo " ----- acpp is not configured, compiling it ... -----"
8480 setupcompiler || return
8581 echo " ----- acpp configured ! -----"
8682fi
87-
83+
8884# ---- Shamrock configure ----
8985function shamconfigure {
9086 cmake \
@@ -104,9 +100,8 @@ function shamconfigure {
104100 -DPYTHON_EXECUTABLE=$( python3 -c " import sys; print(sys.executable)" ) \
105101 " ${CMAKE_OPT[@]} " || return
106102}
107-
103+
108104# ---- Shamrock build ----
109105function shammake {
110106 (cd $BUILD_DIR && $MAKE_EXEC " ${MAKE_OPT[@]} " " ${@ } " ) || return
111107}
112-
0 commit comments