• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C++ compilers for os x and linux

Carlis

Senior member
Hi

I am to do some mathematical programming/simulations this spring and I don't want to use fortran since my own computer don't really agree with my labs about what the source should look like.

Now, I would like to be able to work on and test my source both on my own computer, a mac (G4) as well as the computers at the lab (x86 linux).

I have never worked with any C-language before. My impression is that c++ is very much standardized. Do I have to take any special precautions (like choice of compilers) to have 100% compatible source? I am up to mathematical programming, so it will only write logic stuff.

Regards, Carlis
 
Luckily Linux and OS X are quite similar. I would recommend you use g++ as your compiler, stick as strongly as you can to standard C++, and only use posix library calls.
 
Seconded degibson's opinion. GCC is a pretty good free compiler and should be able to do everything you need.

If you need more speed, remember to change the compiler options to optimize for the system you are using (IE, -O3 -march=nocona -vectorize-trees -funroll-loops ect). If that doesn't do it for you, give the ICC a try. It generally performs better the gcc in most compiling situations (and I think they have a mac version as well) The professional version of the ICC isn't free, but the personal/non-commercial version is.
 
Originally posted by: Cogman
Seconded degibson's opinion. GCC is a pretty good free compiler and should be able to do everything you need.

If you need more speed, remember to change the compiler options to optimize for the system you are using (IE, -O3 -march=nocona -vectorize-trees -funroll-loops ect). If that doesn't do it for you, give the ICC a try. It generally performs better the gcc in most compiling situations (and I think they have a mac version as well) The professional version of the ICC isn't free, but the personal/non-commercial version is.

Don't use -march=nocona unless both target machines are Core 2 Duo.
 
Back
Top