User Tools

Site Tools


howto:compile_on_macos

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_macos [2023/12/01 14:08] krackhowto:compile_on_macos [2024/01/24 13:35] (current) – Add check krack
Line 2: Line 2:
  
 This page describes how CP2K can be installed under [[https://en.wikipedia.org/wiki/MacOS|macOS]] ([[https://en.wikipedia.org/wiki/MacOS_Monterey|Monterey]], [[https://en.wikipedia.org/wiki/MacOS_Ventura|Ventura]], and [[https://en.wikipedia.org/wiki/MacOS_Sonoma|Sonoma]] This page describes how CP2K can be installed under [[https://en.wikipedia.org/wiki/MacOS|macOS]] ([[https://en.wikipedia.org/wiki/MacOS_Monterey|Monterey]], [[https://en.wikipedia.org/wiki/MacOS_Ventura|Ventura]], and [[https://en.wikipedia.org/wiki/MacOS_Sonoma|Sonoma]]
-). This howto has last been tested on an Apple M1 under macOS Sonoma 14.1.1 (Darwin Kernel Version 23.1.0, Homebrew 4.1.22). For further details check the corresponding Darwin-gnu-arm64 [[https://github.com/cp2k/cp2k/blob/master/arch/Darwin-gnu-arm64.psmp|arch file]] and [[https://dashboard.cp2k.org/archive/darwin-gnu-arm64-psmp/index.html|regression tester]]. This howto assumes that your default shell is ''bash''.+). This howto has last been tested on an Apple M1 under macOS Sonoma 14.(Darwin Kernel Version 23.3.0, Homebrew 4.2.5). For further details check the corresponding Darwin-gnu-arm64 [[https://github.com/cp2k/cp2k/blob/master/arch/Darwin-gnu-arm64.psmp|arch file]] and [[https://dashboard.cp2k.org/archive/darwin-gnu-arm64-psmp/index.html|regression tester]]. This howto assumes that your default shell is ''bash''.
  
 ==== 1. Install Homebrew ==== ==== 1. Install Homebrew ====
Line 10: Line 10:
 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
 </code> </code>
-which will install the latest Homebrew version. This howto was tested with Homebrew 3.6.11 as well as with newer versions up to 4.0.19.+which will install the latest Homebrew version. This howto was tested with Homebrew 3.6.11 as well as with newer versions up to 4.2.5.
  
 === a) The easy way === === a) The easy way ===
Line 22: Line 22:
 === b) Compile CP2K under macOS from scratch === === b) Compile CP2K under macOS from scratch ===
  
-If you installed CP2K with ''brew'' in the previous step, then make sure that you first uninstall ''cp2k'' and unlink its dependencies ''open-mpi'' and ''scalapack'',+For best performance or code development, it is recommended to install CP2K from scratch. If you installed already CP2K with ''brew'' as described in the previous section, then make sure that you first uninstall ''cp2k'' and unlink its dependencies ''open-mpi'' and ''scalapack'',
 e.g. with e.g. with
 <code> <code>
Line 36: Line 36:
 ln -s /opt/homebrew/bin/gfortran-13 /opt/homebrew/bin/gfortran ln -s /opt/homebrew/bin/gfortran-13 /opt/homebrew/bin/gfortran
 </code> </code>
-to make Homebrew's latest ''gcc'' and ''g++'' compilers the default instead of the clang versions in ''/usr/bin''.+to make Homebrew's latest ''gcc'' and ''g++'' compilers the default instead of the clang versions in ''/usr/bin''. Check with 
 +<code> 
 +gcc -v 
 +</code> 
 +if that is the case.
  
 ==== 2. Obtain CP2K ==== ==== 2. Obtain CP2K ====
howto/compile_on_macos.1701439695.txt.gz · Last modified: 2023/12/01 14:08 by krack