sw icon indicating copy to clipboard operation
sw copied to clipboard

Compiler is not implemented: '' or 'AppleClang'

Open SamuelMarks opened this issue 3 years ago • 20 comments

Describe the bug Compiler is not implemented: '' or 'AppleClang'

Expected behavior It to be implemented

To Reproduce

CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
project(pp VERSION 0.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)
set(src src/main.cpp)

find_package(SW REQUIRED)
sw_add_package(org.sw.demo.ocornut.imgui)
sw_execute()

add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE org.sw.demo.ocornut.imgui)

sh

$ mkdir build src
$ curl -L https://raw.githubusercontent.com/ocornut/imgui/6a161b8/examples/example_allegro5/main.cpp -o src/main.cpp
$ cd build && cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SW: /usr/local/bin/sw  
-- sw: processing dependencies
CMake Error at cmake/packages/SWConfig.cmake:145 (message):
  Compiler is not implemented: '' or 'AppleClang'
Call Stack (most recent call first):
  CMakeLists.txt:9 (sw_execute)


-- Configuring incomplete, errors occurred!

Information:

  • Paste sw --version output.
sw.client.sw version 1.0.0
git revision 22757a4388a99010ffdee79011fbde5af50cee17 plus 8 modified files
assembled on
22.03.2021 10:40:40 UTC
22.03.2021 21:40:40 AEDT
  • Write OS, its version (host/target) macOS 11.1 (20C69)
  • Describe your compiler, its version
$ clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

SamuelMarks avatar Apr 06 '21 07:04 SamuelMarks

Hi,

I've implemented a fix. Run sudo sw --self-upgrade and re-run cmake again.

egorpugin avatar Apr 06 '21 10:04 egorpugin

Thanks @egorpugin but that didn't do anything. I'm trying a sw build -static of sw itself now, but don't have enough free space so am working on clearing that up.

SamuelMarks avatar Apr 06 '21 11:04 SamuelMarks

You need to update sw client. Try sw --version. It should tell some today's time. Maybe cmake uses old sw copy?

egorpugin avatar Apr 06 '21 11:04 egorpugin

Yeah it's weird, I wasn't using sudo before now with sudo and after deleting and recreating the build dir I get a Could NOT find SW (missing: SW_EXECUTABLE) error, but on the shell sw still works, and with --version gives:

sw.client.sw version 1.0.0
git revision 7ce601e30bffd31598b746831a439b181eaa6b04 plus 1 modified files
assembled on
06.04.2021 10:26:02 UTC
06.04.2021 20:26:02 AEST

SamuelMarks avatar Apr 06 '21 11:04 SamuelMarks

Run sw setup to make sw visible for cmake. (Probably remove cmake cache as well.)

egorpugin avatar Apr 06 '21 11:04 egorpugin

Hmm, same error still. Just had to do one runaround on permissions to solve the is executable but not readable. CMake is ignoring it for compatibility. using chmod

SamuelMarks avatar Apr 06 '21 11:04 SamuelMarks

Looks like I forget to bump cmake script version. https://github.com/SoftwareNetwork/sw/commit/d947222bd478c72865471c82fc05229d4cb2627d I'll upload new binaries.

egorpugin avatar Apr 06 '21 11:04 egorpugin

Try now.

sudo sw --self-upgrade
sw setup
(cmake command, clear cmake cache)

egorpugin avatar Apr 06 '21 12:04 egorpugin

Same error. Even after deleting my build dir and remaking it.

$ sw --version
sw.client.sw version 1.0.0
git revision d947222bd478c72865471c82fc05229d4cb2627d
assembled on
06.04.2021 11:59:32 UTC
06.04.2021 21:59:32 AEST

SamuelMarks avatar Apr 06 '21 12:04 SamuelMarks

Try to find ~/.cmake/packages/ ... SWConfig.cmake and check if that file is updated with commits https://github.com/SoftwareNetwork/sw/commit/ef77960d6576e9055df39e95a3c025e00e584d61 https://github.com/SoftwareNetwork/sw/commit/d947222bd478c72865471c82fc05229d4cb2627d

Maybe try to run sudo sw setup.

egorpugin avatar Apr 06 '21 12:04 egorpugin

No dice:

/tmp/imgui3 $ sudo sw setup
/tmp/imgui3 $ sw setup
/tmp/imgui3 $ rm -rf ~/.cmake
/tmp/imgui3 $ rm -rf build && mkdir build && cd $_
/tmp/imgui3/build $ cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:7 (find_package):
  By not providing "FindSW.cmake" in CMAKE_MODULE_PATH this project has asked
  CMake to find a package configuration file provided by "SW", but CMake did
  not find one.

  Could not find a package configuration file provided by "SW" with any of
  the following names:

    SWConfig.cmake
    sw-config.cmake

  Add the installation prefix of "SW" to CMAKE_PREFIX_PATH or set "SW_DIR" to
  a directory containing one of the above files.  If "SW" provides a separate
  development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/imgui3/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/imgui3/build/CMakeFiles/CMakeError.log".

SamuelMarks avatar Apr 06 '21 12:04 SamuelMarks

Run sw setup after removing .cmake. It setups those files.

egorpugin avatar Apr 06 '21 12:04 egorpugin

Yes just did that still same error:

$ cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SW: /usr/local/bin/sw  
-- sw: processing dependencies
CMake Error at .cmake/packages/SWConfig.cmake:147 (message):
  Compiler is not implemented: '' or 'AppleClang'
Call Stack (most recent call first):
  CMakeLists.txt:9 (sw_execute)


-- Configuring incomplete, errors occurred!
See also "/tmp/imgui3/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/imgui3/build/CMakeFiles/CMakeError.log".

SamuelMarks avatar Apr 06 '21 12:04 SamuelMarks

Can you try to add this change manually? https://github.com/SoftwareNetwork/sw/commit/ef77960d6576e9055df39e95a3c025e00e584d61

egorpugin avatar Apr 06 '21 12:04 egorpugin

Same error after:

$ curl -L https://raw.githubusercontent.com/SoftwareNetwork/sw/ef77960d6576e9055df39e95a3c025e00e584d61/src/sw/client/common/inserts/SWConfig.cmake -o ~/.cmake/packages/SWConfig.cmake
$ sudo sw setup
$ sw setup
$ rm -rf build && mkdir build && cd $_
$ cmake ..

EDIT: Same error if I do the curl line after sw setup

SamuelMarks avatar Apr 06 '21 12:04 SamuelMarks

You are copying old version, not new. Copy the file from this commit. https://github.com/SoftwareNetwork/sw/commit/d947222bd478c72865471c82fc05229d4cb2627d

egorpugin avatar Apr 06 '21 12:04 egorpugin

@egorpugin Same error. Tried with d947222bd478c72865471c82fc05229d4cb2627d instead of ef77960d6576e9055df39e95a3c025e00e584d61. Tried with sw setup before and after the curl line (ensuring to remove and remake the build dir each time). To no avail.

SamuelMarks avatar Apr 06 '21 12:04 SamuelMarks

Ok, found the issue. "AppleClang" must be "APPLECLANG"

egorpugin avatar Apr 06 '21 12:04 egorpugin

I've updated binaries. sudo sw --self-upgrade

egorpugin avatar Apr 06 '21 13:04 egorpugin

Thanks, that worked, now back to my incomplete type errors (see https://github.com/SoftwareNetwork/sw/issues/65)

SamuelMarks avatar Apr 07 '21 01:04 SamuelMarks