Build and install NAMD with Arm Compiler for HPC


This recipe for building NAMD requires you to have previously built and installed Charm++ using the instructions provided in this tutorial.

If you have not already, setup the variables BUILD_DIR and INSTALL_DIR, using:


To build NAMD:

  1. Change into the NAMD_2.12_Source directory, using:

    cd ./NAMD_2.12_Source
  2. Generate an armclang architecture file based on the existing Linux-ARM64-g++.arch file. To generate this file, you need to know the location of the Charm++ build directory NAMD_CHARM_DIR, and the architecture used for the Charm++ build CHARMARCH.

    For example, if Charm++ has been built and installed into ${INSTALL_DIR}/charm680, as described above:

    export CHARMARCH=multicore-linux-aarch64
    export NAMD_CHARM_DIR=${INSTALL_DIR}/charm680

    Copy the Linux-ARM64-g++.arch file, whilst renaming it to Linux-ARM64-armclang.arch using the command:

    cp arch/Linux-ARM64-g++.arch arch/Linux-ARM64-armclang.arch

    and configure this file using:

    sed -i "s|CHARMBASE.*|CHARMBASE = ${NAMD_CHARM_DIR}/|g" Make.charm
    sed -i "s|^CHARMARCH =.*|CHARMARCH = $CHARMARCH|g" arch/Linux-ARM64-armclang.arch
    sed -i "s|^FLOATOPTS =.*|FLOATOPTS = -O3 -fomit-frame-pointer ${WARN} ${TUNE}|g" arch/Linux-ARM64-armclang.arch
    sed -i "s|^CC = gcc|CC = $CC|g" arch/Linux-ARM64-armclang.arch
    sed -i "s|^CXX = g++|CXX = $CXX |g" arch/Linux-ARM64-armclang.arch
  3. NAMD's FFT configuration needs to be set to link to the FFTW interface of the Arm Performance Libraries. Ensure that ARMPL_DIR is set to the location of the installed library, and make a new FFT config file based on the existing x86 one, using:

    cp arch/Linux-x86_64.fftw3 arch/Linux-ARM64.fftw3

    and configure this file using:

    sed -i "s|^FFTDIR=.*|FFTDIR=$ARMPL_DIR|g" arch/Linux-ARM64.fftw3
    sed -i "s|^FFTINCL=.*|FFTINCL=-I$ARMPL_DIR/include|g" arch/Linux-ARM64.fftw3
    sed -i "s|^FFTLIB=.*|FFTLIB=-L$ARMPL_DIR/lib -larmpl -lflang -lflangrti|g" arch/Linux-ARM64.fftw3
  4. Complete the configuration and build NAMD with Arm Compiler for HPC, using:

    ./config Linux-ARM64-armclang --with-fftw3 --without-tcl --charm-arch $CHARMARCH

    cd Linux-ARM64-armclang
    make -j
  5. Create symbolic links to the executables, using:

    ln -s $BUILD_DIR/NAMD_2.12_Source/Linux-ARM64-armclang/charmrun charmrun
    ln -s $BUILD_DIR/NAMD_2.12_Source/Linux-ARM64-armclang/namd2 namd2
Previous Next