Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装boost包报错 #4042

Open
MoonBunnyZZZ opened this issue May 13, 2024 · 3 comments
Open

安装boost包报错 #4042

MoonBunnyZZZ opened this issue May 13, 2024 · 3 comments
Labels

Comments

@MoonBunnyZZZ
Copy link

Xmake 版本

2.9.1

操作系统版本和架构

macos Sonoma

描述问题

相同配置文件在linux下通过,在mac上安装boost时失败

期待的结果

安装依赖包并通过编译.相同配置文件在linux下通过.

工程配置

set_languages("cxx17")
add_includedirs("include")
add_includedirs("include/tools")
add_includedirs("include/ranges")
add_includedirs("include/compairer")
add_includedirs("include/nodes")
add_includedirs("include/trainable")
add_includedirs("include/solver")
add_includedirs("include/runtime")

add_requires("fmt")
add_requires("boost")
add_requires("libomp")

target("TexasSolver")
set_kind("shared")
add_ldflags("-pthread", "-fopenmp")
add_files("src/**.cpp|pybind/.cpp|experimental/.cpp|console.cpp")
add_packages("fmt")
add_packages("boost")
add_packages("openmp")
target("console")
set_kind("binary")
add_ldflags("-pthread", "-fopenmp")
add_files("src/console.cpp")
add_packages("fmt")
add_packages("openmp")
add_deps("TexasSolver")

工程为 https://github.com/bupticybee/TexasSolver/tree/console

附加信息和错误日志

checking for platform ... macosx
checking for architecture ... arm64
checking for Xcode directory ... %s
checking for Codesign Identity of Xcode ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
checking for cmake ... no
checking for cmake ... /opt/homebrew/bin/cmake
finding fmt from xmake ..
checking for xmake::fmt ... fmt 10.2.1
finding boost from xmake ..
checking for xmake::boost ... no
finding boost from brew ..
checking for brew ... /opt/homebrew/bin/brew
finding boost from system ..
checking for /Library/Developer/CommandLineTools/usr/bin/clang ... ok
checking for the c compiler (cc) ... clang
checking for /Library/Developer/CommandLineTools/usr/bin/clang ... ok
checking for flags (-fPIC) ... ok

