vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[boost-cobalt] Build error on x64-linux

Open mezdej opened this issue 1 year ago • 10 comments

Package: boost-cobalt:[email protected]

Host Environment

  • Host: x64-linux
  • Compiler: GNU 10.2.1
  • vcpkg-tool version: 2024-04-23-d6945642ee5c3076addd1a42c331bbf4cfc97457 vcpkg-scripts version: cbf4a6641 2024-05-09 (10 hours ago)

To Reproduce

vcpkg install boost-cobalt

Failure logs

-- Using cached boostorg-cobalt-boost-1.85.0.tar.gz.
-- Cleaning sources at /home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/src/ost-1.85.0-a6678fa3f6.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/mezdej/environment/vcpkg/downloads/boostorg-cobalt-boost-1.85.0.tar.gz
-- Using source at /home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/src/ost-1.85.0-a6678fa3f6.clean
-- Configuring x64-linux
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /home/mezdej/environment/vcpkg/downloads/tools/cmake-3.29.2-linux/cmake-3.29.2-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j21
    Working Directory: /home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/x64-linux-dbg
    See logs for more information:
      /home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-out.log
      /home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-err.log

Call Stack (most recent call first):
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  installed/x64-linux/share/vcpkg-boost/boost-install.cmake:65 (vcpkg_cmake_install)
  ports/boost-cobalt/portfile.cmake:12 (boost_configure_and_install)
  scripts/ports.cmake:175 (include)



/home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-err.log
ninja: error: unknown target 'install'
/home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-out.log
Change Dir: '/home/mezdej/environment/vcpkg/buildtrees/boost-cobalt/x64-linux-dbg'

Run Build Command(s): /home/mezdej/environment/vcpkg/downloads/tools/ninja/1.10.2-linux/ninja -v -v -j21 install

mezdej avatar May 10 '24 15:05 mezdej

Please check the configure log.

Neumann-A avatar May 10 '24 17:05 Neumann-A

I have found that entry line: "Boost.Cobalt: not building, can't include ."

config-x64-linux-out.log config-x64-linux-dbg-CMakeCache.txt.log

mezdej avatar May 13 '24 15:05 mezdej

try_compile(
        BOOST_COBALT_HAS_COROUTINE_INCLUDE
        ${CMAKE_CURRENT_BINARY_DIR}
        ${CMAKE_CURRENT_LIST_DIR}/coroutine.cpp
        CXX_STANDARD 20
        CXX_STANDARD_REQUIRED 20
        OUTPUT_VARIABLE TRY_COMPILE_OUTPUT)

if (NOT BOOST_COBALT_HAS_COROUTINE_INCLUDE)
    message(STATUS "Boost.Cobalt: not building, can't include <coroutine>.")
    message(DEBUG ${TRY_COMPILE_OUTPUT})
    return()
endif()

Need to check why try_compile fails

check the *.yaml file in the subfolder CMakeFiles of the build folder

Neumann-A avatar May 13 '24 15:05 Neumann-A

gcc-10 probably needs -fcoroutines in CXXFLAGS

Neumann-A avatar May 13 '24 15:05 Neumann-A

exactly as you said: 295 | #error "the coroutine header requires -fcoroutines" Can you guys fix it?

mezdej avatar May 13 '24 16:05 mezdej

Please add -fcoroutines in CXXFLAGS for gcc-10 @FrankXie05

mezdej avatar May 24 '24 10:05 mezdej

@mezdej I will do it. :)

FrankXie05 avatar May 27 '24 01:05 FrankXie05

@mezdej how to add -fcoroutines?

PL23K avatar Jul 30 '24 08:07 PL23K

I've found the same issue, this is my log:

Change Dir: '/usr/local/vcpkg/buildtrees/boost-cobalt/x64-linux-dbg'

Run Build Command(s): /usr/bin/ninja -v -v -j9 install

uninstalling ninja-build fixes it ninja-build version:

