TinkerTools / tinker9

Tinker9: Next Generation of Tinker with GPU Support
Other
48 stars 26 forks source link

Installation issue #207

Closed Maxim-93 closed 1 year ago

Maxim-93 commented 1 year ago

Initially ran the following: cmake -B /home/tinker9-1.3.0/build -S /home/tinker9-1.3.0

which gave this error:

CMake Error at CMakeLists.txt:408 (find_program):
  Could not find T9_ACC_COMPILER using the following names: nvc++, pgc++

As this was an issue with the compiler (and given that in the Tinker9 installation instructions, it's specified that both CUDA and NVHPC is needed for one of the next steps), I installed NVHPC as I already have CUDA installed.

This then led to the following error message when rerunning the above command:

- Could NOT find Git (missing: GIT_EXECUTABLE) 
CMake Error at ext/interface/CMakeLists.txt:536 (message):
  Must use a GNU or Intel Fortran compiler; Please export
  FC=valid_fortran_compiler; NVHPC is not supported.

Also, running the following: FC=gfortran compute_capability=70 gpu_lang=cuda cmake ..

-- Could NOT find Git (missing: GIT_EXECUTABLE) 
-- Could NOT find Catch2 (missing: Catch2_DIR)
CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2882 (message):
  No download info given for 'BuildCatch2' and its source directory:

   /home/epstein/tinker9-1.3.0/ext/ext/catch2v3

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3716 (_ep_add_download_command)
  test/CMakeLists.txt:14 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!

Not entirely sure how to proceed here.

zhi-wang commented 1 year ago

This may surprise you, and I was surprised too when I found the problem. You must have downloaded the tarball or the zip file directly from the release page, both of which lack the git submodule info that are normally included in the git clone. The bigger surprise to me is that people have been complaining about it since 2012...

If you don't want to clone the entire git repo, I'd recommend the following command

git clone --depth 1 --branch v1.3.0 https://github.com/tinkertools/tinker9

Also, I believe that tinker9 no longer requires nvhpc if gpu_lang=cuda is used in your CMake config.

Maxim-93 commented 1 year ago

Right that seems to have done the trick! For the sake of other users, I did the following:

git clone --depth 1 --branch v1.3.0 https://github.com/tinkertools/tinker9
cd tinker9 && mkdir build
cd build
cmake -DCMAKE_Fortran_COMPILER=gfortran -DCOMPUTE_CAPABILITY=70 ..
make
make test

Additional info: My OS is Ubuntu 22.04 and I have cuda in my .bashrc as:

export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}

Thanks again!