Use nvcc compiler

General questions regarding the usage of CodeLite
Ivans
CodeLite Curious
Posts: 2
Joined: Thu Oct 11, 2018 1:49 am
Genuine User: Yes
IDE Question: C++
Contact:

Use nvcc compiler

Post by Ivans » Thu Oct 11, 2018 1:55 am

How can I define that some files must be compiled by nvidia nvcc compiler and not by gcc or clang?

User avatar
eranif
CodeLite Plugin
Posts: 5812
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Use nvcc compiler

Post by eranif » Thu Oct 11, 2018 12:49 pm

You can not change the compiler per file.
You can however, set a new compile line for files with a unique extension.
For example, CodeLite is building .rc files using the resource compiler
This is configurable and can be changed from: settings->build settings->compilers->YOUR COMPILER->Files type tab
Make sure you have read the HOW TO POST thread

Ivans
CodeLite Curious
Posts: 2
Joined: Thu Oct 11, 2018 1:49 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Use nvcc compiler

Post by Ivans » Mon Oct 15, 2018 4:46 pm

Yes,
But there is a compiler type definition in project's settings. So even if I have added 'nvc'c as an additional compiler into codelite global settings, will it use nvcc if it sees *.cu files but project settings says use GCC compiler?

User avatar
eranif
CodeLite Plugin
Posts: 5812
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Use nvcc compiler

Post by eranif » Thu Oct 18, 2018 11:15 pm

The name is just a symbolic tool. You can define a tool per *file* type. i.e, the sane "compiler" can be used different tools to compile different file types
Make sure you have read the HOW TO POST thread

Gibbon1
CodeLite Expert
Posts: 164
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Use nvcc compiler

Post by Gibbon1 » Fri Oct 19, 2018 2:54 am

I saw this thread, was wondering currently the codelite supports a debug and release build. Would be possible to extend this to re-targeting to a different compiler? Because you can include and exclude files based on debug and release. So instead of build debug/release, you could have build gcc, build nvcc etc.

The other way to handle this is to create separate projects under the same workspace. This is how one of my projects is set up since I'm using a common code base to build firmware for several different board. My projects each have a build directory with a project file and local configuration files. And you can also use the include directory list to select project specific headers.

Post Reply