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

unknown extension for .c file #146

Closed
codeling opened this issue Jan 25, 2018 · 2 comments
Closed

unknown extension for .c file #146

codeling opened this issue Jan 25, 2018 · 2 comments

Comments

@codeling
Copy link
Contributor

codeling commented Jan 25, 2018

Not sure why, but since upgrading to latest master (which made compliation with CUDA 9.1 work, thanks for that 👍 ), I get an error in CMake when configuring our project, which is referencing RTK:

CMake Error at <somepath>/rtk/src-git/cmake/FindCUDA_wrap.cmake:94 (try_run):
  Unknown extension ".c" for file

    <somepath>/rtk/src-git/cmake/has_cuda_gpu.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX RC

  See project() command to enable other languages.

If I add C language to our Project such as PROJECT (OurProject Languages CXX C) then it works, but that wasn't required in previous versions of RTK as far as I can tell.

Anybody an idea why this has changed? Adding in C language seems to have other side effects as well so if possible I'd like to avoid it.

@SimonRit
Copy link
Collaborator

Thanks for the report. This is caused by commit 90b25ca I believe but I can't reproduce the error. Which version of cmake are you using?
Maybe you can simply move this file to cxx.

@codeling
Copy link
Contributor Author

codeling commented Jan 25, 2018

I use CMake version 3.10.2.
The suggested fix indeed works. I'm using Visual Studio 2017 15.4.5 (not the latest, 15.5.x, which doesn't work with cuda anymore), maybe that specific version (or in general building for Visual Studio) is what makes a difference?

The "other side effects" I mentioned above seem to come from somewhere else, but I have submitted a pull request for the .c -> .cxx change anyway: https://github.com/SimonRit/RTK/pull/148

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

No branches or pull requests

2 participants