News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Compile errors in Linux 64-bit

Started by steffen, May 08, 2010, 10:03:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steffen

Ok I got the latest git from http://github.com/jamespetts/simutrans-experimental.git and tried to compile it with DEBUG=1. There's a lot of compiler warnings (unrecognised option -NDEBUG and ignoring return value in particular I noticed to pop up dozens of times), one that may be especially relevant in this context is "comparison between signed and unsigned integer expressions". I'm guessing you dont want the whole output tho, right?
In the end it fails tho with this this:
===> CXX simgraph16.cc
g++: unrecognized option '-NDEBUG'
simgraph16.cc: Assembler messages:
simgraph16.cc:2233: Error: suffix or operands invalid for `jmp'
make: *** [simgraph16.o] Error 1

steffen@steffen ~/simutrans-git/simutrans-experimental $ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.4.2/work/gcc-4.4.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/python --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.4.2 p1.0'
Thread model: posix
gcc version 4.4.2 (Gentoo 4.4.2 p1.0)

The uncommented lines in config.default are:
BACKEND = sdl
COLOUR_DEPTH = 16
OSTYPE = linux
FLAGS =  -DSTEPS16 -NDEBUG -DSLIST_FREIGHT
DEBUG=1

I simply typed "make" in the simutrans-experimental directory. Other than creating config.default I made no changes after the git checkout, the exact version is fd325639e88e8ad642d53924123f2668d2d4b5e0

What's going wrong?

steffen

I just installed gcc-4.4.3-r2 and I tried make clean && make but same problem. I'm installing gcc-4.3.4 now as well just to see if thats the problem.

Oh and just for the record I completely agree that 64bit should be lower priority, but its nice and I think also important in the medium-long term to keep going at it with low priority :)

jamespetts

Steffen,

thank you for your report. It's quite hard for me to try to piece together the issues here as I don't have either a Linux system or a 64-bit system on which to test. What's worse, the source file in which you have the error (simgraph16.cc) is not a file that has any differences between Standard and Experimental. The first thing to do, therefore, is to try getting the latest Simutrans-Standard code and see whether there are any differences in result there.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

steffen

Ok I got the latest svn from svn://tron.homeunix.org/simutrans/simutrans/trunk and am getting the same error, but oddly in a different line:
===> CXX simgraph16.cc
g++: unrecognized option '-NDEBUG'
simgraph16.cc: In function 'void rezoom_img(image_id)':
simgraph16.cc:1290: warning: comparison between signed and unsigned integer expressions
simgraph16.cc: Assembler messages:
simgraph16.cc:2370: Error: suffix or operands invalid for `jmp'
make: *** [simgraph16.o] Error 1

This is again with gcc-4.4.3-r2

jamespetts

I have split and moved this topic because the issue is not specific to Simutrans-Experimental.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

steffen

For all future bug reports I'll be sure to check both std and exp :)
Back on topic, a quick diff between the latest exp git version and the latest std svn version reveals 7 pages of differences.

steffen

I forgot to mention, the error persists with gcc-4.3.4 (I only tried experimental but I think its safe to assume the same for std)

ansgar

You have to use -DNDEBUG (not -NDEBUG) and add -DUSE_C (the assembler code is only for x86).

steffen

For USE_C, could you add a note of this to config.template?
As for the debug part, that looks like a typo in config.template, can you change it in there?

But with these two changes it now compiles, thanks :)

prissi

Just see config.template:

# The following conditional compilation flags exist
...
# USE_C: no assembler for copying (when not using x86 and GCC>=3.x)
# BIG_ENDIAN: MUST by set for PPC/Motorola byte order! (old mac, amiga)
#
# In order to use the flags, add a line like this:
# FLAGS = -DUSE_C -DBIG_ENDIAN


I found this fairly clear ...

steffen

Yes you're right, I just searched it for 64 specifically. My bad.

But the "-NDEBUG" still looks like a typo to me?

prissi

I find only -DNDEBUG in the Makefile. Is experimental using an older version?

steffen

The typo is in config.template on the last line

sdog

damnit, completely overlooked this topic, and stumbled over the assembler code yesterday!