Required software

  • Install homebrew
  • Install command line tools
xcode-select --install
  • Install gcc
brew install gcc
  • Install libomp (OpenMP runtime library)
brew install libomp

Configure Clion

  • CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(one C)

set(CMAKE_C_STANDARD 99)

FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
    message("OPENMP FOUND")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

set(SOURCE_FILES main.c)
add_executable(Tests ${SOURCE_FILES})
  • Locate your gcc-8 location by
which gcc-8
  • Open Clion > Preferences > Build, Execution, Deploymnet > Toolchains
    Change C compiler to the path to gcc-8.