<omp.h> library isn't found in the GCC version (4.2.1) in Mavericks

怎甘沉沦 提交于 2019-11-29 01:11:48
volodymyr
  1. download gcc-4.9-bin.tar.gz download or newer from http://hpc.sourceforge.net/: http://prdownloads.sourceforge.net/hpc/gcc-4.9-bin.tar.gz

  2. cd to your downloads folder and un-gzip the archive gunzip gcc-4.9-bin.tar.gz (Google Chrome would do that automatically)

  3. in the same folder run sudo tar -xvf gcc-4.9-bin.tar -C / - this will place new executable to /usr/local/bin

  4. add the following to ~/.bash_profile: export PATH=/usr/local/bin:$PATH

  5. open new terminal and run which gcc. This should point to /usr/local/bin/gcc

Pavithran Iyer

I got this message when I tried to reinstall GCC via Homebrew.

GCC has been built with multilib support. Notably, OpenMP may not work: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670

If you need OpenMP support you may want to brew reinstall gcc --without-multilib

So, if you have Homebrew installed, you could try (on the terminal):

brew reinstall gcc --without-multilib

This process may take a while !

According to this thread on apple's forums, try using gcc-4.9-bin.tar .

First install the gcc-4.9 and type "xcode-select --install" on your terminal.

Then, use "/usr/local/bin/gcc " as compiler.

I solve it just adding aliases to .bash_profile

# Aliases in order to use brew gcc
alias gcc='gcc-5'
alias cc='gcc-5'
alias g++='g++-5'
alias c++='c++-5'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!