User configuration

To configure your environment:

  1. Set the compiler type to Arm in etc/pref.sh:

    $ echo "WM_COMPILER=Arm" > $BUILD_DIR/OpenFOAM-v1812/etc/prefs.sh
    
  2. Ensure that your desired optimisation and library flags are set in OpenFOAM‑v1812/wmake/rules/linuxARM64Arm/.
    For example:

    • In the c file, set the following flags:
    • LINKLIBSO = $(cc) -shared -mcpu=native -armpl
      LINKEXE   = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs ‑mcpu=native ‑armpl
      
    • In the cOpt file, set the following flags:
    • cOPT = -mcpu=native -ffp-contract=fast -O3 -fsimdmath -armpl
    • In the c++ file, set the following flags:
    • LINKLIBSO = $(CC) $(c++FLAGS) -shared -mcpu=native -armpl
      LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -mcpu=native -armpl
      
    • In the c++Opt file, set the following flags:
    • c++OPT = -mcpu=native -ffp-contract=fast -O3 -fsimdmath -armpl
  3. Source the OpenFOAM build environment:

    $ source $BUILD_DIR/OpenFOAM-v1812/etc/bashrc
Previous Next