debian@ns3048085:~$ ninja --version
1.11.1

c++ version:

Debian clang version 18.1.8 (++20240718080534+3b5b5c1ec4a3-1~exp1~20240718200641.143)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

Deneb128 avatar Jul 30 '24 17:07 Deneb128

Found this issue when searching for errors in logs. My error logs are similar up to CMakeConfigureLog.yaml, though I don't think they are caused by -fcoroutines or ninja.

CMakeConfigureLog.yaml shows error at "CMAKE_HAVE_LIBC_PTHREAD" Relevant error output from pthread check:

kind: "try_compile-v1"
...
checks:
  - "Performing Test CMAKE_HAVE_LIBC_PTHREAD"
...
buildResult:
  variable: "CMAKE_HAVE_LIBC_PTHREAD"
  cached: true
  stdout: |
    ...
    ...
    src.cxx:(.text+0x3e): undefined reference to `pthread_create'
    src.cxx:(.text+0x4a): undefined reference to `pthread_detach'
    src.cxx:(.text+0x56): undefined reference to `pthread_cancel'
    src.cxx:(.text+0x67): undefined reference to `pthread_join'
    src.cxx:(.text+0x7b): undefined reference to `pthread_atfork'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

Additional info: Package: boost-cobalt:[email protected] vcpkg tag at 2024-07-12

Environments: Tested on 2 different Ubuntu distributions running on WSL with Ubuntu-24.04 and Ubuntu-18.04. Test program configures and builds on Windows 10 and Ubuntu-24.04.

  • Windows 10: Compiler MSVC - No Error
  • Ubuntu-24.04: Compiler GNU 13.2.0 - No Error
  • Ubuntu-18.04: Compiler GNU 7.5.0 - Error

I would appreciate any guidance about the cause and workarounds.

egebasturk avatar Aug 28 '24 08:08 egebasturk

Same problem too.

kekeliu-whu avatar Oct 11 '24 03:10 kekeliu-whu

I've added set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines") to my cmake files but I still got error "Boost.Cobalt: not building, can't include <coroutine>." @mezdej have you resolve this ?

kamilz98 avatar Oct 26 '24 16:10 kamilz98

I solved it by removing /usr/bin/ninja

niclar avatar Nov 28 '24 10:11 niclar

I solved it by removing /usr/bin/ninja

Probably not.

Additional info: Package: boost-cobalt:[email protected] vcpkg tag at 2024-07-12

Environments: Tested on 2 different Ubuntu distributions running on WSL with Ubuntu-24.04 and Ubuntu-18.04. Test program configures and builds on Windows 10 and Ubuntu-24.04.

* Windows 10: Compiler MSVC - No Error

* Ubuntu-24.04: Compiler GNU 13.2.0 - No Error

* Ubuntu-18.04: Compiler GNU 7.5.0 - Error

I would appreciate any guidance about the cause and workarounds.

What I see:

  • Old compilers don't provide the required toolchain capabilities. (Coroutines.)
  • The configuration step doesn't fail but simple creates no build/install rules. (Unusual.)
  • The build/install step fails becuase there are no such rules.

The solution is to acquire a capable toolchain.

dg0yt avatar Nov 28 '24 21:11 dg0yt

Hi Team,

Package: boost-cobalt:[email protected]#2

Host Environment

Host: x64-linux, WSL ubuntu 18.04 Compiler: Clang-17, Clang++-17

Getting below error in CMake configuration step: ` Installing 1/12 boost-cobalt:[email protected]#2... Building boost-cobalt:[email protected]#2... /home/xyz/repos/abc/tools/vcpkg/buildtrees/versioning_/versions/boost-cobalt/2c39cef923bb54a5c8230dea5b7d72586f4d67ec: info: installing overlay port from here -- Using cached boostorg-cobalt-boost-1.85.0.tar.gz. -- Cleaning sources at /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/src/ost-1.85.0-74ba267639.clean. Use --editable to skip cleaning for the packages you specify. -- Extracting source /home/xyz/repos/abc/tools/vcpkg/downloads/boostorg-cobalt-boost-1.85.0.tar.gz -- Using source at /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/src/ost-1.85.0-74ba267639.clean -- Found external ninja('1.12.1'). -- Configuring x64-linux -- Building x64-linux-dbg CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message): Command failed: /home/xyz/repos/abc/tools/vcpkg/downloads/tools/cmake-3.30.1-linux/cmake-3.30.1-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j21 Working Directory: /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/x64-linux-dbg See logs for more information: /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-out.log /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-err.log

