Game Development Community

Compiling torque on x86-64 (amd64) non functional?

by Antonio "Tony" Farinetti · in Torque Game Engine · 05/15/2004 (1:57 pm) · 109 replies

After getting the CVS like usual and executing this command:

make -f mk/configure.mk OS=LINUX COMPILER=GCC2 BUILD=DEBUG

and getting this back:

Current Configuration: this config is VALID
         OS: LINUX
   COMPILER: GCC2
      BUILD: DEBUG
    DIR.OBJ: out
 
To change the current configuration type:
 
make -f mk/configure.mk {arguments, ...}
 
required arguments:
  OS={WIN32 BEOS LINUX OpenBSD FreeBSD Solaris}
  COMPILER={CW6 VC6 GCC2 GCC3}
  BUILD={DEBUG RELEASE}
 
optional arguments:
  DIR.OBJ={path to store intermediate obj files}
 
Note: all arguments are case sensitive.

And then issuing make, the compile stops fast with:

tony@tantalus torque $ make
--> Compiling lpng/png.c
cc1: error: CPU you selected does not support x86-64 instruction set
cc1: error: CPU you selected does not support x86-64 instruction set
make[1]: *** [out.GCC2.DEBUG/lpng/png.obj] Error 1
make: *** [default] Error 2

Any ideas on how to fix this?

Thanks!
Page «Previous 1 2 3 4 5 6 Last »
#1
05/17/2004 (9:26 am)
That's mysterious. Any linux guus know what's going wrong here?
#2
05/17/2004 (9:41 am)
Only thing I could find that might help is to edit the conf.UNIX.mk file and change the following lines:

CFLAGS.GENERAL    = -DUSE_FILE_REDIRECT -I/usr/X11R6/include/ -MD -march=i586 \
		    -mcpu=i686 -ffast-math -pipe

To this:

CFLAGS.GENERAL    = -DUSE_FILE_REDIRECT -I/usr/X11R6/include/ -MD -march=x86_64 \
		    -ffast-math -pipe
#3
05/17/2004 (9:41 am)
I can give ya'll whatever info u need about my pc that you need, because I am kinda at a standstill until I get this working, lol.

hope this helps:

