Skip to content

Commit ec66899

Browse files
committed
Improve install guide
1 parent 18f90f1 commit ec66899

File tree

17 files changed

+368
-411
lines changed

17 files changed

+368
-411
lines changed

CMakeLists.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,47 @@ cmake_minimum_required (VERSION 3.15)
55
!!/ Build Tinker9 with CMake
66
!!/ ========================
77
!!/
8+
!!/ Quick Start
9+
!!/ -----------
10+
!!/
11+
!!/ For a GPU card with compute capability 7.0,
12+
!!/ an example to compile the GPU code without OpenACC:
13+
!!/
14+
!!/ .. code-block:: bash
15+
!!/
16+
!!/ cd tinker9 && mkdir build
17+
!!/ FC=gfortran compute_capability=70 gpu_lang=cuda cmake ..
18+
!!/ make
19+
!!/ make test
20+
!!/
21+
!!/ Assuming separate CUDA and NVHPC are properly installed,
22+
!!/ another example to compile the GPU code with both OpenACC and CUDA:
23+
!!/
24+
!!/ .. code-block:: bash
25+
!!/
26+
!!/ cd tinker9 && mkdir build
27+
!!/ cmake -DCMAKE_Fortran_COMPILER=gfortran -DCOMPUTE_CAPABILITY=70 ..
28+
!!/ make
29+
!!/ make test
30+
!!/
31+
!!/ For the options of other GPU devices and features,
32+
!!/ please refer to the subsequent sections.
33+
!!/
834
!!/ Configure CMake
935
!!/ ---------------
1036
!!/ You can skip this section if you are familar with CMake.
1137
!!/
1238
!!/ Suppose the current working directory is */home/tinker9* and we
13-
!!/ want to create a build directory called *build-cmake* in
14-
!!/ */home/tinker9*. We can do *mkdir build-cmake* then *cd build-cmake*.
39+
!!/ want to create a build directory called *build* in
40+
!!/ */home/tinker9*. We can do *mkdir build* then *cd build*.
1541
!!/ Because the top-level CMakeLists.txt file is in the parent directory,
1642
!!/ if there was nothing else to configure, command *cmake ..* would generate
1743
!!/ the Makefile. The alternative way is to specify the build and source
1844
!!/ directories to CMake, e.g.,
1945
!!/
2046
!!/ .. code-block:: bash
2147
!!/
22-
!!/ cmake -B /home/tinker9/build-cmake -S /home/tinker9
48+
!!/ cmake -B /home/tinker9/build -S /home/tinker9
2349
!!/
2450
!!/ Some CMake installations also provide a command line gui *ccmake* and a
2551
!!/ simple gui program *cmake-gui* that can replace *cmake* in the commands
@@ -51,32 +77,6 @@ cmake_minimum_required (VERSION 3.15)
5177
!!/ by its corresponding environmental variable, documented as **(env)** here.
5278
!!/ Note that there is no **-D** prefix for the environmental variables.
5379
!!/
54-
!!/ Here are two equivalent examples to have Tinker9 configured as follows
55-
!!/
56-
!!/ ======================= ===================
57-
!!/ Item Value
58-
!!/ ======================= ===================
59-
!!/ opt release
60-
!!/ host 0
61-
!!/ prec m
62-
!!/ cuda_dir /usr/local/cuda
63-
!!/ compute_capability 75
64-
!!/ CMakeLists.txt Location /home/tinker9
65-
!!/ ======================= ===================
66-
!!/
67-
!!/ .. code-block:: bash
68-
!!/
69-
!!/ # use environmental variables
70-
!!/ opt=release host=0 prec=m \
71-
!!/ cuda_dir=/usr/local/cuda compute_capability=75 \
72-
!!/ cmake /home/tinker9
73-
!!/
74-
!!/ # use cmake -DOPTIONS
75-
!!/ cmake /home/tinker9 \
76-
!!/ -DCMAKE_BUILD_TYPE=Release -DHOST=0 -DPREC=m \
77-
!!/ -DCUDA_DIR=/usr/local/cuda -DCOMPUTE_CAPABILITY=75
78-
!!/
79-
!!/
8080
]]
8181

