How to get Cuda to use gcc 4.6 - gcc

I am trying to install Cuda on my machine and as usual it causes problem with gcc 4.7 when trying to run the installer.
I have now installed gcc 4-6 which should work and I am now thinking about the best way to install CUDA.
I have thought about creating a symlink to gcc-4.6 so that the installer uses version 4.6 instead of 4.7.
Do you have any suggestions to do that or is there a better solution? It feels a bit stupid erase 4.7 from the machine in order to use cuda.
Thanks in advance!
/ Erik

Another solution to your problem is to download CUDA 5.5, which works with gcc 4.7. It is currently only available to CUDA registered developers: link to forum announcement

Create alternatives so that you can switch between versions at any time check out this helpful page:
How to change the default GCC compiler in Ubuntu?

Related

gcc 4.6 on mac, how do I get it to work?

I am having problems getting gcc 4.6 to run on Mac 10.8.5.
My experience with such matters is very limited and I have been searching around and trying different things to get this to work, but to no avail. I am sorry if the answer to this problem is really simple (I actually hope that it is!)
This is my problem:
I need to run a bit of software to do an analysis, called Bayescan. This bit of software requires a library found as part of gcc4.6 to run on a MacOSX. They say so on their distribution pages (http://cmpg.unibe.ch/software/BayeScan/download.html)
I have now installed gcc4.6 using homebrew*.
However, this does not solve my problem. As I still get the following error message when I try to run the software:
dyld: Library not loaded: /usr/local/lib/libgomp.1.dylib
Google tells me that libgomp.1.dylib is part of gcc46.
When I type: gcc --version, I get:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
This leaves me to believe that when my computer is looking for gcc, it looks for the old version which lacks the required library. Or gcc4.6 is not installed correctly.
So I have two questions:
1) Is my assumption/conclusion correct?
2) How do get my computer to point to gcc4.6?
Thank you in advance for any help that you can provide. This issue is driving me a little crazy.
Is there a good resource for learning how to build environments and organise dependencies, as it is a problem that I often encounter?
(*I was advised to use homebrew but I think its a bit of a waste of time for me as my computing knowledge is not sufficient for it to be a useful tool for me as the documentation is pretty limited).
You need to point your software to use the right GCC. The gcc46 installation probably put the compiler binary at /usr/local/opt/gcc46/bin/gcc-4.6 or perhaps at /usr/local/bin/gcc-4.6, depending on installation options, so use whatever option is available to make it use that compiler.
Thank you for your answers.
I managed to find out the problem and have the software running. I did two things:
1) As suggested, alter my $PATH so that it pointed at the correct gcc compiler, which was a matter of finding where homebrew had placed the link usr/local/lib/ so I pushed that to the front of $PATH
2) Also, I had to locate where homebrew had installed the library libgomp.1.dylib, and I then made a link to that within usr/local/lib
Thanks again!

install and use GCC in windows 7 x64

