fs icon indicating copy to clipboard operation
fs copied to clipboard

OpenMP: unsupported option -fopenmp

Open astamm opened this issue 4 years ago • 1 comments

On recent versions of macOS, you enable OpenMP support by appending -Xclang -fopenmp to PKG_CPPFLAGS and -lomp to PKG_LIBS. It works nicely then when you install packages such as RcppArmadillo. I am only having trouble with fs, which fails to compile libuv with OpenMP flags on. It works well if I remove them.

astamm avatar Sep 13 '21 14:09 astamm

I will consider a PR for this if you want to submit one.

gaborcsardi avatar Dec 08 '21 13:12 gaborcsardi

It seems main builds successfully with

PKG_CPPFLAGS += -I/opt/homebrew/opt/libomp/include -Xclang -fopenmp
PKG_LIBS += -L/opt/homebrew/opt/libomp/lib -lomp

but fails with

CPPFLAGS += -I/opt/homebrew/opt/libomp/include -Xclang -fopenmp
LDFLAGS += -L/opt/homebrew/opt/libomp/lib -lomp

(which uses recommended flags by https://mac.r-project.org/openmp).

#417 is a simple fix for the latter.

ywwry66 avatar Apr 25 '23 04:04 ywwry66