exercises:2019_uzh_acpc2:installation
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | exercises:2019_uzh_acpc2:installation [2019/01/25 12:36] – created jglan | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Exercise 0 ====== | ||
+ | |||
+ | In this exercise you will learn how to use the bash terminal, to do a __minimal__ installation of CP2K, which will be used to perform the molecular dynamics simulations, | ||
+ | |||
+ | <note tip> | ||
+ | First of all, you have to make sure that your Windows or Mac machine has the packages required to install CP2K and other software that will be used. | ||
+ | \\ | ||
+ | If your machine is running a Mac OS X, you will need to install XQuartz and XCode. | ||
+ | \\ | ||
+ | If instead it is running on Windows you will need to install Cygwin. | ||
+ | </ | ||
+ | |||
+ | ===== 0.1a Installation of Cygwin on Windows ===== | ||
+ | |||
+ | If your machine is running windows you will need to install Cygwin. [[http:// | ||
+ | |||
+ | For 32 bit Windows execute | ||
+ | |||
+ | For 64 bit Windows [[http:// | ||
+ | |||
+ | When installing Cygwin make sure you install the following additional packages:\\ | ||
+ | *Devel | ||
+ | *“bison” | ||
+ | *“byacc” | ||
+ | *“gcc-fortran” | ||
+ | *“gcc-g++” | ||
+ | *“make” | ||
+ | *Libs | ||
+ | *“lapack” | ||
+ | *“liblapack-devel” | ||
+ | *“liblapack0” | ||
+ | *Python | ||
+ | *Vim\\ | ||
+ | Please operate according to the wizard to finish the Cygwin installation.\\ | ||
+ | |||
+ | ===== 0.1b Installation of XCode and XQuartz | ||
+ | |||
+ | If you are running on a Mac OS X you need to install XCode and XQuartz. | ||
+ | |||
+ | Download and install [[https:// | ||
+ | |||
+ | Also, you need to install XCode from the apple store or from the following link: [[https:// | ||
+ | |||
+ | |||
+ | ===== 0.2 Using the terminal ===== | ||
+ | |||
+ | Throughout this course you will need to use the terminal or command line. Below there' | ||
+ | |||
+ | Let's start with a list of useful commands that you need to use in the terminal environment -- just type them into the command line and confirm with '' | ||
+ | <code bash> | ||
+ | ls # get list of files in the current directory | ||
+ | mkdir MD_course | ||
+ | cd # change into your home directory | ||
+ | cd MD_course | ||
+ | cd .. # go up one directory | ||
+ | pwd # print path to the current working directory | ||
+ | |||
+ | </ | ||
+ | |||
+ | Below you find a command that will open a file using a text editor called vim. You will need to edit input files throughout the course in order to run MD simulations with CP2K. You can use any text editor, vim is one of them. Other text editors, which may be simpler to use, are [[https:// | ||
+ | |||
+ | In this simple example, we will open a new file with '' | ||
+ | |||
+ | <code bash> | ||
+ | vim myfile | ||
+ | </ | ||
+ | |||
+ | Type '' | ||
+ | Now go to normal mode by typing '' | ||
+ | Now copy '' | ||
+ | |||
+ | <code bash> | ||
+ | cp myfile MD_course | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 0.2a CP2K Installation on Windows ===== | ||
+ | |||
+ | Visit [[http:// | ||
+ | Unpack the compressed '' | ||
+ | < | ||
+ | tar -xvf cp2k-2.6.2.tar.bz2 | ||
+ | </ | ||
+ | |||
+ | After the code has been extracted you will find it in the directory '' | ||
+ | |||
+ | In order to compile cp2k one has to specify an arch file to indicate which compilers and libraries to use. | ||
+ | Change directory to '' | ||
+ | |||
+ | Copy the following lines and paste into the newly opened '' | ||
+ | < | ||
+ | CC = cc | ||
+ | CPP = | ||
+ | |||
+ | FC = gfortran | ||
+ | LD = gfortran | ||
+ | |||
+ | AR = ar -r | ||
+ | |||
+ | CPPFLAGS = | ||
+ | DFLAGS | ||
+ | FCFLAGS | ||
+ | LDFLAGS | ||
+ | LIBS = -llapack -lblas | ||
+ | |||
+ | OBJECTS_ARCHITECTURE = machine_gfortran.o | ||
+ | </ | ||
+ | Save this file (again if you use vim type '' | ||
+ | Finally change directory to '' | ||
+ | < | ||
+ | make ARCH=Cygwin-i686-gfortran VERSION=sopt | ||
+ | </ | ||
+ | |||
+ | If you find '' | ||
+ | |||
+ | ===== 0.2b CP2K Installation on Mac OS X ===== | ||
+ | |||
+ | Visit [[http:// | ||
+ | Unpack the compressed '' | ||
+ | < | ||
+ | tar -xvf cp2k-2.6.2.tar.bz2 | ||
+ | </ | ||
+ | |||
+ | After the code has been extracted you will find it in the directory '' | ||
+ | |||
+ | In order to compile cp2k one has to specify an arch file to indicate which compilers and libraries to use. | ||
+ | Change directory to '' | ||
+ | |||
+ | < | ||
+ | CC = gcc | ||
+ | CPP = | ||
+ | FC = gfortran | ||
+ | LD = gfortran | ||
+ | AR = ar -r | ||
+ | RANLIB | ||
+ | DFLAGS | ||
+ | FCFLAGS | ||
+ | | ||
+ | LDFLAGS | ||
+ | LIBS = -framework Accelerate | ||
+ | |||
+ | </ | ||
+ | Save it as '' | ||
+ | Launch the Terminal and change the working directory to '' | ||
+ | < | ||
+ | make ARCH=Darwin-IntelMacintosh-gfortran VERSION=sopt | ||
+ | </ | ||
+ | It may take quite a while until a compilation is completed. | ||
+ | |||
+ | If you find '' | ||
+ | |||
+ | ===== 0.3 First CP2K simulation ===== | ||
+ | It is possible to run cp2k from any directory on your own machine by adding a line to your '' | ||
+ | |||
+ | To do this change to the directory where the '' | ||
+ | To edit the '' | ||
+ | < | ||
+ | vim ~/.bashrc | ||
+ | </ | ||
+ | Add the following line, replacing ''/ | ||
+ | < | ||
+ | export PATH=${PATH}:/ | ||
+ | </ | ||
+ | Save the '' | ||
+ | In the terminal after typing | ||
+ | < | ||
+ | source ~/.bashrc | ||
+ | </ | ||
+ | you can run cp2k from any directory. To do this enter | ||
+ | < | ||
+ | cp2k.sopt --help | ||
+ | </ | ||
+ | |||
+ | Which should give you the output | ||
+ | |||
+ | < | ||
+ | | ||
+ | [-i] < | ||
+ | | ||
+ | [-o] < | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | The easiest way is cp2k.sopt < | ||
+ | |||
+ | The following options can be used: | ||
+ | |||
+ | -i < | ||
+ | argument, the -i flag is not needed | ||
+ | -o < | ||
+ | |||
+ | These switches skip the simulation, unless [-r|-run] is specified: | ||
+ | |||
+ | --check, -c : performs a syntax check of the < | ||
+ | --echo, -e : echos the < | ||
+ | The input is also checked, but only a failure is reported | ||
+ | --help, -h : writes this message | ||
+ | --html-manual | ||
+ | in the current directory. The file index.html is a good | ||
+ | starting point for browsing | ||
+ | --license | ||
+ | --mpi-mapping | ||
+ | --run, -r : forces a CP2K run regardless of other specified flags | ||
+ | --version, -v : prints the CP2K version and the SVN revision number | ||
+ | --xml : dumps the whole CP2K input structure as a XML file | ||
+ | xml2htm generates a HTML manual from this XML file | ||
+ | </ | ||
+ | |||
+ | Now, make a new directory, for instance called '' | ||
+ | < | ||
+ | cp2k.sopt -i argon.inp -o out_ex0.out | ||
+ | </ | ||
+ | You just ran a short Molecular Dynamics trajectory of liquid argon. | ||
+ | |||
+ | |||
+ | ===== 0.4 Visualization with VMD ===== | ||
+ | |||
+ | We will visualize this trajectory with VMD, a molecular visualization program. First of all, download and install VMD for your operating system as indicated [[http:// | ||
+ | |||
+ | Open VMD. From '' | ||
+ | < | ||
+ | pbc set {17.158 17.158 17.158} -all | ||
+ | pbc box | ||
+ | pbc wrap -all | ||
+ | </ | ||
+ | |||
+ | A snapshot of the molecular dynamics trajectory should approximately look like this: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ===== 0.5 Plotting tools ===== | ||
+ | |||
+ | Throughout the course you will also need to plot some graphs. You can use any tool you like for that. '' | ||
exercises/2019_uzh_acpc2/installation.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1