4
$\begingroup$

I have followed the steps described here to install Sniffles on my Mac Book Pro running macOS High Sierra.

However, I am struggling with this step:

cmake -D CMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.7 -D CMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.7 .. 

I do not have an /opt folder, so I get the following output:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_C_COMPILER:

    /opt/local/bin/gcc-mp-4.7

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_CXX_COMPILER:

    /opt/local/bin/g++-mp-4.7

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/Users/xxx/Documents/xxx/xxx/Sniffles-master/build/CMakeFiles/CMakeOutput.log".
See also "/Users/xxx/Documents/xxx/xxx/Sniffles-master/build/CMakeFiles/CMakeError.log".

Unsurprisingly, the error file says that /opt/local/bin/gcc-mp-4.7 does not exist.

So I tried:

cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/gcc ..

I get another long message but the most important bit is:

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)

I do not know what to do to solve this error.

I do have gcc here: /usr/bin/gcc and cmake version 3.8.1.

I have created an issue on the Sniffles GitHub repository.

Update 13th June 2018

I installed the latest version of gcc:

brew install gcc
Warning: gcc 8.1.0 is already installed and up-to-date
To reinstall 8.1.0, run `brew reinstall gcc`

Then, I tried to make cmake use gcc and g++ in the /usr/local/bin folder.

cmake -D CMAKE_C_COMPILER=/usr/local/bin/gcc-8 -D CMAKE_CXX_COMPILER=/usr/local/bin/g++-8 ..

This recreated the same problem:

CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)

Do I need to set the OpenMP_C*_FLAGS to something?

$\endgroup$
2
  • 2
    $\begingroup$ Do you have OpenMP installed? It's required. $\endgroup$
    – Devon Ryan
    Jun 13 '18 at 10:26
  • $\begingroup$ @DevonRyan OpenMP is installed as part of GCC. The problem is that OP isn’t using GCC. $\endgroup$ Jun 13 '18 at 12:38
4
$\begingroup$

You need to install GCC, or a newer version of Clang.

Your compiler — though the binary is called gcc — is actually Clang, and the Clang version that’s shipping with macOS/Xcode still does not support OpenMP.

The easiest course of action is probably to install GCC via Homebrew (brew install gcc) and then configure Sniffles to use Homebrew’s GCC (i.e. setting the CMAKE_C*_COMPILER paths to /usr/local/bin/g{cc,++}-$version).

$\endgroup$
1
  • $\begingroup$ I have tried what you said, unsuccessfully. I have updated my original question. $\endgroup$ Jun 13 '18 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.