From 4841c338fd2456a2d51fcd25594ab73b9af00471 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Wed, 11 Aug 2021 17:55:12 +0100 Subject: [PATCH 1/2] Compilation updates for Apple Silicon --- docs/Compile.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/Compile.rst b/docs/Compile.rst index 03f498470..eb148a542 100644 --- a/docs/Compile.rst +++ b/docs/Compile.rst @@ -338,6 +338,33 @@ from your GCC version and distribute that too, it will fail on older OS X versions.) For this reason, if you plan on distributing DFHack, it is highly recommended to use GCC 4.8 or 7. +Notes for M1 users +------------------ + +Alongside the above, you will need to follow these additional steps to get it +running on Apple silicon. + +Install an x86 copy of ``homebrew`` alongside your existing one. `This +stackoverflow answer ` describes the +process. + +Follow the normal macOS steps to install ``cmake`` and ``gcc`` via your x86 copy of +``homebrew``. + +In your terminal, ensure you have your path set to the correct homebrew in +addition to the normal ``CC`` and ``CXX`` flags above:: + + export PATH=/usr/local/bin:$PATH + +In order to ignore certain warnings present in later versions of ``gcc``, +ensure you pass the following flag to ``cmake``:: + + -DCMAKE_CXX_FLAGS="-fpermissive" + +An example full cmake command:: + + cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX= -DDFHACK_BUILD_ARCH=64 -DCMAKE_CXX_FLAGS="-fpermissive" + .. _osx-setup: Dependencies and system set-up From 71ac76761af1ddb02c1f1096cc929a1a9ae5c9f3 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Sat, 14 Aug 2021 18:15:06 +0100 Subject: [PATCH 2/2] Add underscores as suggested Co-authored-by: Alan --- docs/Compile.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Compile.rst b/docs/Compile.rst index eb148a542..215d421c5 100644 --- a/docs/Compile.rst +++ b/docs/Compile.rst @@ -345,7 +345,7 @@ Alongside the above, you will need to follow these additional steps to get it running on Apple silicon. Install an x86 copy of ``homebrew`` alongside your existing one. `This -stackoverflow answer ` describes the +stackoverflow answer `__ describes the process. Follow the normal macOS steps to install ``cmake`` and ``gcc`` via your x86 copy of