add c++ compiler, linker flags to nsight eclipse 6.5 in ubuntu - c++

I started using nsight eclipse 6.5 with cuda 6.5 under ubuntu 14.04 for gpu development purposes. But now I'm confused with the toolchains. How to add g++ support to the project and pass linker flags that are used by certain c++ libraries.
It seems that the toolchain consists only nvcc (I can't see any g++/gcc there?)
How to put them in my project?
Thanks

OK I've solved it. I needed to put these flags to the nvcc compiler -> misc settings. Then it works.

Related

Codeblocks can't find Intel C++ compiler (Linux Mint)

Codeblocks (v13.12) can't find my installation of the Intel C++ compiler.
I have the bundled version of icc that comes with Composer XE, which I believe is the only way to currently get it. When I go into Codeblocks' toolchain settings I see that it is looking for it in "/opt/intel/cc/9.0" which is wrong. When I try to change this to the actual path to my icc ("/opt/intel/composer_xe_2013_sp1.3.174/bin/intel64") it says that it still can't find it.
Has anyone gotten the current icc to work with the current Codeblocks?
I am not an expert. I will provide my settings so that hopefully it will work for you:
settings-->compiler debugger-->toolchain executables-->Compiler's installation directory:
/opt/intel/composer_xe_2013/sp1
C: compiler icc
C++ compiler icpc
Linker for dyn icpc
linker for static ar
debugger: idb
settings-->compiler debugger-->search directories
/opt/intel/composer_xe_2013_sp1.3.174
I have code:blocks 10.05 on ubuntu 12.04. Hopefully this helps/works for you or someone else!

GNU GCC compiler updating

I'm using code blocks with gnu gcc compiler. But when I try to compile a range base for startment it gives many errors. So I think the compiler dosn't support C++0x. So I want to know how to know the compiler version I'm using and how to update it correctly to a C++0x supporting one. I'm using Windows XP.
This algorithm may help to start with programming with C++11 on Windows:
1) Go to http://mingw.com and download the latest MinGW distribution,
install it
2) Download the CodeBlocks installer, install it. During installation
it should detect GCC installation and propose to use it as default
compiler, accept this.
3) Start a new CodeBlocks project, go to
Project -> Properties -> Build options -> Compiler settings ->
Compiler flags, then set flag "Have g++ follow the coming C++0x ISO
C++ language standard"
4) Compile your first C++11 project and have
fun!
By the way, the latest MinGW g++ is of version 4.6.1 as for now, so it has to support most of C++11 features.

Know g++ Version of Code blocks in Windows

I am solving questions on Interviewstreet.com. They said they use C++ version g++ 4.6.3,C0x mode.
I am writing code on code blocks. So i want to know which version iam using in code blocks is it in C0x mode or C11 mode??
I have tried using g++ --version i got g++ TDM-2 mingw32 4.4.1.Can u tell me where i can get this kind of information.
what is the difference between C++ 0x and C++11??
You'll have to update the version of g++ to 4.6.3 (or later) if you want to use c++11 features. See this question and it's answers on how to do it for deb linux.
Then you'll have to pass --std=c++0x to the compiler in options. You should be able to easily find them in codeblocks.
what is the difference between C++ 0x and C++11??
c++0x is a synonym for c++11.
The command:
g++ --version
gives you the version of your g++ or mingw compiler. Since you got g++ TDM-2 mingw32 4.4.1 then your version is 4.4.1. If you want to use version 4.6.3 as in that web site, then you would have to update.
It wouldn't hurt to use a newer than 4.6.3 version of mingw, so please see here for the latest version. This page offers an windows installer for mingw.
After installation, you would have to configure CodeBlocks to use the newly installed compiler by looking into Compiler and debugger settings -> Toolchain executables tab and setting the paths for the compiler-related executables to the new ones.
Hope this helps.
EDIT:
Here is a small tutorial/example of what the CodeBlocks settings look like.

Searching for a C/C++ IDE for OS X that can use a custom gcc installation

I'm on OS X 10.7.2 "Lion", and I'm developing a C program that has to use some OpenMP 3.0 specific functionalities. Therefore, gcc 4.2.1 is not enough for me, I need gcc 4.4 or better.
I downloaded MacPorts and easily installed gcc 4.4. Running it from the command line just works fine, and compiles my OpenMP 3.0 C program with no hassle.
But it's quite annoying for me to edit the source in Xcode or TextWrangler and compile it from the command line. So I tried Code::Blocks, which took me 1 hour trying to make it work under OS X, but it crashes anytime for no reason. Then I tried Eclipse, but it sticks on using gcc 4.2.1 even if gcc 4.4 is installed and can be run from the command line. Finally, I tried MonoDevelop, which uses gcc 4.2.1 as well and I just can't see how can I force it to use my favourite gcc version.
What I'm kindly asking you is: is there any decent C/C++ IDE for OS X that I can use which will let me to specifiy what gcc version to use (just like Code::Blocks under Windows) without horrible workarounds and/or breaking gcc 4.2.1 (I need it up and working for Xcode)?
Thanks in advance.
You should be able to use your gcc with Xcode, without breaking the existing gcc toolchain. Follow these instructions (which describe how to use a custom clang build, but the same principle applies to gcc).
Eclipse is OK, it can be configured to use any compiler (or several at once or whatever).
it sticks on using gcc 4.2.1 even if gcc 4.4 is installed and can be run from the command line.
If you want a global setting, then go to C/C++ / Build / Environment in your preferences and set its PATH to wherever your favourite GCC is.
If you want to be more specific, you can edit a specific project's preferences, for instance:
C/C++ Build / Environment -> Environment variables to set (there you can find and customize the final PATH that your compilation will use, per build configuration)
C/C++ Build / Settings -> GCC C++ Compiler (and others) - there you can customise the exact binary file of the compiler to execute (defaults to just g++), again per build configuration.
This even lets you have a project with 2 build configs, one for GCC 4.2 and one for GCC 4.4 for instance.

How to compile a C++0x code on Eclipse CDT on mac?

Can someone point to flags and setup changes required for one to compile C++0x code on a Eclipse CDT on mac please ?
To use C++0x in Eclipse CDT on OSX (in a managed make project):
Open the project properties
C/C++ Build
Settings
Change the "Command" field in "MacOS X C++ Linker" and in "GCC G++ Compiler" from g++ to c++ (before check that c++ is clang++ with "c++ --version" in a shell)
Add "-std=c++0x -stdlib=libc++" in the "Miscellaneous" parameters of "GCC G++ Compiler"
Add "-stdlib=libc++" in the MIscellaneous "Linker flags" parameters of "MacOS X C++ Linker"
Open the "Discovery options", select the "GCC C++ compile" change g++ to c++ and add -std=c++0x to the "Compiler invocation arguments"
Add "/usr/include/c++/v1" to the "includes" in "Paths and Symbols" in C/C++ General
The latest Apple gcc compiler is gcc 4.2 which does not support C+11 code. You need to install a gcc 4.6 - this can be done from source or there are some binaries at hpc this put the gcc in /usr/local/bin Then use that in the preferences fot the C++ compiler in eclipse.
Alternative for Lion and above Xcode 4.* includes clang the latest version of which doies much of C+11
If you want a later gcc macports (and fink and homebrew) have a later version as a port. As of July 2012 macports has 4.7.1 and a 4.8 beta. The package managers are often the easiest way to get complex compiled code onto your machine and they also have centrally compiled versions that will be downloaded by default.