User Tools

Site Tools


howto:compile_on_mac

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:compile_on_mac [2018/04/10 11:00] – [3.Compilation with Cygwin] jglanhowto:compile_on_mac [2022/11/20 15:05] (current) – created krack
Line 1: Line 1:
-====== How to Compile and Install CP2K on Windows with Cygwin ====== +This how-to page has been replaced by [[howto:compile_on_macos|Compile CP2K on macOS]].
- +
-===== 1.Acquiring the code ===== +
-Visit [[https://www.cp2k.org/download|CP2K download page]] and download the source code by any means you prefer.\\ +
-====1.1 Download from Sourceforge ==== +
-If one get the distribution from [[https://sourceforge.net/projects/cp2k/files/|Sourceforge website]], after download cp2k-2.x.x.tar.bz2, unpack the archive files using the command given below +
-<code> +
-tar -xvf cp2k-2.x.x.tar.bz2 +
-</code> +
- +
- +
-==== 1.2 Download using SVN Access ==== +
-<note warning> +
-The code in SVN is under constant development. Check the [[http://dashboard.cp2k.org| Dashboard]] for current issues.  +
-</note> +
- +
-The latest and all prior versions are available from the [[https://sourceforge.net/projects/cp2k/|CP2K SVN repository]].  +
- +
-Check out only a needed branch (the branch will then be in cp2k/cp2k).  +
- +
-  * current trunk: <code>svn checkout http://svn.code.sf.net/p/cp2k/code/trunk cp2k</code> +
- +
-These branches can be updated to their latest version in the following way: +
-<code> +
-cd cp2k/cp2k +
-svn update +
-</code> +
- +
-Alternatively, you may restrict the download to the folder cp2k/cp2k containing source code, tools, and test inputs, e.g. for the trunk version use +
-<code> +
-svn checkout http://svn.code.sf.net/p/cp2k/code/trunk/cp2k cp2k +
-</code> +
-Analogous checkouts work for the branch versions. +
- +
-The [[http://subversion.apache.org/|Subversion]] (svn) program must be installed +
-on your machine for this to work. +
- +
- +
-===== 3.Compilation on Mac ===== +
-An example CP2K ARCH file for a serial build of CP2K on Mac is as follows:\\ +
-<file> +
-# With GCC 4.9 or later, for gcc and gfortran +
-# libxc is installed in LIBXC_INCLUDE_DIR / LIBXC_LIB_DIR +
-# libint is installed in LIBINT_LIB_DIR +
-CC       = gcc +
-CPP      = +
-FC       = gfortran +
-LD       = gfortran +
-AR       = ar -r +
-RANLIB   = ranlib +
-DFLAGS   = -D__NO_STATM_ACCESS -D__ACCELERATE +
-FCFLAGS  = -I $(LIBXC_INCLUDE_DIR) -O2 -ffast-math -funroll-loops \ +
-           -ftree-vectorize -ffree-form $(DFLAGS) +
-LDFLAGS  = $(FCFLAGS) +
-LIBS     = -framework Accelerate +
- +
-</file> +
-Remove the -D__LIBXC -D__LIBINT flag if you compile CP2K. Save it as ''Darwin-IntelMacintosh-gfortran.sopt'' in the ''cp2k-x.x.x/arch'' directory alongside the other ARCH files.\\ +
-Launch the Terminal and change the working directory to ''cp2k-x.x.x/makefiles''. Type make command as follows:\\ +
-<code> +
-make ARCH=Darwin-IntelMacintosh-gfortran VERSION=sopt +
-</code> +
-It may take quite a while until a compilation is completed.  If you have a multi-core machine you may use e.g. ''make -j 4'' to compile in parallel with 4 tasks.\\  +
-If you find ''cp2k.sopt'' in ''cp2k-x.x.x/exe'' directory, then compilation is successfully done. +
howto/compile_on_mac.1523358045.txt.gz · Last modified: 2020/08/21 10:15 (external edit)