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/16 12:08] gtoccihowto:compile_on_mac [2022/11/20 15:05] (current) – created krack
Line 1: Line 1:
-====== How to Compile CP2K on Mac OS X ====== +This how-to page has been replaced by [[howto:compile_on_macos|Compile CP2K on macOS]].
- +
-===== 1.Acquiring the code ===== +
- +
-If you don't have it already, you need an X11 server. Download and install [[https://www.xquartz.org/|XQuartz]]. +
- +
- +
-After that, go to the [[https://sourceforge.net/projects/cp2k/files/|Sourceforge website]], and download the 2.6.2 version of cp2k.  +
- +
-Using the Mac terminal, go to the directory where cp2k has been downloaded (if it has been downloaded in the ''Downloads'' directory type  ''cd ~/Downloads''). +
-To unpack the archive files type the command given below +
-<code> +
-tar -xvf cp2k-2.6.2.tar.bz2 +
-</code> +
- +
- +
-===== 2.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-2.6.2/arch'' directory alongside the other ARCH files.\\ +
-Launch the Terminal and change the working directory to ''cp2k-2.6.2/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-2.6.2/exe'' directory, then compilation is successfully done. +
howto/compile_on_mac.1523880505.txt.gz · Last modified: 2020/08/21 10:15 (external edit)