root@tantalus tony # emerge --info
Portage 2.0.50-r6 (default-amd64-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040420-r0, 2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 x86_64 5
Gentoo Base System version 1.4.12
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acpi aim alsa amd64 apache1 apache2 apm arts atlas avi berkdb blas cdr crypt cups curl divx4linux dvd dvdr encode esd f77 flash foomaticdb gdbm gif glade gnome gnomedb gphoto2 gpm gsl gtk gtk2 gtkhtml guile imlib java jpeg kde libg++ libwww mikmod motif mozilla mpeg mysql ncurses nls nogcj oggvorbis opengl oss pam pdflib perl png python qt quicktime readline ruby sdl slang spell ssl tcpd truetype xml2 xmms xv zlib"

root@tantalus tony # gcc --version
gcc (GCC) 3.3.3 20040412 (Gentoo Linux 3.3.3-r3, ssp-3.3-7, pie-8.5.3)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@tantalus tony # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 242
stepping        : 10
cpu MHz         : 1603.696
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 3145.72
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts ttp
 
processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 242
stepping        : 10
cpu MHz         : 1603.696
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips        : 3203.07
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts ttp
#4
05/17/2004 (9:45 am)
I took Harolds advice and got this:

tony@tantalus torque $ make
--> Compiling lpng/png.c
cc1: error: bad value (x86_64) for -march= switch
cc1: error: bad value (x86_64) for -mcpu= switch
make[1]: *** [out.GCC2.DEBUG/lpng/png.obj] Error 1
make: *** [default] Error 2

Any more ideas?
#5
05/17/2004 (9:50 am)
Lol, so for giggles I took out the -march= flag and so far, it works until it hits the audio section and then gets:

tony@tantalus torque $ make
...
In file included from platform/types.h:70,
                 from platform/platform.h:10,
                 from platform/platformAudio.h:10,
                 from audio/audio.h:10,
                 from audio/audio.cc:6:
platform/types.gcc.h:89:4: #error "GCC: Unsupported Target CPU"
In file included from platform/platformAudio.h:10,
                 from audio/audio.h:10,
                 from audio/audio.cc:6:
platform/platform.h:136:2: #error "Endian define not set"
In file included from platform/platformAudio.h:10,
                 from audio/audio.h:10,
                 from audio/audio.cc:6:
platform/platform.h:381: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:396: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:397: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
In file included from core/fileStream.h:13,
                 from core/resManager.h:20,
                 from audio/audioBuffer.h:16,
                 from audio/audioDataBlock.h:13,
                 from audio/audio.h:13,
                 from audio/audio.cc:6:
core/stream.h: In member function 'bool Stream::write(short int)':
core/stream.h:148: error: 'convertHostToLEndian' undeclared (first use this
   function)
core/stream.h:148: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
core/stream.h: In member function 'bool Stream::write(int)':
core/stream.h:149: error: 'convertHostToLEndian' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::write(short unsigned int)':
core/stream.h:150: error: 'convertHostToLEndian' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::write(unsigned int)':
core/stream.h:151: error: 'convertHostToLEndian' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::write(float)':
core/stream.h:152: error: 'convertHostToLEndian' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::read(S16*)':
core/stream.h:158: error: 'convertLEndianToHost' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::read(S32*)':
core/stream.h:159: error: 'convertLEndianToHost' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::read(U16*)':
core/stream.h:160: error: 'convertLEndianToHost' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::read(U32*)':
core/stream.h:161: error: 'convertLEndianToHost' undeclared (first use this
   function)
core/stream.h: In member function 'bool Stream::read(F32*)':
core/stream.h:162: error: 'convertLEndianToHost' undeclared (first use this
   function)

continued next post...
#6
05/17/2004 (9:51 am)
In file included from sim/netConnection.h:19,
                 from game/gameConnection.h:16,
                 from audio/audio.cc:11:
platform/event.h: At global scope:
platform/event.h:137: warning: cast from pointer to integer of different size
platform/event.h:140: warning: cast from pointer to integer of different size
platform/event.h:143: warning: cast from pointer to integer of different size
audio/audio.cc: In function 'int loopingImageSort(const void*, const void*)':
audio/audio.cc:161: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'int streamingSourceSort(const void*, const void*)
   ':
audio/audio.cc:193: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'AUDIOHANDLE alxCreateSource(const
   Audio::Description*, const char*, const MatrixF*, AudioSampleEnvironment*)':
audio/audio.cc:706: warning: converting to non-pointer type 'unsigned int' from
   NULL
audio/audio.cc: In function 'ALuint alxGetWaveLen(unsigned int)':
audio/audio.cc:2090: warning: converting to 'unsigned int' from 'F64'
make[1]: *** [out.GCC2.DEBUG/audio/audio.obj] Error 1
make: *** [default] Error 2

It seems as if there is another variable in there set to x86...I'll look around, but if you have any other ideas..

Thanks.
Tony
#7
05/17/2004 (10:11 am)
Take out the -march=x86_64 and try again

EDIT:

OK you tried that while I was doing research....


EDIT 2:

Looking at your error log...

platform/types.gcc.h

//--------------------------------------
// Identify the CPU
#if defined(i386)
#  define TORQUE_CPU_STRING "Intel x86"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN

#elif defined(__ppc__)
#  define TORQUE_CPU_STRING "PowerPC"
#  define TORQUE_CPU_PPC
#  define TORQUE_BIG_ENDIAN

#else
#  error "GCC: Unsupported Target CPU"
#endif

Try adding before the else:

#if defined(__x86_64__)
#  define TORQUE_CPU_STRING "Intel x86-64"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN
#8
05/17/2004 (10:12 am)
Why are you using a 2.9x version of GCC ?
I would have thought that support for new CPU architectures would be in the GCC3 branches, rather than the, quite old by now, Gcc 2 branches ?

Edit : it looks like you're using gcc3 with the gcc2 configuration...
#9
05/17/2004 (10:21 am)
The GCC2 and GCC3 .mk files for Torque are identical
#10
05/17/2004 (11:28 am)
Ah, I guess that's why it wasn't brought up then :)I thought there were differences, and hence why there was two gcc configs
#11
05/17/2004 (11:44 am)
Ok, thats a step in the right direction...

