A relatively recent NVIDIA GPU is mandatory for the GPU code. Nothing special is needed for the CPU code.

Operating Systems and Compilers

In order to compile the GPU code, the most recent NVIDIA HPC SDK is preferred for the OpenACC directives. Due to its limitations, the GPU code is unavailable on macOS.

For Linux, we need:

  • GNU or Intel Fortran compiler.

  • Recent C++ compiler that supports C++11 syntax.

  • (GPU code only) NVIDIA HPC SDK with OpenACC support, and CUDA with nvcc.

  • If NVIDIA driver has been installed correctly, nvidia-smi should be available.

We have successfully built Tinker9 on Windows WSL2 Ubuntu with CUDA 11.0 and NVHPC 20.9. Please proceed to this NVIDIA webpage for more details.

Using NVIDIA HPC SDK on Clusters

Prior to rebranding, the current NVIDIA HPC SDK was known as the PGI compiler suite. During Jan. 2020 we worked on a cluster that was still running Red Hat with gcc 4.8.5 by default without root privilege. Although several more recent gcc and PGI versions were available via the module program, the most recent PGI compiler (2019) was still configured with gcc 4.8.5 by default, which had a very bad support for C++11. Since I didn’t have root privilege on the cluster, I had to use a custom localrc file by running the following command to reconfigure PGI compiler with gcc 7.4.0:

makelocalrc $PGI/linux86-64-llvm/2019 \
-gcc /usr/local/gcc-7.4.0/bin/gcc \
-gpp /usr/local/gcc-7.4.0/bin/g++ \
-g77 /usr/local/gcc-7.4.0/bin/gfortran \
-d /dir_for_new_config -x

then added export PGI_LOCALRC=/dir_for_new_config/localrc to my bash resource file.

(Updated in Apr. 2021)

Compilers with the new brand name NVHPC now have a different directory structure. The new command will look like

makelocalrc $NVHPC/Linux_x86_64/2020/compilers \
-gcc /usr/local/gcc-7.4.0/bin/gcc \
-gpp /usr/local/gcc-7.4.0/bin/g++ \
-g77 /usr/local/gcc-7.4.0/bin/gfortran \
-d /dir_for_new_config -x

then add export NVLOCALRC=/dir_for_new_config/localrc to the shell resource file.

FFTW Libraries

Canonical Tinker requires FFTW libraries because by default it is compiled with OpenMP. Otherwise, Tinker will use FFTPACK. In Tinker9, the underlying libtinker.a will be compiled without OpenMP, therefore FFTW libraries are no longer mandatory for GPU code.

However, FFTW libraries are required by CPU code. Two prebuilt FFTW libraries, libfftw3 and libfftw3_threads are needed by the double precision CPU code. The other two FFTW libraries, libfftw3f and libfftw3f_threads are needed by the mixed and single precision CPU code.

Other Nonmandatory Utilities

  • ClangFormat: to format the source code.

  • Sphinx: to generate user manual.

    • PDF version also depends on TeX.

    • HTML theme from pip.

  • Doxygen: to generate developer guides.

pip install -U Sphinx
pip install pydata-sphinx-theme