[Therion] Compilation outcome depends on order of source statements

Bruce Mutton bruce at tomo.co.nz
Mon Feb 5 23:03:01 CET 2024


Here is an issue that took me too many days to unravel.

 

The order of source statements in a thconfig affects the outcome of the
compilation.

I think the problem, or constraint, can be described as:

 

*	Multi-line source statements must follow all single line source
statements, else not all surveys will not be read correctly, or
*	Single-line source statements that follow a multi-line source
statement will not be read.

 

For example, a thconfig contains:

 

source ./Greenlinkcave/INDEXGreenlink.th

source ./swissmaidcave/INDEXSwissMaid.th

 

source

    #join the two cave surveys without an index file

    equate 133 at jp.SwissM  I68 at s.Greenlink

    equate 156 at second.SwissM S45 at ss.Greenlink

    equate 144 at jp.SwissM H32 at h.Greenlink        

endsource

 

source ./middleearthcave/INDEXMiddleEarth.th

 

source

    #join the two cave surveys without an index file

    equate F76 at f.MiddleEarth F102 at f2.Greenlink            

endsource

 

This results in a fatal error:

reading source files ... done

preprocessing database ... done

C:\Program Files\Therion\therion.exe: error --
./middleearthcave/INDEXMiddleEarth.th [24] -- survey does not exist -- 74

 

Which confused me because each of these would compile alone an in
combination via other thconfig files.

If I changed the order of the source statements, the 'non-existent' survey
would change.

 

I tried 6.2.0 + fd5c1b6 and 6.17 and 6.13 all with similar effect (although
I'm not that confident because the latter two being 32-bit and toggling
between the 64-bit 6.2.0 variants results in duplicate therion programs on
my Windows machine, thus I'm not sure I have 'clean' installs). 

 

Too late, I tried putting all the single line sources first, followed by the
multi-line sources, and viola, success.

 

So this seems like a bug, in that I understand Therion should read all
sources before processing the survey and map input.  With sources, this
seems not to be happening, and Therion is crashing inappropriately if the
sources are not listed in the 'correct' order.

 

Bruce

 

PS: Yes, I know the example above is a rather messy way of treating sources.
I would not usually do this - it is a hack to work around an unfortunate
decision made early in the project history.

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240206/3fb4651c/attachment.htm>


More information about the Therion mailing list