I changed my platform/types.gcc.h to:
//--------------------------------------
// Identify the CPU
#if defined(i386)
#  define TORQUE_CPU_STRING "Intel x86"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN

#elif defined(__x86_64__)
#  define TORQUE_CPU_STRING "Intel x86-64"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN

#elif defined(__ppc__)
#  define TORQUE_CPU_STRING "PowerPC"
#  define TORQUE_CPU_PPC
#  define TORQUE_BIG_ENDIAN

#else
#  error "GCC: Unsupported Target CPU"
#endif

and got this:

tony@tantalus torque $ make
--> Compiling audio/audio.cc
In file included from platform/platformAudio.h:10,
                 from audio/audio.h:10,
                 from audio/audio.cc:6:
platform/platform.h:381: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:396: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:397: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
In file included from sim/netConnection.h:19,
                 from game/gameConnection.h:16,
                 from audio/audio.cc:11:
platform/event.h:137: warning: cast from pointer to integer of different size
platform/event.h:140: warning: cast from pointer to integer of different size
platform/event.h:143: warning: cast from pointer to integer of different size
audio/audio.cc: In function 'int loopingImageSort(const void*, const void*)':
audio/audio.cc:161: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'int streamingSourceSort(const void*, const void*)
   ':
audio/audio.cc:193: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'AUDIOHANDLE alxCreateSource(const
   Audio::Description*, const char*, const MatrixF*, AudioSampleEnvironment*)':
audio/audio.cc:706: warning: converting to non-pointer type 'unsigned int' from
   NULL
audio/audio.cc: In function 'ALuint alxGetWaveLen(unsigned int)':
audio/audio.cc:2090: warning: converting to 'unsigned int' from 'F64'
make[1]: *** [out.GCC2.DEBUG/audio/audio.obj] Error 1
make: *** [default] Error 2

I hope you guys don't mind me pasting all this, I just want other people who have this problem to be able to see exactly whats happening.

Tony
#12
05/17/2004 (12:06 pm)
I think I might have just realized the problem, on 64 bit machines aren't long ints 64 bit? or am I grasping at straws?
#13
05/18/2004 (4:49 am)
Hello,

I don't have a 64 bit machine to help you with but I can try.

#if defined(i386)
#  define TORQUE_CPU_STRING "Intel x86"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN
#elif defined(__x86_64__)
#  define TORQUE_CPU_STRING "Intel x86-64"
#  define TORQUE_CPU_X86
#  define TORQUE_LITTLE_ENDIAN
#elif defined(__ppc__)
#  define TORQUE_CPU_STRING "PowerPC"
#  define TORQUE_CPU_PPC
#  define TORQUE_BIG_ENDIAN
#else
#  error "GCC: Unsupported Target CPU"
#endif

First I would like to recommend that you actually start the process again. The first error in png should be sorted out properly.
I don't know what version comes with torque but you may want to check out the people behind png and see if there is a patch or a new version of png that does support 64 bit processing.

The ENDIAN support may or may not be wrong. I haven't worked with AMDs new 64 bit processor but I would say that it should be BIG_ENDIAN. That is the case with any 64 bit processors that I have worked with.

Also the last thing, defining the cpu type as TORQUE_CPU_X86 is likely not a good idea. This is a new type of processor and it will likely need a way to identify the processor.

Your best bet is to change the ENDIAN size to big, change the cpu type to TORQUE_CPU_AMD64 and then grep the source code for TORQUE_CPU_X86. For most locations the x86 code in each place should be fine so you can do #if x86 or amd64.

Hope that helps.
Ben
#14
05/18/2004 (5:11 am)
Hello,

Ok, scratch all the endian stuff. I will have to look at amds 64 bit processor. I just found a new article that had a different explanation of big and little endian.

www.gamedev.net/reference/articles/article2091.asp

Later, Ben
#15
06/01/2004 (10:24 am)
Well according to AMD:
http://www.amd.com/us-en/assets/content_type/DownloadableAssets/dwamd_26569.pdf

The x86 and AMD64 architectures address memory using littleendian byte-ordering. Multibyte values are stored with their least-significant byte at the lowest byte address, and they are illustrated with their least significant byte at the right side. Strings are illustrated in reverse order, because the addresses of their bytes increase from right to left.

