News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Compiling No-Graphics server in linux

Started by deMangler, May 17, 2011, 01:18:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deMangler

Hi,
I have been trying to compile a Compiling No-Graphics linux binary executable from the git repository.

I am using the options

BACKEND='posix' COLOUR_DEPTH=0 OSTYPE='linux'  

which from the makefile seem to be good for the options for the no graphics server.

However I am getting a LOT of undefined reference to *various display_ stuff* failure going on.

I can compile ok with options BACKEND='posix' COLOUR_DEPTH=16 OSTYPE='linux'  

Which would indicate I have a sane environment with all the libs I need.

So I am probably getting the options wrong.

Sorry - I am new to trying to compile simutrans.
Any help appreciated. Thanks.

dM

prissi

Sounds like the experimental Makefile is missing some of the later changes from standard. Or missing simgraph0.cc entirely; or rather its missing some of the changes from standard.

deMangler

simgraph0.cc is there.

I will keep playing with it. I get the feeling there are lots of changes going on with experimental at the moment so I wouldn't expect to be able to chase down anything complicated with my severely limited experience of simutrans.

I was hoping it would be something simple. If I get it working I'll post here.

Thanks.


prissi

I think there are some routines missing im simgraph0.cc which are needed for experimental.

jamespetts

I have been able to compile a no graphics Windows version without too many difficulties, so I do not think that this is the issue.
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.

prissi


deMangler

Well, I have attempted to fix this on a couple of my dev linux systems, one debian based and one slackware based, both 32 and 64 bit and with different versions of gcc.
In all cases I can compile the normal version ok, but not the CLI server (same errors).
I have very little experience with C so I will likely not come up with a solution to this, also - unfortunately I have run out of spare time for a while.
However, if a solution is found or a linux CLI no-graphics server of simutrans experimental is produced I will happily run a server.
???   :)

jamespetts

deMangler,

thank you for your interest in this, and sorry that you are having difficulties. To help me to diagnose the problem, can you copy the compiler's actual output so that I can see the specific error messages? Thank you in advance.
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.

deMangler

Quote from: jamespetts on May 31, 2011, 11:06:41 PM
deMangler,

thank you for your interest in this, and sorry that you are having difficulties. To help me to diagnose the problem, can you copy the compiler's actual output so that I can see the specific error messages? Thank you in advance.

Hi,
I have zipped up the logs of the compiler output. they can be downloaded here:

http://www.box.net/shared/1rputi8umh

Hope this helps. Thanks for all the simutrans-experimental work. It is appreciated.
dM

Dwachs

you have to compile with the option

-DCOMMAND_LINE_SERVER

Btw this compiler switch seems unnecessary.
Parsley, sage, rosemary, and maggikraut.

deMangler

Quote from: Dwachs on June 01, 2011, 05:07:08 PM
you have to compile with the option

-DCOMMAND_LINE_SERVER

Btw this compiler switch seems unnecessary.

That option gives me the 'invalid option' error.

jamespetts

DeMangler and Dwachs,

thank you for that. The command line switch is necessary in MSVC++ to have different versions available easilyin the builds menu.

DeMangler - where do you get the "invalid option" error? What syntax do you use? The precompiler directive can be defined in the makefile.
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.

deMangler

#12
I am including the switch in the command line, so where I would normally do:

make BACKEND='posix' COLOUR_DEPTH=0 OSTYPE='linux'

I am doing:

make BACKEND='posix' COLOUR_DEPTH=0 OSTYPE='linux' -DCOMMAND_LINE-SERVER


But actually it makes no difference where in the command line I put the -DCOMMAND_LINE-SERVER option it fails with the same error.

As I say above, compiling with:

make BACKEND='posix' COLOUR_DEPTH=16 OSTYPE='linux'
works fine.


If I add the option to the makefile like:

CCFLAGS += -DUSE_INDEPENDENT_PATH_POOL -DDEBUG_SIMRAND_CALLS -DCOMMAND_LINE-SERVER

And then do:

make BACKEND='posix' COLOUR_DEPTH=0 OSTYPE='linux'

Then I get the same errors as when I compile without adding the -DCOMMAND_LINE-SERVER option.

I can sucessfully compile a binary with the modified makefile and the COLOUR_DEPTH=16 option but it is exactly the same binary as with the unmodified makefile.



Sorry for my unfamiliarity with compiling C. I am popbably just doing something silly.
dM

jamespetts

Ahh, I'm afraid that I can't access the error logs from my smartphone, so I shall have to wait until I get home from holiday to try to work out what is going on. Thank you for the inforamtion, though.
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.

Vonjo

#14
Hello,

I use simgraph0.cc from standard and it works.
https://github.com/aburch/simutrans/blob/v110.0.1/simgraph0.cc

Or, in simgraph0.cc, remove :
#ifdef COMMAND_LINE_SERVER from line 11
and
#endif from the last line

jamespetts

Vonjo,

that's interesting - thank you. The only change in simgraph0.cc between Experimental and Standard is the inclusion of the #ifdef COMMAND_LINE_SERVER precompiler directive to enable the source file to be included in the MSVC++ project without being compiled in a normal build. There seems to be an issue with passing the precompiler directive to the compiler in DeMangler's case, which I am not sure that I really understand.

DeMangler - can you try, as a workaround, using the Standard simgraph0.cc? I should be interested in your results.
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.

Dwachs