Call Stack (most recent call first): /home/xyz/repos/abc/build/cpp-benchmarks/linux-debug/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process) /home/xyz/repos/abc/build/cpp-benchmarks/linux-debug/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build) /home/xyz/repos/abc/build/cpp-benchmarks/linux-debug/vcpkg_installed/x64-linux/share/vcpkg-boost/boost-install.cmake:65 (vcpkg_cmake_install) buildtrees/versioning_/versions/boost-cobalt/2c39cef923bb54a5c8230dea5b7d72586f4d67ec/portfile.cmake:12 (boost_configure_and_install) scripts/ports.cmake:196 (include) `

error: building boost-cobalt:x64-linux failed with: BUILD_FAILED See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information. Elapsed time to handle boost-cobalt:x64-linux: 24 s Please ensure you're using the latest port files with git pull and vcpkg update. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+boost-cobalt You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?title=[boost-cobalt]+Build+error+on+x64-linux&body=Copy+issue+body+from+%2Fhome%2Fshubham6404869%2Frepos%2FOneLakeClient%2Fbuild%2Fcpp-benchmarks%2Flinux-debug%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed CMake Error at /home/xyz/repos/abc/tools/vcpkg/scripts/buildsystems/vcpkg.cmake:904 (message): vcpkg install failed. See logs for more information: /home/xyz/repos/abc/build/cpp-benchmarks/linux-debug/vcpkg-manifest-install.log Call Stack (most recent call first): /home/xyz/repos/abc/cmake/share/cmake-3.19/Modules/CMakeDetermineSystem.cmake:123 (include) CMakeLists.txt:101

The contents of /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-out.log is:

Change Dir: '/home/shubham6404869/repos/OneLakeClient/tools/vcpkg/buildtrees/boost-cobalt/x64-linux-dbg' Run Build Command(s): /usr/local/bin/ninja -v -v -j21 install

And the contents of /home/xyz/repos/abc/tools/vcpkg/buildtrees/boost-cobalt/install-x64-linux-dbg-err.log is:

ninja: error: unknown target 'install'

I have updated the ninja to the latest version 1.12.1 but still i am getting above error.

I am not getting any CMake configuration error with MSVC compiler on Windows machine but on WSL ubuntu distribution 18.04 i am getting above issue.

Can anyone suggest how to resolve this ?

shubham6404869 avatar Dec 16 '24 17:12 shubham6404869

Can anyone suggest how to resolve this ?

https://github.com/microsoft/vcpkg/issues/38677#issuecomment-2506757560: "The solution is to acquire a capable toolchain."

dg0yt avatar Dec 16 '24 18:12 dg0yt

Can anyone suggest how to resolve this ?

#38677 (comment): "The solution is to acquire a capable toolchain."

How to do this @dg0yt ?

shubham6404869 avatar Dec 16 '24 18:12 shubham6404869

You mention clang++-17, but is this really the CXX compiler used by CMake? (Check config log.)

dg0yt avatar Dec 16 '24 18:12 dg0yt

``> You mention clang++-17, but is this really the CXX compiler used by CMake? (Check config log.)

Yes @dg0yt this is the CXX compiler used by CMake. I am getting below config log, same error : Boost.Cobalt: not building, can't include <coroutine>.

shubham6404869 avatar Dec 17 '24 04:12 shubham6404869