Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#57700 closed defect (fixed)

quazip @0.7.6: No known features for CXX compiler "Clang" version 5.0.2.

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: yan12125 (Chih-Hsuan Yen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: quazip

Description

quazip fails to build on older systems that need to use a MacPorts clang compiler for C++11 support:

-- The C compiler identification is Clang 5.0.2
-- The CXX compiler identification is Clang 5.0.2
-- Check for working C compiler: /opt/local/bin/clang-mp-5.0
-- Check for working C compiler: /opt/local/bin/clang-mp-5.0 -- 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: /opt/local/bin/clang++-mp-5.0
-- Check for working CXX compiler: /opt/local/bin/clang++-mp-5.0 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.2.11") 
-- Configuring done
CMake Error in quazip/CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 5.0.2.

If desired, you can reproduce this problem on newer systems by forcing the use of a MacPorts clang compiler, for example:

sudo port configure quazip configure.compiler=macports-clang-6.0

Change History (8)

comment:1 Changed 5 years ago by yan12125 (Chih-Hsuan Yen)

Thanks for the hint!

As a side note, ticket:57167 should be fixed, too, or texstudio is still broken on 10.8.

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Yeah this may be a general problem with anything that uses a MacPorts clang compiler with qt5, and if so maybe the fix needs to go into the qt5 portgroup. But I don't know what the fix is.

comment:3 Changed 5 years ago by kencu (Ken)

I've seen this before. You usually have to change the compiler test from something like "equals" clang to "matches" clang, if it is the same issue.

comment:4 Changed 5 years ago by kencu (Ken)

Not in this case tho.

you get pretty close if you delete PG cmake and qt5, and go with PG qmake5 instead, though.

PortGroup               cxx11 1.1
PortGroup               github 1.0
PortGroup               qmake5 1.0

comment:5 in reply to:  3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

I've seen this before. You usually have to change the compiler test from something like "equals" clang to "matches" clang, if it is the same issue.

I do not think that issue is related. That issue arises because the cmake portgroups request CMP0025 which causes Apple's Clang to be identified as "AppleClang" to distinguish it from open-source Clang. Projects that assume that any Clang compiler is identified as "Clang" need to be patched as you suggest. That's not applicable here, because the problem is occurring not with Apple Clang but with open-source Clang.

comment:6 Changed 5 years ago by yan12125 (Chih-Hsuan Yen)

In 98445d69fc13be9c968abe4c597de8324b0ceee6/macports-ports (master):

quazip: fix building on 10.8

That's a very long story...

  1. On 10.8, Qt 5.7 is used, and in this version cxx_decltype feature is requested [1]
  2. Compiler features detection requires CMAKE_*_STANDARD_COMPILE_OPTION (Modules/Compiler/CMakeCommonCompilerMacros.cmake)
  3. CMAKE_*_STANDARD_COMPILE_OPTION are defined in Modules/Compiler/Clang-CXX.cmake. However, those definitions are skipped if the system is Apple and CMP0025 is not NEW
  4. We have -DCMAKE_POLICY_DEFAULT_CMP0025=NEW. Why doesn't it work? That's because CMAKE_POLICY_DEFAULT_* variables are handled in the cmake_minimum_required() command [2], while compiler feature detection occurs in the project() command.

Now the conclusion - cmake_minimum_required() should be before project()

Ref: #57700

[1] https://bugreports.qt.io/browse/QTBUG-57886
[2] https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

comment:7 Changed 5 years ago by yan12125 (Chih-Hsuan Yen)

Resolution: fixed
Status: assignedclosed

comment:8 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Amazing, thanks for figuring this out!

Note: See TracTickets for help on using tickets.