lbcb-sci / graphmap2

GraphMap - A highly sensitive and accurate mapper for long, error-prone reads http://www.nature.com/ncomms/2016/160415/ncomms11307/full/ncomms11307.html https://www.biorxiv.org/content/10.1101/720458v1
MIT License
67 stars 6 forks source link

clang error #12

Open BrianaGross opened 4 years ago

BrianaGross commented 4 years ago

Hi all,

Has anyone successfully installed this on Mac OS Mojave? After running the make command, I received the following error: clang: error: unsupported option '-fopenmp'. I see that this is a known issue for Mojave, but I'm afraid I'm unable to translate the suggested solutions to this program. I wondered if anyone had a record of how they overcame this and used graphmap2 recently.

Thank you, Briana

jmaricb commented 4 years ago

Hi @BrianaGross ,

unfortunately Graphmap2 will not compile on Mac OS X Clang complier.

There is an option to compile it on mac by downloading GNU C++ compiler with Homebrew.

You can download Homebrew here https://brew.sh/

Then run the command 'brew install gcc' which will install C++ compiler alongside Clang compiler. The compiler will be installed in directory like this: /usr/local/bin/g++-9 You can type 'which g++-9' to find the installation directory.

Finally, replace the 19. line in the Makefile file 'GCC ?= g++' with '/usr/local/bin/g++-9' (or wherever your compiler was installed).

The program should compile now. Unfortunately, I don't know better way to build Graphmap2 on Mac.

Let me know if you can't reproduce this installation.

BrianaGross commented 4 years ago

Thanks so much for your quick response! Much appreciated.

I followed your helpful instructions (including checking the location of my gcc install), and when I ran make I got the error Makefile:19: *** missing separator. Stop.

Should there be anything on line 19 other than /usr/local/bin/g++-9 followed by a hard return?

Thank you!

jmaricb commented 4 years ago

I am sorry, I made a typo. It should be replaced with

GCC ?= /usr/local/bin/g++-9' (or whatever the location of the installation is)

BrianaGross commented 4 years ago

Thanks! I corrected the line and the install seemed to proceed, but eventually ended with the error:

ld: warning: direct access in function 'operator new[](unsigned long, std::nothrow_t const&) [clone .cold]' from file '/usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.3.0/../../../libstdc++.a(new_opvnt.o)' to global weak symbol 'operator new[](unsigned long, std::nothrow_t const&)' from file '/usr/local/Cellar/gcc/9.3.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.3.0/../../../libstdc++.a(new_opvnt.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

I haven't really been able to figure out what this one means... I have a feeling I am getting into some things that are maybe just inherent to my OS now, so I don't know if you can answer this question. Thanks for your help so far!

jmaricb commented 4 years ago

Have you followed these exact steps:

git clone https://github.com/lbcb-sci/graphmap2 cd graphmap2 make modules
make

Did you run make modules before running make ?

jmaricb commented 4 years ago

If you are I can try to take a look because I don't know right now. I am also compiling on Mac and it is successful for me by following the steps I have described. If I find something I will let you know.

BrianaGross commented 4 years ago

Yes, I followed all those steps - I even re-downloaded and tried again. It must be something specific to my set-up. I will try to figure it out. It was very nice of you to show me the C++ compiler work-around! Thanks so much.