Tag Archives: openmp

Installing GCC-7.3.0 on macOS High Sierra

I talked about getting GCC-5.3.0 running in a previous post. As part of some benchmark testing I’m doing for a new computer build, which I hope to write about in a future post, I ventured back into the world of parallel programming. I used the excellent instructions from Solarian Programmer found here to get GCC-7.3.0 running on macOS High Sierra 10.13.3.

Strictly speaking, the link above points to instructions for compiling GCC-7.1.0. While it’s not a big deal to modify these instructions for 7.3.0, here’s a text document with just the command line instructions to get 7.3.0 up.

Note: I did have to make one small deviation from the instructions provided in the link (as noted in the text document attached). I tried to “make” GCC7.3.0 with “make -j 4” but it failed, stating it couldn’t fine “<ctime>”. I retried the make using “make -j 1”, which took a LONG time but worked. I would try 4 first and only if it doesn’t work, try 1.

My previous post also talked about getting OpenMP/Clang running in Xcode and the link provided there works. I did try the steps but couldn’t get it to work. Maybe I’ll try again later but for now, I’m using the command line to compile the OpenMP code.

OpenMP Clang in Xcode

I’ve been playing around with prime numbers recently, which (naturally?) extended into an investigation into parallel programming. I installed the latest version of GCC 5 (v5.3.0 at the time of writing) using these instructions and got OpenMP running (support is built-in). I’m fine with using Terminal but I thought it would be interesting to try this in Xcode.

I installed the OpenMP C/C++ language extensions for Clang using homebrew with instructions from here. Unfortunately, I received the following error:

can't exec '/usr/local/bin/clang++-omp' (No such file or directory)

It turns out those instructions were missing a symlink that needs to be created. It’s as follows:

sudo ln -s /usr/local/bin/clang-omp++ /usr/local/bin/clang++-omp

Thanks to Stack Overflow for the “full” instructions. I can now build and run C++ parallelized code directly inside Xcode. I am finding a performance difference running the same code via the Terminal vs inside Xcode (which is slower). Hmm…