The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: ACarlotti on January 30, 2018, 11:40:20 AM

Title: Compile error without multithreading
Post by: ACarlotti on January 30, 2018, 11:40:20 AM
Commit aafb62 introduced a use of threads_initialised which is undeclared if MULTI_THREAD is undefined.

(I beleive it was this fix: https://forum.simutrans.com/index.php?topic=17810.0)


Incidentally, that suggests I'm compiling without multithreading whereas you are compiling with it. Should I be doing something different? I've just been running 'BACKEND=sdl2 COLOUR_DEPTH=16 OSTYPE=linux make'.
Title: Re: Compile error without multithreading
Post by: jamespetts on January 30, 2018, 12:09:48 PM
Thank you for the report - I have now fixed this error.

I do suggest compiling with multi-threading enabled, as this makes a big difference to performance, especially with larger maps: I always build with multi-threading enabled. You should define MULTI_THREAD=1 to enable multi-threading.
Title: Re: Compile error without multithreading
Post by: ACarlotti on January 30, 2018, 02:24:49 PM
That's what I ended up doing anyway.

It would be helpful if there were a bit more information about compiling Simutrans Extended; I thought there used to be more information in readme.txt
Title: Re: Compile error without multithreading
Post by: jamespetts on January 30, 2018, 10:53:18 PM
I do not think that any compilation information was removed from readme.txt, although there are some threads on the forum about compiling Simutrans-Extended that some other users helpfully created a few years ago. Perhaps the development has moved on since that time?
Title: Re: Compile error without multithreading
Post by: ACarlotti on January 31, 2018, 12:42:14 AM
I think it was accidentally overwritten in this commit in February 2016:

https://github.com/jamespetts/simutrans-extended/commit/f86904#diff-eb6b6c90251ab33cee784713c451e6d8

I imagine it could be largely reinstated as is (or rather was), although it looks like it was never updated for Extended (still refers to the original svn), and it makes no reference MULTI_THREAD.
Title: Re: Compile error without multithreading
Post by: jamespetts on January 31, 2018, 12:48:59 AM
Thank you for finding that. I suspect that the old version would be of little use in any event now. Do you think that we need a new readme.txt, or is it better to use the resources that exist on the forum, I wonder?
Title: Re: Compile error without multithreading
Post by: ACarlotti on January 31, 2018, 01:06:00 AM
I couldn't find anything on the forum about compiling when I looked (apart from the note about Visual Studio), and the information in the old readme.txt would have helped me (mostly for reassurance, but it would have saved me having to read through most of the makefile), although I agree that it would need a bit of updating. So I think it would be good to either reinstate readme.txt, or add a pinned thread about compiling simutrans to the Extended Development board.
Title: Re: Compile error without multithreading
Post by: jamespetts on January 31, 2018, 01:19:59 AM
We have this (https://forum.simutrans.com/index.php?topic=14254.0) thread, but I infer that you were compiling with GCC? Perhaps to have all the information in the same place, we need a new "How to compile Simutrans-Extended with GCC" thread? This would actually be simpler than setting it up to compile with Visual Studio.