Build and install Charm with Arm Compiler for Linux

  1. Change into the charm-6.8.0 directory, using:

    cd charm-6.8.0
  2. Generate an armclang configuration for the required architecture based on the existing one in src/arch/, for example src/arch/multicore-linux64, using:

    CHARMARCH=multicore-linux-aarch64

    cp -R src/arch/multicore-linux64 src/arch/$CHARMARCH

    FILE=src/arch/$CHARMARCH/conv-mach.sh
    sed -i "s|^CMK_CPP_CHARM=.*|CMK_CPP_CHARM='cpp -P'|g" $FILE
    sed -i "s|^CMK_NATIVE_CC=.*|CMK_NATIVE_CC='$CC '|g" $FILE
    sed -i "s|^CMK_NATIVE_CXX=.*|CMK_NATIVE_CXX='$CXX '|g" $FILE
    sed -i "s|^CMK_NATIVE_LD=.*|CMK_NATIVE_LD='$CC '|g" $FILE
    sed -i "s|^CMK_NATIVE_LDXX=.*|CMK_NATIVE_LDXX='$CXX '|g" $FILE
    sed -i "s|^CMK_QT=.*|CMK_QT='generic64-light '|g" $FILE
    sed -i "s|^CMK_CF77=.*|CMK_CF77='$FC '|g" $FILE
    sed -i "s|^CMK_CF90=.*|CMK_CF90='$FC '|g" $FILE
    sed -i "s|^CMK_CF90_FIXED=.*|CMK_CF90_FIXED='$FC -Mfixed '|g" $FILE

    sed -i "/#endif/i #define CMK_THREADS_USE_CONTEXT                            1" ${FILE%%.sh}.h
    sed -i "/#endif/i #define CMK_THREADS_USE_PTHREADS                           0" ${FILE%%.sh}.h
    sed -i "/#endif/i #define CMK_64BIT                                          1" ${FILE%%.sh}.h

    sed -i "s|cc-gcc|cc-armclang|g" $FILE

    cp src/arch/common/cc-gcc.sh src/arch/common/cc-armclang.sh

    sed -i "s|gcc|armclang|g" src/arch/common/cc-armclang.sh
    sed -i "s|g++|armclang++|g" src/arch/common/cc-armclang.sh
  3. Configure and build Charm++, using:

    mkdir ${INSTALL_DIR}/charm680/
    ./build charm++ $CHARMARCH --with-production --destination=${INSTALL_DIR}/charm680/${CHARMARCH} -j
Previous Next