I think make does not recognize when compiler directives change. That said, before compiling with DCOMANDLINESERVER one must delete the old simgraph0.o
Parsley, sage, rosemary, and maggikraut.

deMangler

Quote from: jamespetts on June 02, 2011, 08:13:39 AM
Vonjo,

that's interesting - thank you. The only change in simgraph0.cc between Experimental and Standard is the inclusion of the #ifdef COMMAND_LINE_SERVER precompiler directive to enable the source file to be included in the MSVC++ project without being compiled in a normal build. There seems to be an issue with passing the precompiler directive to the compiler in DeMangler's case, which I am not sure that I really understand.

DeMangler - can you try, as a workaround, using the Standard simgraph0.cc? I should be interested in your results.

Using the standard simugraph0.cc I can compile a working server binary.  :)
Thanks everyone.
dM

jamespetts

Now that you have managed to get this working, do you think that you could upload your binaries somewhere? At present, the automatic nightly builds for Linux do not seem to be working, and in any event do not support the no graphics server.
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.

deMangler

Here are Linux binaries for Simutrans Experimental version 9.8.

Normal x86

Normal x64

Server x86

The only one of these binaries I have actually tested is the x86 server.
I am at present unable to compile an x64 server binary without errors, so it is possible my x64 compile environment has become wobbly.
Download and run these binaries entirely at your own risk, and so-on and so-forth.
:)
dM


jamespetts

Thank you very much - I have updated the links on the release page.
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.

deMangler

Hi,
Having pulled the latest git master (24/06/11)
When I try to compile with :

make BACKEND='posix' COLOUR_DEPTH=0 OSTYPE='linux'

Which is how I compiled the previously running 9.8 server.

It fails with:

===> CXX gui/message_frame_t.cc
In file included from gui/message_frame_t.cc:8:
gui/../simwin.h:167: error: 'size_t' has not been declared
make: *** [build/default/gui/message_frame_t.o] Error 1


dM

inkelyad


deMangler

Quote from: inkelyad on June 24, 2011, 03:37:20 PM
Add

#include <stddef.h>

Thanks - I gave it a try.
However - I still get the same error.
dM

inkelyad

Hm. size_t defined in stddef.h.

Where do you add it?

deMangler

Quote from: inkelyad on June 24, 2011, 04:04:32 PM
Hm. size_t defined in stddef.h.

Where do you add it?
Well, first I tried adding it to the makefile, then I tried adding it to the command line.
Both times was the same output.

Sorry - but I am not very familiar with compiling C programs.
:::)

dM

inkelyad

Add it here:
simwin.h

#ifndef simwin_h
#define simwin_h
#include <stddef.h>
#include "simtypes.h"
#include "simconst.h"

deMangler

Quote from: inkelyad on June 24, 2011, 04:21:42 PM
Add it here:
simwin.h

#ifndef simwin_h
#define simwin_h
#include <stddef.h>
#include "simtypes.h"
#include "simconst.h"


Thanks.
That solved that problem.
:)
I now have the problem I had before at the beginning of this thread (with 9.8 ), which was fixed by replacing the simgraph0.cc with the one from standard. I don't know if that would work again.
I don't have any more time to spend on it now, but I will look into it when I can and hopefully get a server up and running again.

dM

deMangler

Attempting to compile with the above changes and using the simgraph0.cc from standard fails with the error:

===> CXX simgraph0.cc
simgraph0.cc: In function 'sint16 display_set_height(KOORD_VAL)':
simgraph0.cc:92: error: new declaration 'sint16 display_set_height(KOORD_VAL)'
besch/../simgraph.h:112: error: ambiguates old declaration 'void display_set_height(KOORD_VAL)'
simgraph0.cc: In function 'void display_multiline_text(KOORD_VAL, KOORD_VAL, const char*, PLAYER_COLOR_VAL)':
simgraph0.cc:279: error: new declaration 'void display_multiline_text(KOORD_VAL, KOORD_VAL, const char*, PLAYER_COLOR_VAL)'
besch/../simgraph.h:254: error: ambiguates old declaration 'int display_multiline_text(KOORD_VAL, KOORD_VAL, const char*, PLAYER_COLOR_VAL)'
make: *** [build/default/simgraph0.o] Error 1




dM

jamespetts

deMangler,

sorry that you have been having trouble, and thank you for the report. Inkelyad - I have applied your suggested change on my 9.x branch: thank you for that. The 9.x branch now compiles satisfactorily with MinGW.

I am not sure, however, why there are still problems with compiling in GCC; any thoughts would be most welcome.
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.

deMangler

My latest attempts to compile (with git master on 28/6/11 0730 UTC) fail with:
===> CXX vehicle/simverkehr.cc
make: *** No rule to make target `build/default/simgraph0.o', needed by `build/default/simutrans-experimental'.  Stop.


dM



dustNbone

Good work on the new release boys :)  I built 32 bit Linux binaries again for SDL and Posix Server, using the same method as before.  I did remember to strip the symbols from the binaries this time and they're much smaller (3.4ish MB each) as a result.  I packaged them together this time, here is the MU URL

http://www.megaupload.com/?d=HK6XYLX0

I am excited to see how revenue is working now.  Thanks again for all the effort you guys put into this project, I don't want to say how many hours I have expended enjoying your work.  Several :)

Dustin

jamespetts

dustNbone - thank you very much for that: that is most kind.
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.