FastANI icon indicating copy to clipboard operation
FastANI copied to clipboard

compiling under MacOSX Mojave

Open gaboentropy opened this issue 7 years ago • 4 comments

When trying to compile under mojave, if I simply run autoconf ./configure --prefix=/usr/local make

I get: src/cgi/core_genome_identity.cpp:11:10: fatal error: 'omp.h' file not found

No compilation happens. So, I tried: ./configure --prefix=/usr/local --disable-openmp make

I still got: src/cgi/core_genome_identity.cpp:11:10: fatal error: 'omp.h' file not found

So, because I have gcc-8 from homebrew I tried: export CXX=/usr/local/bin/g++-8 ./configure --prefix=/usr/local make

I got: g++-8: error: unrecognized command line option '-stdlib=libc++'

So, I edited the Makefile and eliminated the "-stdlib=libc++"

That worked all right, and the program seems to do what's supposed to do (it's fast too!)

However, I thought you'd like to fix those issues to help Mac users get a clean first-try installation.

The first one is insisting on using omp.h, which seems to be used only by gcc (I might be wrong about this, am I? Is there a way to point to gcc's omg.h but still compile with clang?), the second wants to use a clang library, even though I was trying to use gcc's g++.

gaboentropy avatar Oct 02 '18 13:10 gaboentropy

I am also interested in a user friendly solution. I cannot get it installed on mac OS X Sierra, and the workaround described by gaboentropy do not work for me.

mikeds211 avatar Dec 01 '18 10:12 mikeds211

@mikeds211. The solution suggested by @gaboentropy should work if you have gcc-8 from homebrew. Can you try installing gcc?

cjain7 avatar Dec 04 '18 04:12 cjain7

UPDATE: I made some changes to INSTALL.txt and Makefile to allow cleaner install on MacOS using clang. Hopefully this will work for you now.

cjain7 avatar Dec 04 '18 05:12 cjain7

Just FYI for those who also find themselves with this error- the following command fixed it for me

$ brew install libomp

MrOlm avatar Feb 20 '20 22:02 MrOlm