This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem building with cmake under cygwin (need clang)


On 16-07-26 06:52 PM, LMH wrote:
Thanks you for the clarification.

I implemented your steps,

$ ls src/
CMakeLists.txt  include  README.md  src  test

$ mkdir build

$ cd build/

$ cmake -DCMAKE_CXX_COMPILER=clang  ../src

Stop doing that-----------------------^^^^^^

CMakeLists.txt is in the root of the project. Point cmake to it, like this:

$ cmake  -DCMAKE_CXX_COMPILER=clang++  ..



I get the following output, which is the same error output I was getting
before. It is different then the errors you are specifying.

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is unknown
(snip)


It looks like it is still using gnu for the compiler and not clang.

There are two different compilers cmake knows about: the C compiler (CMAKE_C_COMPILER) and the C++ compiler (CMAKE_CXX_COMPILER). You only set the C++ compiler; cmake is using its default for the C compiler.

For quickhull, CMAKE_C_COMPILER probably doesn't matter.

> It
looks like it can't identify the c++ compiler at all. I tried this,

cmake -DCMAKE_CXX_COMPILER=clang++ ../src


For clang, it makes no difference (clang++ is usually a symlink to clang).

because I think that CXX is the c++ compiler, but this doesn't make any
difference. I have attached the cmake error and output logs in case that
is useful.

It just looks like there is something missing or misconfigured in my
installation. The which clang and which clang++ commands return the
expected values. If cmake isn't able to build a test app, then there is
something wrong at that end I think.


This is what cmake tried:

Run Build Command:"/usr/bin/make.exe" "cmTC_29d2e/fast"
/usr/bin/make -f CMakeFiles/cmTC_29d2e.dir/build.make CMakeFiles/cmTC_29d2e.dir/build

make[1]: Entering directory '/cygdrive/g/shared_data/SMD/ATomilov_quickhull/build/CMakeFiles/CMakeTmp'

Building CXX object CMakeFiles/cmTC_29d2e.dir/testCXXCompiler.cxx.o

/usr/bin/clang++ -o CMakeFiles/cmTC_29d2e.dir/testCXXCompiler.cxx.o -c /cygdrive/g/shared_data/SMD/ATomilov_quickhull/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

CMakeFiles/cmTC_29d2e.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_29d2e.dir/testCXXCompiler.cxx.o' failed make[1]: Leaving directory '/cygdrive/g/shared_data/SMD/ATomilov_quickhull/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_29d2e/fast' failed
make[1]: *** [CMakeFiles/cmTC_29d2e.dir/testCXXCompiler.cxx.o] Error 127
make: *** [cmTC_29d2e/fast] Error 2


Try to run those commands manually:

$ cd '/cygdrive/g/shared_data/SMD/ATomilov_quickhull/build/CMakeFiles/CMakeTmp'

$ /usr/bin/clang++ -o CMakeFiles/cmTC_29d2e.dir/testCXXCompiler.cxx.o -c /cygdrive/g/shared_data/SMD/ATomilov_quickhull/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

What is the output?


Csaba
--
Life is complex, with real and imaginary parts.
The Tao of math: The numbers you can count are not the real numbers.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]