User Tools

Site Tools


howto:compile_on_windows_with_cygwin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
howto:compile_on_windows_with_cygwin [2019/04/23 18:02] – [3.Compilation with Cygwin] 89.132.74.35howto:compile_on_windows_with_cygwin [2019/04/30 20:57] – old revision restored oschuett
Line 17: Line 17:
       *“liblapack-devel”       *“liblapack-devel”
       *“liblapack0”       *“liblapack0”
-  *Python +  *Python\\
-  *Vim\\+
 Please operate according to the wizard to finish the Cygwin installation.\\ Please operate according to the wizard to finish the Cygwin installation.\\
  
-===== 2.Acquiring the code ===== +===== 2.Acquisition the code ===== 
-Visit [[http://sourceforge.net/projects/cp2k/files/|sourceforge CP2K project page]] and download any of ''cp2k-2.x.x.tar.bz2''.\\ +Visit [[http://sourceforge.net/projects/cp2k/files/|sourceforge CP2K project page]] and download any of cp2k-2.x.x.tar.bz2.\\ 
-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 command from within a Cygwin terminal:\\+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:\\
 <code> <code>
 tar -xvf cp2k-2.x.x.tar.bz2 tar -xvf cp2k-2.x.x.tar.bz2
 </code> </code>
  
 +===== 3.Compilation with Cygwin ===== 
 +An ARCH file (a definition file) for Cygwin is as follows:\\ 
 +<file>
 CC       = cc CC       = cc
 CPP      =  CPP      = 
- 
 FC       = gfortran FC       = gfortran
 LD       = gfortran LD       = gfortran
- 
 AR       = ar -r AR       = ar -r
- 
 CPPFLAGS =  CPPFLAGS = 
-DFLAGS   -D__GFORTRAN -D__FFTSG +DFLAGS   = -D__FFTSG 
-FCFLAGS -g -O2 -ffast-math -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS) +FCFLAGS  = -O2 -ffast-math -funroll-loops -ftree-vectorize -ffree-form $(DFLAGS) 
 LDFLAGS  = $(FCFLAGS)  LDFLAGS  = $(FCFLAGS) 
-LIBS     = -llapack -lblas +LIBS      -llapack lblas 
- +</file> 
-OBJECTS_ARCHITECTURE machine_gfortran.o+Save as “Cygwin-i686-gfortran.sopt” on cp2k-2.x.x/arch directory as similar to other ARCH files.\\ 
 +Launch the Cygwin Terminal (Cygwin bash) and change the working directory to cp2k-2.x.x/makefiles directory. Type make command as follows:\\ 
 +<code> 
 +make ARCH=Cygwin-i686-gfortran VERSION=sopt 
 +</code> 
 +It may take 1 or 2 hours until a compilation is completed.\\  
 +If you find cp2k.sopt in cp2k-2.x.x/exe directory, the compilation is successfully done.
  
 ===== 4.Installation CP2K on Windows PC which not installed Cygwin ===== ===== 4.Installation CP2K on Windows PC which not installed Cygwin =====
-By using either cygcheck command (cygcheck /home/user/(cp2k directory)/exe/(ARCH directory)/cp2k.sopt) or an executable parser such as  [[http://www.dependencywalker.com|Dependency Walker (depends.exe)]], you can find DLLs that the built cp2k.sopt depends on.\\ +By using either cygcheck command or an executable parser such as  [[http://www.dependencywalker.com|Dependency Walker (depends.exe)]], you can find DLLs where the built cp2k.sopt depends on.\\ 
-The following six DLLs may be required to run the cp2k.sopt without Cygwin installation, but it may differ on your system.(Windows system modules are unnecessary here)\\+The following six DLLs are maybe necessary and sufficient to run the cp2k.sopt without Cygwin installation, but it may differ on your system.(Windows system modules are unnecessary here)\\
   *cygwin\lib\lapack\cygblas-0.dll   *cygwin\lib\lapack\cygblas-0.dll
   *cygwin\bin\cygwin1.dll   *cygwin\bin\cygwin1.dll
Line 54: Line 58:
   *cygwin\bin\cyggcc_s-1.dll   *cygwin\bin\cyggcc_s-1.dll
   *cygwin\lib\lapack\cyglapack-0.dll   *cygwin\lib\lapack\cyglapack-0.dll
-Copy these DLLs (except Windows system DLLs) to the same directory as ''cp2k.sopt''.\\ +Copy these DLLs (except Windows system DLLs) to the cp2k.sopt directory.(Consequently these DLLs and cp2k.sopt are located on a same directory.)\\ 
-Pressing SHIFT key right-click ''cp2k.sopt'' directory icon and select “Open Command Window Here” menu.\\+Pressing SHIFT key right-click cp2k.sopt directory icon and select “Open Command Window Here” menu.\\
 And you type on the command prompt: And you type on the command prompt:
 <code> > cp2k.sopt --version</code> <code> > cp2k.sopt --version</code>
Line 63: Line 67:
 SVN source code revision svn:XXXXX SVN source code revision svn:XXXXX
 </code> </code>
-Congratulations! You can now run CP2K on Windows.+Congratulations! You got a hold of CP2K run on Windows.
  
howto/compile_on_windows_with_cygwin.txt · Last modified: 2023/12/01 00:25 by krack