clang in Macosx

By default, the clang version used is the one provided by Xcode
(base) marcgirondot@MacBook-Air-de-Marc bin % clang --version
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

If you install gcc using homebrew, you have another version:
(base) marcgirondot@MacBook-Air-de-Marc bin % /usr/local/opt/llvm/bin/clang --version
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

The Xcode version of clang does not understand the option -fopenmp whereas the version of gcc understand this option.
Then it can be important to know which version of clang you are using.

You can define which clang version to be used in R session by setting:
~/.R/Makevars

with

# The following statements are required to use the clang binary from homebrew
CC=/usr/local/opt/llvm/bin/clang
CXX=/usr/local/opt/llvm/bin/clang
CXX11=/usr/local/opt/llvm/bin/clang
CXX14=/usr/local/opt/llvm/bin/clang
CXX17=/usr/local/opt/llvm/bin/clang
CXX1X=/usr/local/opt/llvm/bin/clang
         LDFLAGS=-L/usr/local/opt/llvm/lib
# End clang inclusion statements

But within R:
> system("clang --version")
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04