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
Last revisionBoth sides next revision
howto:compile_on_mac [2020/08/21 10:15] – external edit 127.0.0.1howto:compile_on_mac [2022/11/20 15:01] – Delete outdated howto krack
Line 1: Line 1:
-====== How to Compile CP2K on Mac OS X ====== 
- 
-===== 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.txt · Last modified: 2022/11/20 15:05 by krack