C++ compilers on Linux supporting 64bit architecture?
Chris Jones
jonesc at hep.phy.cam.ac.uk
Sat Sep 1 10:52:48 UTC 2007
> 1) Is it possible to cross-compile on Linux 32 bit to produce an
> executable for the 64bit architecture Linux as well as 32 bit?
No, I don't think a 32bit only processor can produce 64bit binaries. The other
way around is possible, if you run a 64bit version of Linux, you can produce
32bit binaries. With gcc you simply use the command line flag -m32.
>
> 2) Can we expect an improvement in performance of such a command line
> (no GUI) program in Linux compared to Windows? The program performs
> massive math calculations and has been optimized to use the available
> resources well.
I work on a similar sort of math intensive project, that does support windows
and linux, and only linux we use both 32 and 64 bit builds. The 64 bit builds
run ~30% faster than the 32bit builds on the same machine. Note though, a lot
of this improvement doesn't come from the 32-64 bit change, but likely other
things the compiler does in 64 bit mode. I.e., the compiler knows that *all*
64 bit machines have SSE2 instructions, and so by default enables this
(-mfpmath=sse). Not all 32 bit nodes have SSE instructions so the compiler
does not enable this there. However, if you know your 32 bit nodes do have
SSE you can enable this by hand, and get 32 speeds much closer to the 64 bit
ones.
>
> 3) The program is written in C++, would there be big porting issues
> moving it from Windows to Linux, code-wise?
Depends. My experience is yes, there are lots of little gotchas that can come.
Depends exactly what external packages (STL, boost, etc.) you use and how
deeply etc.
Chris
>
> I understand that this is not a Fedora question per se, but since
> Fedora is such a popular distribution I thought that the comparison
> and development questions may fit here anyway. Sorry if you all
> disagree...
>
> Grateful for any comment though.
>
> Bo Berglund
More information about the users
mailing list