I am new to GCC, don't know much about it. I want to install it on my Windows 7 64bit PC and use it for C, C++ and Java. The latest version is GCC-4.8.0. In their mirror links, I am getting option to download gcc 4.8.0.tar.bz2 and gcc 4.8.0.tar.gz and md5.sum. Please guide me, how should i proceed, to use GCC
On Windows, easiest way to get gcc is to install MinGW.
Most recent MinGW release has support for gcc 4.8 as well - but it may be not very stable at the moment.
These files are source archive files of the latest released GCC compiler.
As a newbie, you probably want a binary distribution, e.g. mingw or cygwin on Windows. (Then you might get an earlier version of GCC. 4.8 has just been released)
Alternatively, consider switching to Linux and install it on your machine. It will teach you a big lot (and almost all of Linux is free software so you can get its source code and study it).
Using Linux and GCC also gives you a significant advantage: you could use GCC plugins, e.g. develop your own MELT extension (MELT is a domain specific language to extend GCC, implemented as a [meta-]plugin). Neither Mingw nor Cygwin support GCC plugins.
PS. compiling GCC from source code is not easy for a newbie.
this is an older question but this was harder to search for than it should have been so I will post it here, http://gcc.gnu.org/wiki/WindowsBuilding is a quick guide to getting gcc4.8 running on windows. I am about to dive in to building it on my old windows-xp box. wish me luck.
I use codeblocks . You can follow this Youtube video for instructions:). Hope it helps!
http://www.youtube.com/watch?v=nNeySMSW8qU
You should really check out Code::Blocks (http://codeblocks.org/).
It's a good IDE which is easily set up to get you started.
To support Windows 64-bit though you should not use the MinGW compiler that comes with it. Instead get a separate binary of MinGW-w64 with 64-bit support.
You can get it from http://winlibs.com where you can also find tips on how to configure both Windows 32-bit and 64-bit compilers.

how to get started with cilk++

I want to use cilk++ for writing parallel code. I want to know the the simplest way to get started either in windows or ubuntu 10.04.What should I istall to get started with cilk++.
Thanx.
cilk++ is an earlier implementation of the Cilk extension to C++. It is no longer supported.
Cilk has been implemented in the Intel Composer XE C++ compiler, as well as the "cilkplus" branch of GCC.
I'd start with the article http://www.cilkplus.org/which-license at the Cilk Plus website. Be aware that the "cilkplus" branch of GCC is off of the GCC 4.8 stream, which is under active development.
Barry Tannenbaum -
Intel Cilk Plus Runtime Development
Go here.
Cilk Plus OSS Website

How do I compile a crosscompiler targeting Linux x64 on a Windows host?

I am planning on harvesting my gaming HTPCs spare cycles for compiling my software using distcc, but I will need to set up a cross compiler. The problem is that Google is sadly lacking in relevant information.
I think Cygwin is the purest form of evil, but is the easiest way of doing what you want.
You will just have to install the correct version of gcc from the cygwin installer.
This website has the answer here

installing gcc on vista

I downloaded gcc 4.4.0 and unzipped it to C:\Program Files\gcc
forgive me for being a novice, but...now what? I read the install readme file but it's over my head. how do i get it to work?
If it were me, I would just start with cygwin in the first place. If you do, most of the Unix/Linux/BSD faq's and tutorials will "just work".
If you're new to gcc and want to start using it on Windows, I highly recommend the MinGW GUI installer.
If you want to do C/C++ programming for fun, Mingw is the simpler way to go about it. You'll also need some libraries to get you started.
Try: http://nuwen.net/mingw.html
It's a Mingw distribution based on GCC 4.3.3
It also contains: binutils, boost (with compiled headers), SDL, libbzip, libjpeg, libvorbis, freetype, and many other libraries.
EDIT: I'm not sure if any of the precompiled stuff will work on Vista. I've only tried it on WinXP.
If you want to Install, you can install Dev C++, which is actually MinGW with GUI. Dev C++ can probably be clubbed wth cygwin too though I havn't tried it out ever.
Even if the name says C++ in Dev C++, don't worry. I have tried and it does compile C programs as well. I am recommending Dev C++ because most people on Windows have a habit of using GUI for everything in contrast to be people from *nix background.
You can download it from here
It also includes GDB which is the debugger you can use. If you are don't know how to use gdb this tutorial can come handy.
Another aspect of Dev C++ is that it's development has probably ceased as no new versions have been released since Feb,2005 which is more than 4 years. People still use Dev C++ as it does it's job right. The latest version has GCC 3.4.2 bundled with it.
If you are interested in running the most latest or using newer versions of gcc, then you should try out wxDev C++ is an extension of Dev C++. The latest RC was made available somewhere in 1 yr back. It even has in built CVS support
Now since you require GCC 4.4.0 , it is available on MinGW site. Try to replace the older gcc dll in Dev C++/wxDev C++ with the newer one from this site.
You will edit the environment variable "PATH" to include C:\Program Files\gcc\bin.
(source: justrealized.com)
Then you can use gcc just like in Linux.

Resources