smarco / gem3-mapper

GEM-Mapper v3
GNU General Public License v3.0
56 stars 17 forks source link

clang: error: unsupported option '-fopenmp' #11

Closed hwlim closed 5 years ago

hwlim commented 5 years ago

I tried 'make' but got an error:

clang: error: unsupported option '-fopenmp'

My OS is Mac OS Mojave. It seems like some other R package compilation has a similar problem, which I figured out by making ~/.R/Makrvar file containing

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++ CXX16=/usr/local/opt/llvm/bin/clang++ CXX1X=/usr/local/opt/llvm/bin/clang++ LDFLAGS=-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib FLIBS=-L/usr/local/Cellar/gcc/8.3.0/lib/gcc/8

However, I don't know how to handle this case, which is not R. Any idea?

smarco commented 5 years ago

Do you have OpenMP installed? e.g. brew install clang-omp

hwlim commented 5 years ago

In the recent version, "brew install clang-omp" doesn't work out. Instead, I installed it via "brew install llvm". Somehow the environment for openmp has changed in Mac OS. It seems like the previously used default path or setting is not compatible with the new environment anymore. I see similar errors in other package installation using openmp. I figured how to make it in R as mentioned above. But not in this case.

heathsc commented 5 years ago

The configure script checks for the OpenMP headers. In this case it looks like the headers are present on the system but the clang version you are using does not support openmp (as far as I know, the default MacOS chain does not support openmp). In this case you can simply edit Makefile.mk in the root gem3-mapper directory (after running ./configure) and change the line with HAVE_OPENMP = 1 to HAVE_OPENMP = 0, and then retry the make. OpenMP is little used in GEM3 so you can work very well without it.

Simon

On 15 Mar 2019, at 20:48, Lim notifications@github.com wrote:

In the recent version, "brew install clang-omp" doesn't work out. Instead, I installed it via "brew install llvm". Somehow the environment for openmp has changed in Mac OS. It seems like the previously used default path or setting is not compatible with the new environment anymore. I see similar errors in other package installation using openmp. I figured how to make it in R as mentioned above. But not in this case.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smarco/gem3-mapper/issues/11#issuecomment-473419201, or mute the thread https://github.com/notifications/unsubscribe-auth/ADHPd5kELaydCm8HuT7QVwDwryegKmRNks5vW_kAgaJpZM4b1HB1.

hwlim commented 5 years ago

Great! It works! Thank you!