Skip to content

Commit

Permalink
Set Mac OS minimal version down to 10.7
Browse files Browse the repository at this point in the history
Stockfish can be compiled and run on older Mac provided we install a recent
compiler on them, so we set down the macosx-version-min flag in the Makefile
from 10.14 back to 10.7.

Note: To compile Stockfish, you need a compiler with decent c++17 support.
In recent Macs, it is possible to use the Clang compiler provided by Apple, but
on older Macs it may be necessary to install a recent GNU compiler instead to
get the c++17 support. We have tested the following method to install gcc10 on
machines running Mac OS 10.7, Mac OS 10.9 and Mac OS 10.13:

1) install XCode for your machine.

2) install Apple command-line developer tools for XCode, by typing the following
   command in a Terminal:

```
      sudo xcode-select --install
```

3) go to the Stockfish "src", then try a default build and run Stockfish:

```
      make clean
      make build
      make net
      ./stockfish
```

4) if step 3 worked, congrats! You have a compiler recent enough on your Mac
to compile Stockfish. If not, continue with step 5 to install GNU gcc10 :-)

5) install the MacPorts package manager (https://www.macports.org/install.php),
for instance using the fast method in the "macOS Package (.pkg) Installer"
section of the page.

6) use the "port" command to install the gcc10 package of MacPorts by typing the
following command:

```
    sudo port install gcc10
```

With this step, MacPorts will install the gcc10 compiler under the name "g++-mp-10"
in the /opt/local/bin directory:

```
   which g++-mp-10

   /opt/local/bin/g++-mp-10       <--- answer
```

7) You can now go back to the "src" directory of Stockfish, and try to build
Stockfish by pointing at the right compiler:

```
   make clean
   make build COMP=gcc COMPCXX=/opt/local/bin/g++-mp-10
   make net
   ./stockfish
```

8) Enjoy Stockfish on Macintosh!

closes official-stockfish/Stockfish#3049

No functional change
  • Loading branch information
snicolet committed Aug 22, 2020
1 parent 34f67c5 commit 2485674
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ endif
endif

ifeq ($(KERNEL),Darwin)
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.7
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.7
XCRUN = xcrun
endif

Expand Down

0 comments on commit 2485674

Please sign in to comment.