News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Compiler Refuses to USE .cu file

Started by virati, August 18, 2009, 03:51:55 PM

Previous topic - Next topic

virati

Let's say I have three files: test.h, test.c and kernels.cu. I'm using CUDA in this project and have the nvcc compiler set up right (it compiles some test projects I've tried without flaw) within code::blocks.

I initialize cuda_setup() in test.h and then declare cuda_setup() in kernels.cu. The compiler compiles everything, including the .cu file, into an object file but then seems to refuse to actually link it together with the rest of the project. If i put the cuda_setup() declaration in another .c file of the project I have no problems and if I rename the .cu file into a .c file while removing the CUDA kernel I have no problem.

If I make any errors in the .cu file it complains at me and I can see that it makes a kernels.o file. I'm at a complete loss for what I have to do to get my project to use the .cu file. I'm thinking its a problem with how Code::Blocks sets up the command to link .cu files but I can't seem to get any information about that from the interface.

I'm trying to solve this problem by making my own Makefile but am running into a host of other problems. Is there a way I can see what command Code::Blocks is actually using to compile my project?

MortenMacFly

Quote from: virati on August 18, 2009, 03:51:55 PM
I'm trying to solve this problem by making my own Makefile but am running into a host of other problems. Is there a way I can see what command Code::Blocks is actually using to compile my project?
See my sig accordingly. (Full command log.)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]