So I'm guessing its little endian
#16
06/07/2004 (2:34 pm)
I am about to update my cvs version and how it works?
#17
06/07/2004 (2:37 pm)
As of today, this is the only error I get:

tony@tantalus torque $ make
--> Compiling audio/audio.cc
In file included from platform/platformAudio.h:10,
                 from audio/audio.h:10,
                 from audio/audio.cc:6:
platform/platform.h:381: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:396: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
platform/platform.h:397: error: 'operator new' takes type 'size_t' ('long
   unsigned int') as first parameter
In file included from sim/netConnection.h:19,
                 from game/gameConnection.h:16,
                 from audio/audio.cc:11:
platform/event.h:137: warning: cast from pointer to integer of different size
platform/event.h:140: warning: cast from pointer to integer of different size
platform/event.h:143: warning: cast from pointer to integer of different size
audio/audio.cc: In function 'int loopingImageSort(const void*, const void*)':
audio/audio.cc:161: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'int streamingSourceSort(const void*, const void*)
   ':
audio/audio.cc:193: warning: converting to 'int' from 'float'
audio/audio.cc: In function 'AUDIOHANDLE alxCreateSource(const
   Audio::Description*, const char*, const MatrixF*, AudioSampleEnvironment*)':
audio/audio.cc:706: warning: converting to non-pointer type 'unsigned int' from
   NULL
audio/audio.cc: In function 'ALuint alxGetWaveLen(unsigned int)':
audio/audio.cc:2090: warning: converting to 'unsigned int' from 'F64'
make[1]: *** [out.GCC2.DEBUG/audio/audio.obj] Error 1
make: *** [default] Error 2
#18
06/11/2004 (7:01 am)
I now have access to a AMD64 machine..

Here is what I discovered so far.
platform/platform.h:381: error: 'operator new´ takes type 'size_t´ ('long unsigned int´) as first parameter

dsize_t typedef needs adjustment. (it should unsigned long I believe).

platform/event.h:137: warning: cast from pointer to integer of different size

Offset macro needs to be written for the platform.

also

The #define TORQUE_SUPPORTS_GCC_INLINE_X86_ASM
(or you could port the asm)

needs to be undefined. (All the inline asm assumes 32bit which won't work, gas barfs big time on it.)

The above will get you to this:
--> Compiling platformX86UNIX/x86UNIXCPUInfo.cc
In file included from platformX86UNIX/platformX86UNIX.h:15,
                 from platformX86UNIX/x86UNIXCPUInfo.cc:9:
platform/event.h:137: warning: cast from pointer to integer of different size
platform/event.h:140: warning: cast from pointer to integer of different size
platform/event.h:143: warning: cast from pointer to integer of different size
{standard input}: Assembler messages:
{standard input}:172: Error: suffix or operands invalid for 'push'
{standard input}:173: Error: suffix or operands invalid for 'push'
{standard input}:177: Error: suffix or operands invalid for 'pop'
{standard input}:178: Error: suffix or operands invalid for 'pop'
{standard input}:191: Error: suffix or operands invalid for 'push'
{standard input}:192: Error: suffix or operands invalid for 'push'
{standard input}:197: Error: suffix or operands invalid for 'pop'
{standard input}:198: Error: suffix or operands invalid for 'pop'
make[1]: *** [linux.out.GCC3.RELEASE/platformX86UNIX/x86UNIXCPUInfo.obj] Error 1make: *** [default] Error 2

Seeing as thats assembly stuff I'm stuck there.

Oh and this should be helpful:
http://www.amd.com/us-en/assets/content_type/DownloadableAssets/Software_Porting_-_Rich_Brunner.pdf

If you want to compile it as a 32bit application you can replace the march and mcpu stuff to -m32 However you will need to re-build all the dependant libs as 32bit apps.
#19
06/11/2004 (4:33 pm)
@GG: Are there any staff developer cycles going on for this platform? We're progressing on the port, but didn't want to duplicate any effort if it is being worked on from your side as well.

Thanks!
#20
06/11/2004 (4:34 pm)
Those aren't the errors I'm getting so yet I'm still stuck...
Page «Previous 1 2 3 4 5 6 Last »