[therion-users] Re: therion does a seg fault when I try and run it
Hi I have been looking at the problem of the compilation on the PowerPC and started looking at some of the compilation errors too. 1. thpoint.cxx:446: warning: `.' not followed by `*' or digit in format thats because you have at this line the following... sprintf(buff,"%0.f",this->xsize); should that be instead the following? sprintf(buff,"%.0f",this->xsize); 2. The following is more serious. thpoint.cxx:731: warning: assignment of negative value `-1' to `char' void thpoint_parse_value(int & sv, double & dv, bool & qw, char & sign, char * str) and later on.... case '-': sign = -1; str++; break; OK my programming skills are rudimentary but if you assign a negative value to a character pointer then the variable will give a different value depending whether the operating system is 32 or 64 bit. My Alpha is 64 bit. The compiler warns about it and rightly so. 3. I have tracked down where the strange string comes from when I run ./therion -v therion$ ./therion -v therion gduxs:l:qLvhip: it's from thcmdline.cxx where it uses the getopt routines. oc = getopt_long (argc, argv, "gduxs:l:qLvhip:", thlong_options, &oindex); I read the man 3 page on getopt and so now I know what the gduxs:l:qLvhip: string is -- never used getopt myself. So somehow instead of the version string being returned its returning the argument to the getopt_long function ! eeeewwww :-) The version of getopt on my Ti PowerBook here running Debian 3.0 is therion$ getopt --version getopt (enhanced) 1.1.2 Mike -- Mike Lake Caver, Linux enthusiast and interested in anything technical.
Fine, this weekend I should have some time to fix small bugs in therion. So If you have more of them, please mail me them. I'll also check warnings, that Wookey sent to me.
thpoint.cxx:446: warning: `.' not followed by `*' or digit in format thats because you have at this line the following... sprintf(buff,"%0.f",this->xsize);
should that be instead the following? sprintf(buff,"%.0f",this->xsize);
Of course :)
2.
The following is more serious.
thpoint.cxx:731: warning: assignment of negative value `-1' to `char'
void thpoint_parse_value(int & sv, double & dv, bool & qw, char & sign, char * str) and later on.... case '-': sign = -1; str++; break;
OK my programming skills are rudimentary but if you assign a negative value to a character pointer then the variable will give a different value depending whether the operating system is 32 or 64 bit. My Alpha is 64 bit. The compiler warns about it and rightly so.
You're right. I'll check, whether I mix unsigned and signed chars somwhere else. And I'll try to change it.
argument to the getopt_long function ! eeeewwww :-)
This is why I recommanded you to compile included getopt C code (in extern directory, it's done via make config-macosx). If it didn't help, the problem is probably not the getopt version... The other idea: May be, I'm combining C and C++ code the wrong way (I just link .o files created by C and C++ compilers together). May be, it's not correct. I have no idea. I've studied mathematics, not computer programming... :( S.
Stacho Mudrak wrote:
argument to the getopt_long function ! eeeewwww :-)
This is why I recommanded you to compile included getopt C code (in extern directory, it's done via make config-macosx). If it didn't help, the problem is probably not the getopt version...
I did that and it didnt change the problem. I compiled with the same warnings and gave the same error when I ran "./therion -v"
The other idea: May be, I'm combining C and C++ code the wrong way (I just link .o files created by C and C++ compilers together). May be, it's not correct. I have no idea. I've studied mathematics, not computer programming... :(
hehe :-) I am a Physicist by trade. Best wishes, Mike -- Mike Lake Caver, Linux enthusiast and interested in anything technical.
I can see that therion.mp defines MetaPost macros and things like . I see that thPoint.mp contains... % @DESCRIPTION % <H4>Survey stations:</H4> % @SYMBOL % thFixedstation_ASF -- % % @PREVIEW % % thFixedstation_ASF((.5,.5) inscale); def p_station_fixed_ASF (expr pos)= T:=identity shifted pos; pickup PenD; pair z; z:=(0,.2u); thclean z -- (z rotated 120) -- (z rotated 240) -- cycle; thdraw z -- (z rotated 120) -- (z rotated 240) -- cycle; thdraw origin; enddef; and that thdraw is defined in mpost/therion.mp which I think is generated from thmpost.h which is generated from your RCS system. I am trying to work out how this all fits together. I gather then that you have some scripts that will generate HTML from the file and that the HTML can document the available symbols. Am I guessing right? Like the ASF symbol for a fixed station. What would be nice would be to generate automatically a PDF doc that has the name of the UIS symbol and it's picture i.e. run a script that processes the mp fragments, extracts the name and desription, creates the eps files and then runs pdflatex to make a table of all the UIS symbols listed alphabetically or by type of symbol. The reason why I am trying t fit it together is so I can do things like make my own symbols -- well even help you make the many other UIS symbols that arent in therion yet too. I dont know much metapost but can learn. It appears at present that to add new symbols one must add the mp code and then recompile. Also I see you need help with writing some sections in the manual - like the section "New map symbols". Mike -- Mike Lake Caver, Linux enthusiast and interested in anything technical.
Hello Mike! I have an idea - the problem can be hidden in functions taking undefined number of arguments. Could you please try to compile your source with attached therion.cxx file? May be it will help you. Thanks, S.
Stacho Mudrak wrote:
Hello Mike!
I have an idea - the problem can be hidden in functions taking undefined number of arguments. Could you please try to compile your source with attached therion.cxx file? May be it will help you.
Here are the results... It now compiles and when run gives the correct verion number. demo$ therion -v therion 0.2.15 demo$ But when run with the demo data set I get this.... demo$ therion therion 0.2.15 loading initialization file loading configuration -- thconfig open file -- thconfig close file -- thconfig configuration loaded reading input -- cave.th open file -- cave.th open file -- data/cave.th2 therion (therion.cxx:304): error -- (thdatareader.cxx:210): data/cave.th2 [300] -- ( thpoint.cxx:868): invalid combination of values -- +1.5 -3 demo$ This line is in data/cave.th2 : point 306.0 741.0 passage-height -value [+1.5 -3] and if I comment it out... It ALL RUNS FINE ! :-) Thus therion now does run on PPC under Debian Linux except for that one offending line above. Thanks for the help. I will now have a look at the diff of that therion.cxx file you sent and see what has changed. I will also write down and send the other compiler warnings and pdf warnings that I get too. hehe :-) once this works I can send you stuff on Alpha 64 bit problems. But one thing at a time :-) Mike -- Mike Lake Caver, Linux enthusiast and interested in anything technical.
participants (2)
-
Michael Lake -
Stacho Mudrak