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)


Csaba Ráduly wrote:

$ 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++  ..

Just to make sure we are on the same page, this is the directory structure I am using at this point.

/cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk

~/ATomilov_quickhull/trunk/build/
~/ATomilov_quickhull/trunk/build/CMakeFiles/
~/ATomilov_quickhull/trunk/build/CMakeCache.txt

~/ATomilov_quickhull/trunk/include/
~/ATomilov_quickhull/trunk/include/quickhull.hpp

~/ATomilov_quickhull/trunk/src/
~/ATomilov_quickhull/trunk/src/quickhull.cpp
~/ATomilov_quickhull/trunk/src/randombox.cpp
~/ATomilov_quickhull/trunk/src/simple_use.cpp

~/ATomilov_quickhull/src/test/...test files


If, as suggested by Csaba, I run,

$ cd /cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk/build

$ cmake -DCMAKE_CXX_COMPILER=clang++ ..

I get the output we have been discussing. Skip to the next section since this has been covered.

-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is unknown
CMake Warning at /usr/share/cmake-3.3.2/Modules/Platform/CYGWIN.cmake:15 (message):
  CMake no longer defines WIN32 on Cygwin!

  (1) If you are just trying to build this project, ignore this warning or
  quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
  the CMake cache.  If later configuration or build errors occur then this
  project may have been written under the assumption that Cygwin is WIN32.
  In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.

  (2) If you are developing this project, add the line

    set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required

  at the top of your top-level CMakeLists.txt file or set the minimum
  required version of CMake to 2.8.4 or higher.  Then teach your project to
  build on Cygwin without WIN32.
Call Stack (most recent call first):
  /usr/share/cmake-3.3.2/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
  CMakeLists.txt:1 (project)

-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
CMake Error at /usr/share/cmake-3.3.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler "/usr/bin/clang++" is not able to compile a simple test
  program.

  It fails with the following output:

Change Dir: /cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk/build/CMakeFiles/CMakeTmp

  Run Build Command:"/usr/bin/make.exe" "cmTC_9a026/fast"

  /usr/bin/make -f CMakeFiles/cmTC_9a026.dir/build.make
  CMakeFiles/cmTC_9a026.dir/build

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

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

  /usr/bin/clang++ -o CMakeFiles/cmTC_9a026.dir/testCXXCompiler.cxx.o -c

/cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

  CMakeFiles/cmTC_9a026.dir/build.make:65: recipe for target
  'CMakeFiles/cmTC_9a026.dir/testCXXCompiler.cxx.o' failed

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

  Makefile:126: recipe for target 'cmTC_9a026/fast' failed

  make[1]: *** [CMakeFiles/cmTC_9a026.dir/testCXXCompiler.cxx.o] Error 127

  make: *** [cmTC_9a026/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Configuring incomplete, errors occurred!
See also "/cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk/build/CMakeFiles/CMakeOutput.log". See also "/cygdrive/g/shared_data/SMD/ATomilov_quickhull/trunk/build/CMakeFiles/CMakeError.log".


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

I ran the following (based on my dir structure),

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

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

There is no output for this at all. There is nothing in /CMakeTmp and the command above looks like it is expecting testCXXCompiler.cxx to be in /CMakeTmp. Is that correct?

These lines in the cmake output are still a concern to me, should they be?

-- The CXX compiler identification is unknown
-- Check for working CXX compiler: /usr/bin/clang++ -- broken

I have tried a few other versions such as,

cmake -DCMAKE_CXX_COMPILER=/bin/clang++ ..
cmake -DCMAKE_CXX_COMPILER=/cygdrive/c/cygwin/bin/clang-3.8.exe ..

but I am still getting the same output.


Based on suggestions from Marco, I updated to gnu gcc 5.3, which is the latest version in the cygwin installer. Clang is already at 3.8.1-1 which is the highest version available from the cygwin installer. I have attached the output of cygcheck per one of Marco's requests. The cygcheck output has not been edited.

Last night I restored my OS from an image and reinstalled gcc, cmake, and clang to make sure I was up to the most recent versions.

LMH

Attachment: cygcheck.out
Description: Text document

--
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]