mayingzhen / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

OptimalOptions.cmake assumes x86_64 implies athlon64 #188

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When compiling 0ad/pyrogenesis (which uses NVTT) under Linux using gcc 4.6.3 on 
a Pentium D 820 processor, the resulting binary crashes almost immediately due 
to an unsupported instruction.

src/cmake/OptimalOptions.cmake contains the following lines; -march=athlon64 is 
not valid on a Pentium D despite it being x86_64. Removing this section from 
the file and recompiling resolves the problem.

IF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64")
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64")
                #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64 -msse3")
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64")

Original issue reported on code.google.com by francis....@gmail.com on 5 Apr 2013 at 1:28

GoogleCodeExporter commented 8 years ago
If using gcc version >= 4.2 then I recommend using -march=native, that will 
automatically set all the compiler options supported by your hardware.

Original comment by cast...@gmail.com on 25 Jun 2013 at 5:14

GoogleCodeExporter commented 8 years ago
Using -march=native may help in this case but the risulting binaries won't work 
on any other CPU, leading for sure to other bug reports difficult to identify 
(all Linux distribution will break). Who want to use native and other system 
specific features can enable them theirself (see Gentoo users), anyway this 
usually leads to very small performance gain, especially on 64 bit platforms 
where the base CPU is not so old as the 386 on 32 bit.

So I'd really won't use native and suggest to remove the -march as soon as 
possible. 

Original comment by pedretti...@gmail.com on 2 Sep 2013 at 7:26

GoogleCodeExporter commented 8 years ago
Both 0 A.D. and Debian are removing the -march:
http://trac.wildfiregames.com/changeset/13806
http://anonscm.debian.org/gitweb/?p=collab-maint/nvidia-texture-tools.git;a=comm
itdiff;h=a60628ce464bfebdc7237479b5bff3e0c60ffc10

Original comment by pedretti...@gmail.com on 7 Sep 2013 at 5:38