8282

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Tinker9: Next Generation of Tinker with GPU Support
1010
Tinker9 is a complete rewrite and extension of the canonical Tinker software, currently Tinker8. Tinker9 is implemented as C++ code with OpenACC directives and CUDA kernels providing excellent performance on GPUs. At present, Tinker9 builds against the object library from Tinker8, and provides GPU versions of the Tinker ANALYZE, BAR, DYNAMIC, MINIMIZE and TESTGRAD programs. Existing Tinker file formats and force field parameter files are fully compatible with Tinker9, and nearly all Tinker8 keywords function identically in Tinker9. Over time we plan to port much or all of the remaining portions of Fortran Tinker8 to the C++ Tinker9 code base.
1111

1212

13-
<h2><a href="https://github.com/TinkerTools/tinker9/discussions/197">
13+
<h2><a href="https://github.com/TinkerTools/tinker9/releases">
1414
Release Notes
1515
</a></h2>
1616

@@ -28,6 +28,7 @@ The executables included in these images were compiled on a recent computer. It
2828
2. [Download the Canonical Tinker (important to get the REQUIRED version)](doc/manual/m/install/tinker.rst)
2929
3. [Build Tinker9 with CMake](doc/manual/m/install/buildwithcmake.rst)
3030

31+
Examples of other successful builds are shown [here](https://github.com/TinkerTools/tinker9/discussions/121).
3132

3233
<h2>User Manual (in progress)</h2>
3334

doc/doc.h

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
*
77
* \defgroup platform Platforms
88
* \brief Platforms and platform-specific syntaxes
9+
*
910
* \defgroup cpp_syntax C++ Syntax
1011
* \ingroup platform
12+
*
1113
* \defgroup cuda_syntax CUDA Syntax
1214
* \ingroup platform
15+
*
1316
* \defgroup acc_syntax OpenACC Syntax
1417
* \ingroup platform
18+
*
1519
* \defgroup nvidia NVIDIA GPU
1620
* \ingroup platform
1721
*
@@ -26,11 +30,37 @@
2630
*
2731
* \defgroup egv Energy
2832
* \brief Energy, gradient, virial tensor, and number of interactions
33+
*
34+
* \defgroup bonded Valence
35+
* \brief Valence potential energies
36+
*
37+
* \defgroup bond Bond
38+
* \ingroup bonded
39+
* \brief Bond stretching
40+
*
41+
* \defgroup angle Angle
42+
* \ingroup bonded
43+
* \brief Angle bending and Out-of-Plane bend
44+
*
45+
* \defgroup strbnd Stretch-Bend
46+
* \ingroup bonded
47+
* \brief Stretch-bend cross term
48+
*
49+
* \defgroup urey Urey-Bradley
50+
* \ingroup bonded
51+
* \brief Urey-Bradley term
52+
*
53+
* \defgroup torsion Torsion
54+
* \ingroup bonded
55+
* \brief Torsion, improper torsion, improper dihedral, Pi-orbital torsion coupling,
56+
* stretch-torsion coupling, angle-torsion coupling, and torsion-torsion coupling
57+
*
58+
* \defgroup geom Restraint
59+
* \ingroup bonded
60+
* \brief Geometric Restraints
2961
*/
3062

3163
/// \defgroup ff Force Fields
32-
/// \defgroup bonded Valence Terms
33-
/// \ingroup ff
3464
/// \defgroup vdw Van der Waals (VDW)
3565
/// \ingroup ff
3666
/// \defgroup charge Partial Charge Electrostatics

doc/manual/m/install/buildwithcmake.rst

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
11
Build Tinker9 with CMake
22
========================
33

4+
Quick Start
5+
-----------
6+
7+
For a GPU card with compute capability 7.0,
8+
an example to compile the GPU code without OpenACC:
9+
10+
.. code-block:: bash
11+
12+
cd tinker9 && mkdir build
13+
FC=gfortran compute_capability=70 gpu_lang=cuda cmake ..
14+
make
15+
make test
16+
17+
Assuming separate CUDA and NVHPC are properly installed,
18+
another example to compile the GPU code with both OpenACC and CUDA:
19+
20+
.. code-block:: bash
21+
22+
cd tinker9 && mkdir build
23+
cmake -DCMAKE_Fortran_COMPILER=gfortran -DCOMPUTE_CAPABILITY=70 ..
24+
make
25+
make test
26+
27+
For the options of other GPU devices and features,
28+
please refer to the subsequent sections.
29+
430
Configure CMake
531
---------------
632
You can skip this section if you are familar with CMake.
733

834
Suppose the current working directory is */home/tinker9* and we
9-
want to create a build directory called *build-cmake* in
10-
*/home/tinker9*. We can do *mkdir build-cmake* then *cd build-cmake*.
35+
want to create a build directory called *build* in
36+
*/home/tinker9*. We can do *mkdir build* then *cd build*.
1137
Because the top-level CMakeLists.txt file is in the parent directory,
1238
if there was nothing else to configure, command *cmake ..* would generate
1339
the Makefile. The alternative way is to specify the build and source
1440
directories to CMake, e.g.,
1541

1642
.. code-block:: bash
1743
18-
cmake -B /home/tinker9/build-cmake -S /home/tinker9
44+
cmake -B /home/tinker9/build -S /home/tinker9
1945
2046
Some CMake installations also provide a command line gui *ccmake* and a
2147
simple gui program *cmake-gui* that can replace *cmake* in the commands
@@ -47,32 +73,6 @@ In addition to these two canonical methods, default value can also be set
4773
by its corresponding environmental variable, documented as **(env)** here.
4874
Note that there is no **-D** prefix for the environmental variables.
4975

50-
Here are two equivalent examples to have Tinker9 configured as follows
51-
52-
======================= ===================
53-
Item Value
54-
======================= ===================
55-
opt release
56-
host 0
57-
prec m
58-
cuda_dir /usr/local/cuda
59-
compute_capability 75
60-
CMakeLists.txt Location /home/tinker9
61-
======================= ===================
62-
63-
.. code-block:: bash
64-
65-
# use environmental variables
66-
opt=release host=0 prec=m \
67-
cuda_dir=/usr/local/cuda compute_capability=75 \
68-
cmake /home/tinker9
69-
70-
# use cmake -DOPTIONS
71-
cmake /home/tinker9 \
72-
-DCMAKE_BUILD_TYPE=Release -DHOST=0 -DPREC=m \
73-
-DCUDA_DIR=/usr/local/cuda -DCOMPUTE_CAPABILITY=75
74-
75-
7676
**-DCMAKE_BUILD_TYPE (opt) = Release**
7777

7878
Standard *CMAKE_BUILD_TYPE* option. Build type is case insensitive and

doc/manual/m/install/preq.rst

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,21 @@ The oldest NVIDIA GPU Tinker9 has been tested on is GeForce GTX 675MX (compute c
88

99
**Operating Systems and Compilers**
1010

11-
In order to compile the GPU code with full functionality, a recent
12-
`NVIDIA HPC SDK <https://www.developer.nvidia.com/hpc-sdk>`_
13-
is preferred for the OpenACC directives. Due to its limitations,
14-
the *full* version is unavailable on macOS.
15-
16-
For Linux, we need:
17-
18-
- GNU or Intel Fortran compiler.
19-
- Recent C++ compiler that supports C++11 syntax.
20-
- CMake 3.15 or newer.
21-
- (GPU code only) NVIDIA HPC SDK with OpenACC support, and CUDA with nvcc.
22-
- If NVIDIA driver has been installed correctly, *nvidia-smi* should be
23-
available.
24-
25-
For Windows, we have successfully built Tinker9 on Windows WSL2 Ubuntu with
26-
CUDA 11.0 and NVHPC 20.9. Please proceed to
27-
`this NVIDIA webpage <https://docs.nvidia.com/cuda/wsl-user-guide/index.html>`_
28-
for more details.
29-
30-
The majority of the functionalities are also implemented in CUDA.
31-
To compile this subset (PureCuda) of the GPU kernels, NVIDIA HPC SDK is not mandatory.
32-
Please refer to *Build Tinker9 with CMake* for the flags to compile
33-
the *PureCuda* GPU kernels.
34-
It is even possible to compile and run the *PureCuda* version on macOS
35-
(El Capitan 10.13 or earlier), if suitable drivers and CUDA toolkits are installed.
36-
If the calculation selects one of the missing functionalities that is only implemented
37-
in OpenACC, the program will throw a runtime error.
11+
================= ===========================
12+
OS and Toolchain Version
13+
================= ===========================
14+
OS Linux, WSL2, macOS <= 10.13
15+
CMake >= 3.15
16+
Fortran GNU or Intel
17+
C++ [a]
18+
CUDA/nvcc [b]
19+
OpenACC/NVHPC/PGI [c]
20+
================= ===========================
21+
22+
- [a] Recent C++ compiler that supports C++11 syntax.
23+
- [b] GPU code only. Version >= 9.0.
24+
- [c] Optional for the GPU code. A recent `NVIDIA HPC SDK <https://www.developer.nvidia.com/hpc-sdk>`_ is preferred.
25+
- [d] We have successfully built Tinker9 on Windows WSL2 Ubuntu with CUDA 11.0 and NVHPC 20.9. Please `check this link <https://docs.nvidia.com/cuda/wsl-user-guide/index.html>`_ for more details.
3826

3927
**Using NVIDIA HPC SDK on Clusters**
4028

doc/manual/m/install/tinker.rst

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
Download the Canonical Tinker
22
=============================
33

4+
Using the incorrect Tinker version, the executables are likely to fail with segfault.
45
Since **d71f4793** (`Dec. 6, 2021 <https://github.com/TinkerTools/tinker9/commit/d71f4793>`_),
56
downloading the required Tinker version is automated in the CMake script.
6-
For versions prior to this commit, please refer to the following paragraphs.
7+
For versions prior to this commit, please refer to the following.
78

8-
**Deprecated 1**
9+
**Deprecated**
910

10-
Using the incorrect Tinker version, the executables would be
11-
very likely to fail with segfault.
11+
If this source code was cloned by Git, you can
12+
checkout Tinker from the *tinker* Git submodule:
1213

13-
If this source code was cloned by Git, you can
14-
checkout Tinker from the *tinker* Git submodule:
14+
.. code-block:: bash
1515
16-
.. code-block:: bash
16+
# checkout Tinker
17+
cd tinker9
18+
git submodule update --init
1719
18-
# checkout Tinker
19-
cd tinker9
20-
git submodule update --init
20+
Alternatively, remove the directory *tinker9/tinker* and clone
21+
`Tinker from GitHub <https://github.com/tinkertools/tinker>`_
22+
to replace the deleted directory,
23+
then checkout the required version **3dc966e2**.
2124

22-
**Deprecated 2**
25+
.. code-block:: bash
2326
24-
Alternatively, remove the directory *tinker9/tinker* and clone
25-
`Tinker from GitHub <https://github.com/tinkertools/tinker>`_
26-
to replace the deleted directory,
27-
then checkout the required version **3dc966e2**.
28-
29-
.. code-block:: bash
30-
31-
cd tinker9
32-
rm -rf tinker
33-
git clone https://github.com/tinkertools/tinker
34-
cd tinker
35-
git checkout <TheRequiredVersion>
27+
cd tinker9
28+
rm -rf tinker
29+
git clone https://github.com/tinkertools/tinker
30+
cd tinker
31+
git checkout <TheRequiredVersion>

0 commit comments

Comments
 (0)