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

CUDA target doesn't respect external packages' add_includedirs #296

Closed
chenzhekl opened this issue Dec 19, 2018 · 5 comments
Closed

CUDA target doesn't respect external packages' add_includedirs #296

chenzhekl opened this issue Dec 19, 2018 · 5 comments
Labels
Milestone

Comments

@chenzhekl
Copy link
Contributor

Per the title, when compiling *.cu files with nvcc, include directories set by external packages are not added as -Ixxx to the compiler flags.

@waruqi
Copy link
Member

waruqi commented Dec 19, 2018

This should be no problem. I have tested it before.

You can try compiling this example. https://github.com/tboox/xmake/tree/master/tests/projects/cuda/console

If there is still this problem, I'll look at it later.

@chenzhekl
Copy link
Contributor Author

chenzhekl commented Dec 19, 2018

It's a bit different from my case. I created a directory thirdparty to store dependencies, and called add_packagedirs("thirdparty") in the project's xmake.lua.

In one of the denpendencies:

-- In xmake.lua

option("xxx")
    -- ...
    -- This line doesn't work.
    add_includedirs("xxxxx")
    -- ...

and in the project's xmake.lua:

-- ...
add_packagedirs("thirdparty")
-- ...

target("xxx")
    -- ...
    -- This line doesn't make include directories from "xxx" visible to `nvcc` compiler.
    add_packages("xxx")
    -- ...

Do I misunderstand something?

@waruqi
Copy link
Member

waruqi commented Dec 19, 2018

I have fixed it, you can update dev branch and try it again. 3cd27c6

@waruqi waruqi added the bug label Dec 19, 2018
@waruqi waruqi added this to the v2.2.4 milestone Dec 19, 2018
@chenzhekl
Copy link
Contributor Author

@waruqi Thank you for such a quick fix! I'll test it tomorrow in the lab.

@chenzhekl
Copy link
Contributor Author

Works as expected now.

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