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

[BUG]: CMake bigobj option incompatible with nvcc #3883

Closed
2 of 3 tasks
LXLWDGY opened this issue Apr 18, 2022 · 2 comments · Fixed by #3947
Closed
2 of 3 tasks

[BUG]: CMake bigobj option incompatible with nvcc #3883

LXLWDGY opened this issue Apr 18, 2022 · 2 comments · Fixed by #3947

Comments

@LXLWDGY
Copy link

LXLWDGY commented Apr 18, 2022

Required prerequisites

Problem description

The cmake compile options for pybind11 currently adds a /bigobj option if MSVC is used, as can be seen here:

PROPERTY INTERFACE_COMPILE_OPTIONS /bigobj)

This is problematic if the language is in anything other than C++, which in my case was CUDA. The nvcc compiler does not recognize /bigobj (or at least I think this is what happens) and therefore raises an error:

[Nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified]

There is a very similar issue raised here, which details a bug concerning /MP:
#1532 (comment)

There are a lot of similar bugs if you care to google, and the consensus (whenever there is one) seems to be that /MP and /bigobj are the culprits. I personally have solved this problem by simply changing the line to, but I'm not certain whether this is the best fix:
PROPERTY INTERFACE_COMPILE_OPTIONS $<$<NOT:$<CONFIG:Debug>>:$<$<COMPILE_LANGUAGE:CXX>:/bigobj>>)

Reproducible example code

No response

@LXLWDGY LXLWDGY added the triage New bug, unverified label Apr 18, 2022
@Skylion007 Skylion007 added compiler issue build system and removed triage New bug, unverified labels Apr 19, 2022
@Skylion007
Copy link
Collaborator

@henryiii This seems like your domain.

@henryiii
Copy link
Collaborator

That seems like a reasonable fix.

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

Successfully merging a pull request may close this issue.

3 participants