Software:tinkercpu

From biowiki
Jump to navigation Jump to search

CPU code

CPU code is still the reference code (double precision). Also for non periodic system (small/single molecule) you should use CPU code as the tinker9 GPU code only works on PBC boxes. You can use openmp-threads to set multiple CPUs to speed up. The tutorial Tutorial:tinkertut still applies.

User Guide

User guide https://dasher.wustl.edu/tinker/distribution/doc/sphinx/tinker/_build/html/index.html

Prebuilt

You can add the following to your path to use tinker commands (e.g. minimize.x, dynamic.x):

/home/liuchw/Softwares/tinkers/Tinker-latest/source-C8/
/home/liuchw/Softwares/tinkers/Tinker8/2205/source
/home/liuchw/Softwares/tinkers/Tinker9/2204/source (this GPU)

Download and compile source

For Tinker CPU code, download from GitHub: https://github.com/TinkerTools/tinker (git clone recommended)

Then follow the compilation instructions below

Compiling tinker 8 with OpenMP

1. Set up gcc/gfortran or intel ifort v12 or above compiler (set this up in .bashrc or .cshrc). If use intel, for csh add this line is .cshrc and source it

source /opt/intel/composer_xe_2013.2.146/bin/compilervars.csh intel64


Or .bashrc if you use bash:

source /opt/intel/composer_xe_2013.2.146/bin/compilervars.sh intel64

Intel compiled programs perform better than GNU-compiled ones on multiple intel CPU cores. 

2. Compile fftw by following 0README in tinker/fftw/. Use gcc and gfortran or icc and ifort.

3. Compile executables under tinker/source/

You may use the compile.make, library.make and link.make in tinker/linux or tinker/macosx. Copy these 3 files into tinker/source and extecute the 3 on that folder seuqentially. You may need to change the options in the .make files if you have trouble.

You may also use the Makefile provided in tinker/make/

 cd tinker/source
 cp /tinker/make/Makefile tinker/source
  

Modify the top part of Makefile and compiler section (see below).

 make -j 6 all
If you modified Tinker source files, you may also need to update the dependency at the bottom of makefile by running depend.make in source

In the Makefile, define the TINKERDIR and FFTWDIR on the top properly.

F77 = gfortran
F77FLAGS = -c
OPTFLAGS = -O3 -ffast-math -fopenmp
LIBDIR = -L. -L$(TINKER_LIBDIR)/linux
LIBS =
LIBFLAGS = -crusv
RANLIB = ranlib
LINKFLAGS = $(OPTFLAGS) -static-libgcc
RENAME = rename_bin

Or this if you use intel:

F77 = ifort
F77FLAGS = -c -xHost
OPTFLAGS = -O3 -no-ipo -no-prec-div -recursive -openmp
LIBDIR = -L. -L$(TINKER_LIBDIR)/linux
LIBS =  -L$(TINKERDIR)/fftw/lib -lfftw3_threads -lfftw3
LIBFLAGS = -crusv
RANLIB = echo
LINKFLAGS = $(OPTFLAGS) -static-libgcc -static-intel
RENAME = rename_bin

You can also use intel mkl instead of the fftw library above. In Makefile make the following changes (/home/pren/tinker6/source-2014-xz-node/Makefile). You also need to remove any "$(TINKER)/fftw/lib" in the Makefile

F77 = ifort
LIBS = -L/opt/intel/composer_xe_2013/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
F77FLAGS = -c -xHost -assume cc_omp
OPTFLAGS = -O3 -no-ipo -no-prec-div -openmp
LIBFLAGS = -crusv
LINKFLAGS = $(OPTFLAGS)

Tinker on Windows

You may also compile Tinker for Windows Subsystem for Linux (you need to enable this Windows feature and then install ubuntu)

The process is almost the same as a normal Linux machine. 1. preparation

#update apt-get 
sudo apt-get update
#install gfortran 
sudo apt-get install gfortran
#check gfortran 
which gfortran #/usr/bin/gfortran
#check version 
gfortran -v #7.5.0
#install texinfo 
sudo apt-get install texinfo
#check 
which makeinfo #/usr/bin/makeinfo# 

2. Compiling FFTW

# change into fftw folder
cd fftw
  1. read and gollow README file
#configure 
./configure --prefix=/your/prefix/location --enable-openmp --enable-threads
#make && make install 
make -j 8 && make install
#check the $FFTW/lib directory for the existence of the following 
libfftw3.a libfftw3.la libfftw3_omp.a libfftw3_omp.la libfftw3_threads.a libfftw3_threads.la# 

3. compiling Tinker cd ./source

#cop Makefile from tinker/make to tinker/source
#edit Makefile; FFTWDIR should be your prefix in FFTW configuration; use the gfortran block settings 
FFTWDIR = /mnt/c/Users/cheng/Softwares/FFTW/
#make && make install 
make -j 8 && make install
#check the existence of *.x files

Tinker with APBS

Notes created by Rae Corrigan (2020)

https://docs.google.com/document/d/1c2r4DJq20rXc3n15jS-KSh6P6Z9Uz3LT642kB8EG5Ag/edit?usp=sharing