Set a different C compiler

paul zhang huaibao.zhang@gmail.com
Tue Jul 28 14:03:38 GMT 2020


Hi there,

I tried to build a HelloWorld project using the " cmake CMakeList.txt "
way. In the  CMakeList.txt file, I want to use the specific c and cxx
compilers

set(CMAKE_LEGACY_CYGWIN_WIN32 0)

#cmake_minimum_required(VERSION 2.6)

project(HelloWorld)

set (CMAKE_C_COMPILER icl)

set (CMAKE_CXX_COMPILER
/cygdrive/c/PROGRA~2/Intel/MPI/501~1.037/intel64/bin/mpicc)

set (CMAKE_CXX_FLAGS "-O3")

But the default c compiler is called instead, see below:

$ cmake CMakeLists.txt

-- The C compiler identification is MSVC 18.0.21005.1

-- The CXX compiler identification is MSVC 18.0.21005.1

-- Check for working C compiler: /cygdrive/c/Program Files (x86)/Microsoft
Visual Studio 12.0/VC/BIN/amd64/cl.exe

-- Check for working C compiler: /cygdrive/c/Program Files (x86)/Microsoft
Visual Studio 12.0/VC/BIN/amd64/cl.exe -- broken

CMake Error at /usr/share/cmake-3.14.5/Modules/CMakeTestCCompiler.cmake:60
(message):

  The C compiler


How to deal with this issue?


Thanks,
Paul


More information about the Cygwin mailing list