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

ldflags /INCLUDE:?warp_size@cuda@at@@YAHXZ can not be added directly #5694

Open
xq114 opened this issue Oct 8, 2024 · 1 comment
Open

ldflags /INCLUDE:?warp_size@cuda@at@@YAHXZ can not be added directly #5694

xq114 opened this issue Oct 8, 2024 · 1 comment
Labels

Comments

@xq114
Copy link
Contributor

xq114 commented Oct 8, 2024

Xmake 版本

2.9.5

操作系统版本和架构

Windows 11

描述问题

windows上加上述ldflags的时候会被xmake忽略,必须使用{force = true}才能加上;然而-v里显示xmake并未去检测这个flag,直接就忽略了,这个行为不对

期待的结果

不使用{force = true}也能正常为msvc添加ldflags

工程配置

set_project("toytrain")
set_languages("cxxlatest")

add_rules("mode.debug", "mode.release")
set_runtimes("MD")

add_requires("cmake::Torch", {system = true, configs = {envs = {CMAKE_PREFIX_PATH = "C:\\Users\\xq114\\Downloads\\libtorch"},
                                                        presets = {CMAKE_BUILD_TYPE = "Release"}}})

target("toytrain")
    set_kind("binary")
    add_packages("cmake::Torch")
	add_files("src/main.cpp")
    add_ldflags("/INCLUDE:?warp_size@cuda@at@@YAHXZ", {force = true})

附加信息和错误日志

#5674

@xq114 xq114 added the bug label Oct 8, 2024
@Issues-translate-bot
Copy link

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


Xmake version

2.9.5

Operating system version and architecture

Windows 11

Describe the problem

When adding the above ldflags on Windows, it will be ignored by xmake, and {force = true} must be used to add it; however, -v shows that xmake does not detect this flag and just ignores it. This behavior is wrong.

Expected results

You can add ldflags to msvc normally without using {force = true}

Project configuration

set_project("toytrain")
set_languages("cxxlatest")

add_rules("mode.debug", "mode.release")
set_runtimes("MD")

add_requires("cmake::Torch", {system = true, configs = {envs = {CMAKE_PREFIX_PATH = "C:\\Users\\xq114\\Downloads\\libtorch"},
                                                        presets = {CMAKE_BUILD_TYPE = "Release"}}})

target("toytrain")
    set_kind("binary")
    add_packages("cmake::Torch")
add_files("src/main.cpp")
    add_ldflags("/INCLUDE:?warp_size@cuda@at@@YAHXZ", {force = true})

Additional information and error logs

#5674

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

2 participants