clang "-fPIC" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
/Library/Developer/CommandLineTools/usr/bin/clang -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_1FA6BB8103AF48308277D27D3158B660.o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_775FB00633BC4F66BF87D39CCDE5CF30.c
checking for flags (-fdiagnostics-color=always) ... ok
clang "-fdiagnostics-color=always" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for /Library/Developer/CommandLineTools/usr/bin/clang++ ... ok
checking for the linker (ld) ... clang++
checking for /Library/Developer/CommandLineTools/usr/bin/clang++ ... ok
checking for flags (-fPIC) ... ok
clang++ "-fPIC" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" "-lz" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" "-lz"
/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_1FA6BB8103AF48308277D27D3158B660.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_1FA6BB8103AF48308277D27D3158B660.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost
ld: library 'boost' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checking for c links(boost)
checking for c snippet(find_package/boost)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_1FA6BB8103AF48308277D27D3158B660.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_1FA6BB8103AF48308277D27D3158B660.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost) failed(1)
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
[@programdir/modules/core/tools/gcc.lua:559]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@programdir/core/tool/linker.lua:221]: in function 'link'
[...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
[@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
[@programdir/modules/package/manager/system/find_package.lua:93]:
[@programdir/modules/package/manager/find_package.lua:110]: in function '_find_package'
[@programdir/modules/package/manager/find_package.lua:194]:
[@programdir/modules/package/manager/brew/find_package.lua:156]:
[@programdir/modules/package/manager/find_package.lua:110]: in function '_find_package'
[@programdir/modules/package/manager/find_package.lua:194]:
[@programdir/modules/lib/detect/find_package.lua:109]:
[@programdir/core/package/package.lua:1788]: in function '_fetch_library'
[@programdir/core/package/package.lua:1955]: in function 'fetch'
[...modules/private/action/require/impl/install_packages.lua:333]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
[@programdir/core/base/scheduler.lua:406]:

checking for brew::boost ... no
finding boost from brew ..
finding boost from system ..

/Library/Developer/CommandLineTools/usr/bin/clang -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D0C38CB304324C108BCE6F013921F230.o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_775FB00633BC4F66BF87D39CCDE5CF30.c
/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D0C38CB304324C108BCE6F013921F230.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D0C38CB304324C108BCE6F013921F230.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost
ld: library 'boost' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checking for c links(boost)
checking for c snippet(find_package/boost)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D0C38CB304324C108BCE6F013921F230.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D0C38CB304324C108BCE6F013921F230.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost) failed(1)
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
[@programdir/modules/core/tools/gcc.lua:559]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@programdir/core/tool/linker.lua:221]: in function 'link'
[...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
[@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
[@programdir/modules/package/manager/system/find_package.lua:93]:
[@programdir/modules/package/manager/find_package.lua:110]: in function '_find_package'
[@programdir/modules/package/manager/find_package.lua:194]:
[@programdir/modules/package/manager/brew/find_package.lua:156]:
[@programdir/modules/package/manager/find_package.lua:84]: in function '_find_package_with_builtin_rule'
[@programdir/modules/package/manager/find_package.lua:130]: in function '_find_package'
[@programdir/modules/package/manager/find_package.lua:194]:
[@programdir/modules/lib/detect/find_package.lua:109]:
[@programdir/core/package/package.lua:1788]: in function '_fetch_library'
[@programdir/core/package/package.lua:1955]: in function 'fetch'
[...modules/private/action/require/impl/install_packages.lua:333]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
[@programdir/core/base/scheduler.lua:406]:

finding boost from vcpkg ..
finding boost from conan ..
finding boost from pkgconfig ..
checkinfo: cannot runv(pkg-config --version), No such file or directory
checking for pkg-config ... no
checkinfo: cannot runv(pkgconf --version), No such file or directory
checking for pkgconf ... no
finding boost from system ..

/Library/Developer/CommandLineTools/usr/bin/clang -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D7511F84D657463082BA24B36356D050.o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_775FB00633BC4F66BF87D39CCDE5CF30.c
/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D7511F84D657463082BA24B36356D050.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D7511F84D657463082BA24B36356D050.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost
ld: library 'boost' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checking for c links(boost)
checking for c snippet(find_package/boost)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/Library/Developer/CommandLineTools/usr/bin/clang++ -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D7511F84D657463082BA24B36356D050.b /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_D7511F84D657463082BA24B36356D050.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lz -lboost) failed(1)
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
[@programdir/modules/core/tools/gcc.lua:559]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@programdir/core/tool/linker.lua:221]: in function 'link'
[...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
[@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
[@programdir/modules/package/manager/system/find_package.lua:93]:
[@programdir/modules/package/manager/find_package.lua:84]: in function '_find_package_with_builtin_rule'
[@programdir/modules/package/manager/find_package.lua:130]: in function '_find_package'
[@programdir/modules/package/manager/find_package.lua:194]:
[@programdir/modules/lib/detect/find_package.lua:109]:
[@programdir/core/package/package.lua:1788]: in function '_fetch_library'
[@programdir/core/package/package.lua:1955]: in function 'fetch'
[...modules/private/action/require/impl/install_packages.lua:333]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
[@programdir/core/base/scheduler.lua:406]:

checking for boost ... no
finding libomp from xmake ..
checking for xmake::libomp ... libomp 12.0.1
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> boost 1.84.0
please input: y (y/n/m)
y

...updated 625 targets...
finding boost from xmake ..
checking for xmake::boost ... boost 1.84.0
{
license = "BSL-1.0",
version = "1.84.0"
}

patching /Users/wx/.xmake/packages/b/boost/1.84.0/a990430d8483473188ce6832c88b8185/lib/pkgconfig/boost.pc ..
checking for flags (-fPIC) ... ok

clang "-fPIC" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
/Library/Developer/CommandLineTools/usr/bin/clang -c -Qunused-arguments -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -std=c++14 -o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_8E0DFFD25B514310837EA21BBE361B40.o /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_30B5E98FD1734C4383CE607874386DE7.cpp
checking for flags (-fdiagnostics-color=always) ... ok
clang "-fdiagnostics-color=always" "-Qunused-arguments" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
checking for c++ snippet(test)
checkinfo: ...amdir/core/sandbox/modules/import/core/tool/compiler.lua:84: @programdir/modules/core/tools/gcc.lua:880: /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_30B5E98FD1734C4383CE607874386DE7.cpp:4:22: fatal error: 'boost/algorithm/string.hpp' file not found
#include <boost/algorithm/string.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[@programdir/modules/core/tools/gcc.lua:880]: in function 'catch'
[@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
[@programdir/modules/core/tools/gcc.lua:821]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@programdir/core/tool/compiler.lua:278]: in function 'compile'
[...amdir/core/sandbox/modules/import/core/tool/compiler.lua:82]: in function 'compile'
[@programdir/modules/lib/detect/check_cxsnippets.lua:244]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
[...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:340]: in function 'script'
[...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
[...dir/modules/private/action/require/impl/actions/test.lua:41]:
[.../modules/private/action/require/impl/actions/install.lua:444]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[.../modules/private/action/require/impl/actions/install.lua:370]:
[...modules/private/action/require/impl/install_packages.lua:487]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
[@programdir/core/base/scheduler.lua:406]:

error: ...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:340: ...amdir/core/sandbox/modules/import/core/tool/compiler.lua:84: @programdir/modules/core/tools/gcc.lua:880: /var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_30B5E98FD1734C4383CE607874386DE7.cpp:4:22: fatal error: 'boost/algorithm/string.hpp' file not found
#include <boost/algorithm/string.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[@programdir/modules/core/tools/gcc.lua:880]: in function 'catch'
[@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
[@programdir/modules/core/tools/gcc.lua:821]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@programdir/core/tool/compiler.lua:278]: in function 'compile'
[...amdir/core/sandbox/modules/import/core/tool/compiler.lua:82]: in function 'compile'
[@programdir/modules/lib/detect/check_cxsnippets.lua:244]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
[...xmake/repositories/xmake-repo/packages/b/boost/xmake.lua:340]: in function 'script'
[...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
[...dir/modules/private/action/require/impl/actions/test.lua:41]:
[.../modules/private/action/require/impl/actions/install.lua:444]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[.../modules/private/action/require/impl/actions/install.lua:370]:
[...modules/private/action/require/impl/install_packages.lua:487]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
[@programdir/modules/async/runjobs.lua:220]: in function 'cotask'
[@programdir/core/base/scheduler.lua:406]:

=> install boost 1.84.0 .. failed
error: @programdir/core/main.lua:329: @programdir/core/sandbox/modules/import/core/base/task.lua:65: @programdir/modules/async/runjobs.lua:322: .../modules/private/action/require/impl/actions/install.lua:506: install failed!
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:973]:
[.../modules/private/action/require/impl/actions/install.lua:506]: in function 'catch'
[@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
[.../modules/private/action/require/impl/actions/install.lua:370]:
[...modules/private/action/require/impl/install_packages.lua:487]: in function 'jobfunc'
[@programdir/modules/async/runjobs.lua:238]:

stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:973: in function 'base/os.raiselevel'
(...tail calls...)
@programdir/core/main.lua:329: in upvalue 'cotask'
@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
-> boost 1.84.0
please input: y (y/n/m)
y
=> install boost 1.84.0 .. failed

/var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_30B5E98FD1734C4383CE607874386DE7.cpp:4:22: fatal error: 'boost/algorithm/string.hpp' file not found
#include <boost/algorithm/string.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
${yellow}> in ${bright}/var/folders/28/m1bxpc396210plmjl1kl4gzh0000gn/T/.xmake501/240513/_30B5E98FD1734C4383CE607874386DE7.cpp
if you want to get more verbose errors, please see:
-> /Users/wx/.xmake/cache/packages/2405/b/boost/1.84.0/installdir.failed/logs/install.txt
error: install failed!

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Error when installing boost package

@waruqi
Copy link
Member

waruqi commented May 16, 2024

给下 xmake f -cvD -y 完整 logs

另外,你这 xcode 没装,用的是 CommandLineTools,而 xmake-repo ci 目前仅仅对 xcode 进行压测,所以 CommandLineTools 的环境,不保证一定 ok,我这边也没环境测试。。你可以尝试安装 xcode 后再试试

@waruqi waruqi transferred this issue from xmake-io/xmake May 16, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Error when installing boost package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants