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

gcc, openmp, osx-mavericks

Solution

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

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

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

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

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

Problem

I have a problem with GCC. I want to update it to a new version, from the 4.2.1, to program with parallel programming. However, in this version there is no library . How can I download an updated version? The error that the terminal give me is: ``` omp_hello.c:11:10: fatal error: 'omp.h' file not found #include <omp.h> ^ 1 error generated. ```

Original source

Related problems