Author Topic: Compiler Refuses to USE .cu file  (Read 3264 times)

virati

  • Guest
Compiler Refuses to USE .cu file
« on: August 18, 2009, 03:51:55 pm »
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?
« Last Edit: August 18, 2009, 03:56:42 pm by virati »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiler Refuses to USE .cu file
« Reply #1 on: August 18, 2009, 04:38:12 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