howto:compile_on_windows_with_cygwin
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| howto:compile_on_windows_with_cygwin [2022/09/14 10:04] – alazzaro | howto:compile_on_windows_with_cygwin [2025/09/07 07:07] (current) – [3b LIBINT (optional)] iwao | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <WRAP center round alert 60%> | + | <note tip> |
| - | This page is not supported anymore. | + | Check [[howto: |
| - | </WRAP> | + | </note> |
| - | ====== How to Compile and Install CP2K on Windows with Cygwin ====== | + | ======How to Compile and Install CP2K on Windows with Cygwin====== |
| - | ===== 1.Cygwin | + | I believe there are several ways to build CP2K binaries for Windows. Here I describe how to install Cygwin on Windows 10/11, build CP2K with openmpi on the Cygwin, and run it on a PC without Cygwin.\\ |
| - | [[http:// | + | |
| - | To compile CP2K on Windows, you should | + | |
| - | For 32 bit Windows | + | =====1 |
| - | For 64 bit Windows[[http:// | + | |
| - | When installing Cygwin make sure you install the following additional packages:\\ | + | [[https:// |
| - | *Devel | + | |
| - | *“bison” | + | You can install Cygwin on your 64 bit Windows |
| - | *“byacc” | + | and build cp2k on the Cygwin-Windows |
| - | *“gcc-fortran” | + | |
| - | *“gcc-g++” | + | When installing Cygwin, make sure that you will install the following additional packages:\\ |
| - | *“make” | + | |
| - | *Libs | + | |
| - | *“lapack” | + | |
| - | *“liblapack-devel” | + | |
| - | *“liblapack0” | + | |
| - | *Python\\ | + | |
| - | Please operate according to the wizard to finish the Cygwin installation.\\ | + | |
| - | ===== 2.Acquisition the code ===== | ||
| - | Visit [[http:// | ||
| - | Some archivers generate PaxHeaders.xxxx directories in cp2k-2.x.x directory when unpacking. Files in these directories may prevent CP2K compilation with Cygwin, it is recommended to unpack tar.bz2 by using the following Cygwin command:\\ | ||
| < | < | ||
| - | tar -xvf cp2k-2.x.x.tar.bz2 | + | Archive |
| + | hdf5 | ||
| + | libhdf5-devel | ||
| + | Devel | ||
| + | autoconf | ||
| + | automake | ||
| + | bison | ||
| + | byacc | ||
| + | cmake | ||
| + | gcc-fortran | ||
| + | gcc-g++ | ||
| + | libtool | ||
| + | make | ||
| + | GNOME | ||
| + | libglade | ||
| + | Libs | ||
| + | fftw3 | ||
| + | lapack | ||
| + | libevent-devel | ||
| + | libxerces-c31 | ||
| + | libxerces-c-devel | ||
| + | libfftw3-devel | ||
| + | libfftw3-omp3 | ||
| + | libfftw3_3 | ||
| + | libgsl-devel | ||
| + | libgsl0 | ||
| + | libgsl19 | ||
| + | liblapack-devel | ||
| + | liblapack0 | ||
| + | libopenmpi-devel | ||
| + | libopenmpi12 | ||
| + | libopenmpi40 | ||
| + | libopenmpicxxl | ||
| + | libopenmpifh40 | ||
| + | libopenmpiusef08_40 | ||
| + | libopenmpiusetkr40 | ||
| + | openmpi | ||
| + | zlib | ||
| + | zlib-devel | ||
| + | Python | ||
| + | Math | ||
| + | libopenblas | ||
| + | Science | ||
| + | gsl | ||
| + | Utils | ||
| + | hdf5 | ||
| + | libhdf5-devel | ||
| + | libhwloc-devel | ||
| </ | </ | ||
| - | ===== 3.Compilation | + | Follow the wizard instruction to finish the Cygwin (and packages) installation.\\ |
| - | An ARCH file (a definition | + | |
| + | =====2 Acquire the Code===== | ||
| + | |||
| + | Download a [[https:// | ||
| + | (use the versioned tarballs, `cp2k-X.Y.tar.bz2`) and extract a tarball on the Cygwin64 bash terminal as follows: | ||
| + | |||
| + | < | ||
| + | $ tar -xvf cp2k-X.Y.tar.bz2 | ||
| + | </ | ||
| + | |||
| + | For more details on downloading CP2K, see [[https:// | ||
| + | |||
| + | =====3 | ||
| + | |||
| + | Source codes of most prerequisities are available not only on individual supplyers but also on [[https:// | ||
| + | |||
| + | |||
| + | ====3a scalapack(optional)==== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Rename " | ||
| + | |||
| + | Edit the " | ||
| + | < | ||
| + | # | ||
| + | FCFLAGS | ||
| + | </ | ||
| + | |||
| + | Edit " | ||
| + | < | ||
| + | # | ||
| + | # $(FC) $(NOOPT) -c $*.f | ||
| + | blacstest.o : blacstest.f | ||
| + | $(FC) -c $(FCFLAGS) $*.f | ||
| + | </ | ||
| + | |||
| + | Change the current directory to " | ||
| + | |||
| + | After the " | ||
| + | |||
| + | ====3b LIBINT (optional)==== | ||
| + | Download a CP2K-configured LIBINT library from [[https:// | ||
| + | and extract the archive (e.g." | ||
| + | |||
| + | Change the current directory to the generated libint directory and execute the following commands on Cygwin 64 bash terminal: | ||
| + | |||
| + | < | ||
| + | $ cd libint-v2.6.0-cp2k-lmax-7 | ||
| + | $ ./configure --enable-fortran=yes --with-cxx=gcc | ||
| + | $ make | ||
| + | </ | ||
| + | |||
| + | If you find a static library file " | ||
| + | |||
| + | And then change the current directory to " | ||
| + | |||
| + | < | ||
| + | $ cd fortran | ||
| + | $ make | ||
| + | </ | ||
| + | |||
| + | However this may result in: | ||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | and so on, the " | ||
| + | |||
| + | Copy a generated file " | ||
| + | ("Make install" | ||
| + | |||
| + | In the arch file of CP2K: add < | ||
| + | |||
| + | ====3c LIBXC (optional)==== | ||
| + | The version 7.0.0 of LIBXC can be downloaded from [[https:// | ||
| + | Download and extract " | ||
| + | |||
| + | Autoconf, automake and libtool, which are not installed by default but are required to build LIBXC.\\ | ||
| + | |||
| + | Change the current directory to the " | ||
| + | |||
| + | < | ||
| + | $ cd libxc-7.0.0 | ||
| + | $ export F77=gfortran | ||
| + | $ aclocal | ||
| + | $ autoheader | ||
| + | $ automake -c -a | ||
| + | $ libtoolize -c | ||
| + | $ touch Makefile.in | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch src/ | ||
| + | $ touch testsuite/ | ||
| + | $ touch testsuite/ | ||
| + | $ touch pkgconfig/ | ||
| + | $ touch pylibxc/ | ||
| + | $ touch scripts/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch maple/ | ||
| + | $ touch cmake/ | ||
| + | $ autoconf | ||
| + | $ autoreconf --install | ||
| + | $ ./configure --prefix=/ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | Libxc will be installed into /usr/local/ in this case.\\ | ||
| + | |||
| + | In the arch file of CP2K: add < | ||
| + | |||
| + | ====3d libxsmm(optional)===== | ||
| + | |||
| + | A library for matrix operations and deep learning primitives: [[https:// | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Change the current directory to the " | ||
| + | |||
| + | < | ||
| + | $ make | ||
| + | $ make PREFIX=/ | ||
| + | </ | ||
| + | |||
| + | In the arch file of CP2K: add < | ||
| + | |||
| + | ====3e PEXSI (optional)==== | ||
| + | |||
| + | PEXSI requires parmetis, scotch, CombBLAS_bata, | ||
| + | |||
| + | ===3e1 parmetis=== | ||
| + | |||
| + | Download and extract [[http:// | ||
| + | |||
| + | Cygwin does' | ||
| + | |||
| + | < | ||
| + | / | ||
| + | * This function prints | ||
| + | **************************************************************************/ | ||
| + | void PrintBackTrace() | ||
| + | { | ||
| + | #ifdef HAVE_EXECINFO_H | ||
| + | /* | ||
| + | void *array[10]; | ||
| + | int i, size; | ||
| + | char **strings; | ||
| + | |||
| + | size = backtrace(array, | ||
| + | strings = backtrace_symbols(array, | ||
| + | |||
| + | printf(" | ||
| + | for (i=0; i<size; i++) { | ||
| + | printf(" | ||
| + | } | ||
| + | free(strings); | ||
| + | */ | ||
| + | #endif | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | And then execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ make config | ||
| + | </ | ||
| + | |||
| + | If you find "ld: cannot find -lmpi_cxx" | ||
| + | |||
| + | After "make config", | ||
| + | |||
| + | < | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | Parmetis will be installed into /usr/local/ by default.\\ | ||
| + | If you have an error during the " | ||
| + | |||
| + | ===3e2 scotch=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | (It looks like [[https:// | ||
| + | |||
| + | Copy " | ||
| + | |||
| + | Add " | ||
| + | |||
| + | < | ||
| + | CFLAGS = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -DINTSIZE64 -DIDXSIZE64 -DOMPI_BUILDING | ||
| + | </ | ||
| + | |||
| + | And then execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd scotch_6.0.0/ | ||
| + | $ make ptscotch | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | ===3e3 | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Edit " | ||
| + | |||
| + | < | ||
| + | ADD_SUBDIRECTORY( usort ) | ||
| + | target_link_libraries(CombBLAS PUBLIC Usortlib) | ||
| + | |||
| + | ADD_SUBDIRECTORY( graph500-1.2/ | ||
| + | target_link_libraries(CombBLAS PUBLIC GraphGenlib) | ||
| + | |||
| + | # add new | ||
| + | SET(CMAKE_EXE_LINKER_FLAGS | ||
| + | #end add new | ||
| + | |||
| + | # Set up exported configuration | ||
| + | # This allows CombBLAS to be installed in two ways: | ||
| + | # 1. In /usr/local (or whatever prefix is specified) | ||
| + | # 2. Exporting the current build directory. This allows a user to make | ||
| + | # modifications to CombBLAS and have the changes automatically recompiled for | ||
| + | # dependent projects. | ||
| + | # Either way, we need to create a CombBLASConfig.cmake | ||
| + | </ | ||
| + | |||
| + | And then execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd CombBLAS_beta_16_2 | ||
| + | $ mkdir build | ||
| + | $ mkdir install | ||
| + | $ cd build | ||
| + | $ cmake .. -DCMAKE_INSTALL_PREFIX=../ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | ===3e4 upcxx=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ ./install / | ||
| + | </ | ||
| + | |||
| + | The successful installation will display "UPC++ successfully installed" | ||
| + | |||
| + | ===3e5 symPACK=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd symPACK-2.0.1 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ | ||
| + | </ | ||
| + | |||
| + | ===3e6 superLU_dist=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd SuperLU_DIST_6.1.0 | ||
| + | $ export PARMETIS_ROOT=/ | ||
| + | $ export PARMETIS_BUILD_DIR=${HOME}/ | ||
| + | $ export COMBBLAS_ROOT=/ | ||
| + | $ export COMBBLAS_BUILD_DIR=${HOME}/ | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake .. \ | ||
| + | -DTPL_PARMETIS_INCLUDE_DIRS="/ | ||
| + | -DTPL_PARMETIS_LIBRARIES="/ | ||
| + | -DCMAKE_INSTALL_PREFIX=/ | ||
| + | </ | ||
| + | |||
| + | Edit the following generated files after cmake and add the " | ||
| + | |||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | *build/ | ||
| + | |||
| + | For example: | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | < | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | SuperLU_DIST will be installed into /usr/local/ by default.\\ | ||
| + | |||
| + | |||
| + | ===3e7 PEXSI=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd pexsi_v1.2.0 | ||
| + | $ mkdir build | ||
| + | </ | ||
| + | |||
| + | Copy config/ | ||
| + | |||
| + | < | ||
| + | $ cp config/ | ||
| + | $ mv build/ | ||
| + | </ | ||
| + | |||
| + | Edit the content of " | ||
| + | |||
| + | < | ||
| + | CC=mpicc | ||
| + | CXX=mpicxx | ||
| + | FC=mpif90 | ||
| + | PEXSI_INSTALL_DIR=/ | ||
| + | BLAS_LIB=/ | ||
| + | LAPACK_LIB=/ | ||
| + | DSUPERLU_DIR=/ | ||
| + | PARMETIS_DIR=/ | ||
| + | METIS_DIR=/ | ||
| + | GFORTRAN_LIB=/ | ||
| + | |||
| + | cmake \ | ||
| + | -DCMAKE_INSTALL_PREFIX=$PEXSI_INSTALL_DIR \ | ||
| + | -DCMAKE_C_COMPILER=$CC \ | ||
| + | -DCMAKE_CXX_COMPILER=$CXX \ | ||
| + | -DCMAKE_CXX_FLAGS=-DOMPI_BUILDING \ | ||
| + | -DCMAKE_Fortran_COMPILER=$FC \ | ||
| + | -Dlinalg_BLAS_LIBRARIES=" | ||
| + | -Dlinalg_LAPACK_LIBRARIES=" | ||
| + | -Dsuperlu_dist_INCLUDE_DIR=$DSUPERLU_DIR/ | ||
| + | -Dsuperlu_dist_LIBRARIES=$DSUPERLU_DIR/ | ||
| + | -Dmetis_INCLUDE_DIR=$METIS_DIR/ | ||
| + | -Dmetis_LIBRARIES=$METIS_DIR/ | ||
| + | -Dparmetis_INCLUDE_DIR=$PARMETIS_DIR/ | ||
| + | -Dparmetis_LIBRARIES=$PARMETIS_DIR/ | ||
| + | .. | ||
| + | |||
| + | </ | ||
| + | |||
| + | Execute the following commands: | ||
| + | < | ||
| + | $ ./ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | The "make install" | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | Add < | ||
| + | |||
| + | ====3f QUIP (optional)=== | ||
| + | |||
| + | Download " | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd QUIP-b4336484fb65b0e73211a8f920ae4361c7c353fd | ||
| + | $ export QUIP_ARCH=linux_x86_64_gfortran | ||
| + | $ make config | ||
| + | </ | ||
| + | |||
| + | In the following "make config" | ||
| + | |||
| + | < | ||
| + | Using QUIP_ARCH=linux_x86_64_gfortran, | ||
| + | |||
| + | In the following, hit enter to accept the defaults. | ||
| + | |||
| + | |||
| + | BUILD OPTIONS | ||
| + | ============= | ||
| + | |||
| + | |||
| + | Please enter the linking options for LAPACK and BLAS libraries: | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter the preferred python command: | ||
| + | | ||
| + | / | ||
| + | |||
| + | Please enter the preferred pip command: | ||
| + | | ||
| + | / | ||
| + | |||
| + | Please enter any other extra linking options: | ||
| + | | ||
| + | |||
| + | |||
| + | OPTIONAL INTERNAL FEATURES | ||
| + | ========================== | ||
| + | |||
| + | |||
| + | Would you like to compile with CP2K support? [y/n] | ||
| + | | ||
| + | y | ||
| + | |||
| + | Would you like to compile with VASP support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with Tight Binding (TB) support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with preconditioned minimisation support? (not working with Intel compiler) [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with Learn-on-the-fly (LOTF) support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with ONIOM support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with LOCAL_E_MIX support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Would you like to compile with QuasiContinuum wrapper support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | OPTIONAL FEATURES (EXTRA CODE REQUIRED) | ||
| + | ======================================= | ||
| + | |||
| + | |||
| + | Would you like to compile with GAP support ? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | Please enter directories where the Turbo-GAP main directory is: | ||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | Would you like to turn on QR decomposition for some GAP operations? [y/n] | ||
| + | | ||
| + | |||
| + | Checking for ThirdParty directory... | ||
| + | Not found. | ||
| + | |||
| + | Would you like to compile with TTM3-F support? [y/n] | ||
| + | | ||
| + | |||
| + | Would you like to compile with SCME support ? [y/n] | ||
| + | | ||
| + | |||
| + | Would you like to compile with MTP support ? [y/n] | ||
| + | | ||
| + | |||
| + | Would you like to compile with many-body dispersion support ? [y/n] | ||
| + | | ||
| + | |||
| + | Would you like to compile with TTM_NF support ? [y/n] | ||
| + | | ||
| + | |||
| + | Would you like to compile with CH4 support ? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | OPTIONAL EXTERNAL LIBRARIES | ||
| + | =========================== | ||
| + | |||
| + | Would you like to compile with NetCDF4 support? [y/n] | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter directories where MDCORE libraries are kept: | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter directory where the ASAP library is kept: | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter directories where CGAL libraries are kept: | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter directories where METIS libraries are kept: | ||
| + | | ||
| + | |||
| + | |||
| + | Please enter directories where LMTO_TBE libraries are kept: | ||
| + | | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | After "make config", | ||
| + | < | ||
| + | $ make | ||
| + | $ export QUIP_INSTALLDIR=/ | ||
| + | $ make install | ||
| + | $ make libquip | ||
| + | </ | ||
| + | |||
| + | If you find " | ||
| + | Copy " | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | |||
| + | ====3g spfft(optional)==== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd spFFT-1.0.5 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DSPFFT_FORTRAN=ON -DSPFFT_OMP=ON -DSPFFT_MPI=ON -DSPFFT_SINGLE_PRECISION=OFF -DCMAKE_INSTALL_PREFIX=/ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | ====3h spla(optional)==== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd spla-1.5.2 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake .. -DCMAKE_INSTALL_PREFIX=/ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | ====3i SIRIUS (optional)==== | ||
| + | |||
| + | SIRIUS-7.3.0 requires spglib-1.0.2 or later and gsl 2.7 or later.\\ | ||
| + | |||
| + | ===3i1 spglib=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd spglib-1.16.2 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake .. | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | The "make install" | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | |||
| + | ===3i2 gsl 2.7=== | ||
| + | |||
| + | If you have the following gsl-related error during building sirius (i.e. " | ||
| + | |||
| + | < | ||
| + | sirius-7.3.0/ | ||
| + | 31 | #include < | ||
| + | | ^~~~~~~~~~~~~~~~~~~~~~ | ||
| + | compilation terminated. | ||
| + | </ | ||
| + | |||
| + | Gsl 2.7 or later is required in this case. If Cygwin setup.exe does't supply the latest binary, you had better build the gsl from the source.\\ | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd gsl-2.7 | ||
| + | $ ./ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | The "make install" | ||
| + | |||
| + | ===3i3 SIRIUS=== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd sirius-7.3.0 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ export CXX=mpicxx CC=mpicc FC=mpif90 | ||
| + | $ cmake .. -DCMAKE_INSTALL_PREFIX=/ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | If you have a link error "ld: smearing.cpp: | ||
| + | the error is caused by your own built gsl which installed into " | ||
| + | Edit " | ||
| + | |||
| + | < | ||
| + | / | ||
| + | ... | ||
| + | CMakeFiles/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | Edit the cp2k code, " | ||
| + | |||
| + | < | ||
| + | | ||
| + | ! brhr editted | ||
| + | ! CALL sirius_initialize(.FALSE.) | ||
| + | CALL sirius_initialize(.TRUE.) | ||
| + | ! end brhr editted | ||
| + | END SUBROUTINE cp_sirius_init | ||
| + | </ | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | |||
| + | ====3j Libvori (optional)==== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd libvori-220621 | ||
| + | $ mkdir build | ||
| + | $ cd build | ||
| + | $ cmake -DCMAKE_CXX_COMPILER=g++ .. | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | The "make install" | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | |||
| + | ====3k libvdwxc (optional)==== | ||
| + | |||
| + | Download and extract [[https:// | ||
| + | |||
| + | Execute the following commands on the Cygwin terminal: | ||
| + | |||
| + | < | ||
| + | $ cd libvdwxc-0.4.0 | ||
| + | $ ./ | ||
| + | $ make | ||
| + | $ make install | ||
| + | </ | ||
| + | |||
| + | The "make install" | ||
| + | |||
| + | In the arch file of CP2K: Add < | ||
| + | |||
| + | =====4 Compile CP2K with Cygwin===== | ||
| + | |||
| + | Prepare a arch file. The following is an example with all options. \\ | ||
| < | < | ||
| - | CC = cc | + | # Put this file on cp2k-2022.1/ |
| - | CPP | + | # make ARCH=Cygwin-x86_64-gfortran VERSION=ssmp |
| - | FC | + | # if you wish to clean, do either make ARCH=Cygwin-x86_64-gfortran VERSION=ssmp clean |
| - | LD | + | # or make ARCH=Cygwin-x86_64-gfortran VERSION=ssmp distclean |
| + | |||
| + | CC = gcc | ||
| + | FC | ||
| + | LD | ||
| AR = ar -r | AR = ar -r | ||
| + | |||
| + | CFLAGS = -g -O2 -fopenmp | ||
| + | |||
| CPPFLAGS = | CPPFLAGS = | ||
| - | DFLAGS | + | |
| - | FCFLAGS | + | DFLAGS |
| - | LDFLAGS | + | DFLAGS += -D__LIBXSMM |
| - | LIBS | + | |
| + | FCFLAGS | ||
| + | FCFLAGS += -fbacktrace -std=f2008 -Wl, | ||
| + | FCFLAGS += -I/ | ||
| + | FCFLAGS += -I/ | ||
| + | |||
| + | LDFLAGS | ||
| + | |||
| + | |||
| + | LIBS = | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | LIBS | ||
| + | |||
| + | OBJECTS_ARCHITECTURE = machine_gfortran.o | ||
| </ | </ | ||
| - | Save as “Cygwin-i686-gfortran.sopt” on cp2k-2.x.x/ | + | |
| - | Launch the Cygwin Terminal | + | Save the arch file in the ARCH directory with the name e.g. "Cygwin-x86_64-gfortran.ssmp"\\ |
| + | |||
| + | Prepare three nested empty destination directories | ||
| + | |||
| + | Put some required FORTRAN modules in the inner-most ssmp directory | ||
| + | |||
| + | These are:\\ | ||
| + | |||
| + | *libint-v2.6.0-cp2k-lmax-7/ | ||
| + | *libxc-5.1.0/ | ||
| + | *libxc-5.1.0/ | ||
| + | *sirius-7.3.0/ | ||
| + | *pexsi_v1.2.0/ | ||
| + | *QUIP-b4336484fb65b0e73211a8f920ae4361c7c353fd/build/ | ||
| + | |||
| + | Execute the "make" commands on the root directory of cp2k on the Cygwin terminal:\\ | ||
| < | < | ||
| - | make ARCH=Cygwin-i686-gfortran VERSION=sopt | + | $ make ARCH=Cygwin-x86_64-gfortran VERSION=ssmp |
| </ | </ | ||
| - | It may take 1 or 2 hours until a compilation is completed.\\ | ||
| - | If you find cp2k.sopt in cp2k-2.x.x/ | ||
| - | ===== 4.Installation | + | When the " |
| - | By using either cygcheck command or an executable parser such as [[http:// | + | |
| - | The following six DLLs are maybe necessary | + | =====5 Install |
| - | | + | |
| - | | + | ====5a The file placement==== |
| - | *cygwin\bin\cyggfortran-3.dll | + | Prepare a empty directory named "cp2k-(version string or a unique string to descriminate your build)" on which you wish to install |
| - | *cygwin\bin\cygquadmath-0.dll | + | |
| - | *cygwin\bin\cyggcc_s-1.dll | + | Prepare five empty directories, |
| - | *cygwin\lib\lapack\cyglapack-0.dll | + | |
| - | Copy these DLLs (except Windows system DLLs) to the cp2k.sopt directory.(Consequently these DLLs and cp2k.sopt are located on a same directory.)\\ | + | Copy cp2k binaries which were generated in "(cp2k-root)/ |
| - | Pressing SHIFT key right-click cp2k.sopt directory | + | Copy other DLLs in "(cygwin-root)/ |
| - | And you type on the command | + | |
| - | < | + | The dependent DLLs will vary depending |
| - | Then you might see: | + | You can parse the dependencies by using either cygcheck |
| + | |||
| + | The following is an example of dependent DLLs with all options:\\ | ||
| < | < | ||
| - | CP2K version | + | (cygwin-root)/ |
| - | SVN source code revision svn:XXXXX | + | (cygwin-root)/ |
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| </ | </ | ||
| - | Congratulations! You got a hold of CP2K run on Windows. | + | |
| + | Copy also the opemmpi executables into the " | ||
| + | < | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | (cygwin-root)/ | ||
| + | </ | ||
| + | |||
| + | Prepare an empty directory named " | ||
| + | |||
| + | Copy the cp2k data directory into the inside of " | ||
| + | For example, if you built cp2k in " | ||
| + | |||
| + | Prepare a empty directory named " | ||
| + | copy " | ||
| + | |||
| + | Copy openmpi help files (the folder and the all contents of (cygwin-root)/ | ||
| + | |||
| + | ====5b A batch script file==== | ||
| + | Prepare a batch script to launch the cp2k calculations in the upper directory of the " | ||
| + | |||
| + | < | ||
| + | @echo off | ||
| + | set ORGPATH=%PATH% | ||
| + | set PATH=%PATH%; | ||
| + | set OPAL_PREFIX=%CD% | ||
| + | set PMIX_MCA_gds=hash | ||
| + | cp2k.ssmp %* | ||
| + | set PATH=%ORGPATH% | ||
| + | set OPAL_PREFIX= | ||
| + | set PMIX_MCA_gds= | ||
| + | </ | ||
| + | |||
| + | The statement "set ORGPATH=%PATH%" | ||
| + | The statement "set PATH=%PATH%; | ||
| + | The statement " | ||
| + | The statement "set PMIX_MCA_gds=hash" | ||
| + | The statement " | ||
| + | The set statements after " | ||
| + | |||
| + | For details on openmpi environmental variables, please refer to: | ||
| + | [[https:// | ||
| + | |||
| + | Save the script as the name " | ||
| + | |||
| + | ====5c A quick test==== | ||
| + | Open the folder which contains startcp2k.bat and " | ||
| + | Enter " | ||
| + | |||
| + | On the command prompt, execute the following command: | ||
| + | < | ||
| + | $ startcp2k --version | ||
| + | </ | ||
| + | |||
| + | Then you might see:\\ | ||
| + | < | ||
| + | CP2K version 2022.1 | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | -cpp -I / | ||
| + | | ||
| + | | ||
| + | rt/ -I / | ||
| + | | ||
| + | | ||
| + | / | ||
| + | | ||
| + | __SPGLIB -D __SIRIUS -D __LIBVDWXC -D __LIBXSMM -D __LIBPEXSI -D __ | ||
| + | QUIP -D __LIBVORI -D __COMPILE_ARCH=" | ||
| + | D __COMPILE_DATE=" | ||
| + | | ||
| + | | ||
| + | | ||
| + | -mavx -mavx2 -mno-sse4a -mno-fma4 -mno-xop -mfma -mno-avx512f -mbmi | ||
| + | -mbmi2 -mno-aes -mpclmul -mno-avx512vl -mno-avx512bw -mno-avx512dq | ||
| + | | ||
| + | 2ifma -mno-avx5124vnniw -mno-avx5124fmaps -mno-avx512vpopcntdq -mno- | ||
| + | | ||
| + | alg -mno-avx512bf16 -mno-avx512vp2intersect -mno-3dnow -madx -mabm - | ||
| + | | ||
| + | mf16c -mfsgsbase -mfxsr -mno-hle -msahf -mno-lwp -mlzcnt -mmovbe -mn | ||
| + | | ||
| + | | ||
| + | | ||
| + | vaes -mno-waitpkg -mno-wbnoinvd -mxsave -mxsavec -mxsaveopt -mxsaves | ||
| + | -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-uintr -mno-hreset -m | ||
| + | no-kl -mno-widekl -mno-avxvnni --param=l1-cache-size=32 --param=l1-c | ||
| + | | ||
| + | | ||
| + | r -fbacktrace -fopenmp -fopenmp-simd -funroll-loops -ftree-vectorize | ||
| + | </ | ||
| + | |||
| + | Congratulations! You got a hold of CP2K run on Windows.\\ | ||
howto/compile_on_windows_with_cygwin.1663149886.txt.gz · Last modified: by alazzaro
