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

Comments

Projects
None yet
2 participants
@chenzhekl
Copy link
Contributor

chenzhekl commented Dec 19, 2018

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

chenzhekl commented Dec 19, 2018

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

@chenzhekl

This comment has been minimized.

Copy link
Contributor Author

chenzhekl commented Dec 20, 2018

Works as expected now.

@chenzhekl chenzhekl closed this Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.