[CMake] Custom clang compiler unrecognised on OS-X

James Turner james.turner at kdab.com
Wed Oct 19 05:44:58 EDT 2016


Some recent configuration change (either upgrading to Sierra or CMake 3.5.0) has prompted the following warning when running Cmake on a particular project:

================
CMake Error in xxxxxxxxxxxx/CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 3.5.0.
==============

This project uses a mixture of Fortran and C++ - the Fortran compiler is GFortran, and the C++ compiler is a custom clang with OpenMP support, supplied by Homebrew (as is CMake). I assume the error is somehow related to using a non-Apple Clang, but prior to upgrading either Xcode/the OS to Sierra/to Cmake 3.5, the message did not appear. (When I say ‘custom’, it’s simply that Apple choose to disable OpenMP in their official builds shipped with Xcode, the compiler I’m using is the stock mainline clang with OpenMP support re-enabled)

The message is repeated for each CMakeList.txt in the project, and of course I’ve googled it, but can only find references to unsupported compilers, when this system was introduced. Is there an issue with my CmakeLists.txt files, or some missing configuration file in Cmake, or something else again happening?

Running ‘-v’ on the OpenMP clang from Homebrew reports:

=================
clang-omp -v
clang version 3.5.0 
Target: x86_64-apple-darwin16.0.0
Thread model: posix
===============

I run Cmake with a command like: (in my build dir)

CC=/usr/local/bin/clang-omp CXX=/usr/local/bin/clang-omp++  cmake ../my-project/

Any hints appreciated!

Kind regards,
James

--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3868 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161019/c20d92a8/attachment.bin>


More information about the CMake mailing list