Announcement

Collapse
No announcement yet.

COMPILE: Linux Port

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Originally posted by arrow014
    Nope, it was missing, so I added it to Makefile.am and Makefile, too. I guess I'm still a little fuzzy as to the relationship between these two files, because it didn't work after modifying just the Makefile.am file, but it did work after modifying the Makefile itself. I'm guessing the .am file is involved in the generation of the Makefile (perhaps in that autogen.sh script that I ran at the beginning?). Is that correct?
    The autogen script (in particular, automake) generates a Makefile.in from each Makefile.am, and then the configure script generates a Makefile from each Makefile.in. So, so get the "proper" version of this makefile you'd need to run autogen.sh (or make bootstrap) again, and then configure again.

    Anyway, after that it makes it to what looks like the final step--or close to it (I've omitted some of this output because it's so long):

    TTF? True Type Font? I've installed several font libraries and packages...I'm not sure what would be missing, unless it's something specific to this project. Any links?
    ttf is indeed true type font. The package needed in Debian is called libttf2. In any case you want a package with these files:

    Code:
    /usr/lib/libttf.a
    /usr/lib/libttf.la
    /usr/lib/libttf.so
    If there is no such package then I guess you'll have to find some source code somewhere and install it the hard way, but I strongly suspect that there will be one.

    Comment


    • Originally posted by J Bytheway
      The autogen script (in particular, automake) generates a Makefile.in from each Makefile.am, and then the configure script generates a Makefile from each Makefile.in. So, so get the "proper" version of this makefile you'd need to run autogen.sh (or make bootstrap) again, and then configure again.
      Ah, so that's why. That makes sense. Thanks.

      Originally posted by J Bytheway
      ttf is indeed true type font. The package needed in Debian is called libttf2. In any case you want a package with these files:
      Ok I found a "freetype2-devel" lib that I hadn't installed and that seemed to do the trick.

      W00t! Make now finishes! Now THERE'S a reason for Thanks-giving...

      I went through your "post-build" instructions (initial run, modifying userprofile.txt, copying files, etc.) as best I could--I must have done something wrong, though, because the game still won't launch:

      ../ctp2 nointromovie
      Messagebox(Paths Error): 'controlpanel.ldl' not found in asset tree.
      /usr/src/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:43: syntax error
      Messagebox(LDL Error): /usr/src/ctp2/ctp2_data/english/uidata/layouts/civ3.ldl:43: syntax error
      Fatal signal: Segmentation Fault (SDL Parachute Deployed)
      Segmentation fault
      FYI, I have the full game installed on a fat32 partition (path: /mnt/shared/Games/Call To Power) and I have the Linux source in /usr/src/ctp2, so the relative path I put in userprofile.txt was "../../../../../mnt/shared/Games/Call\ To\ Power\ 2/ctp2_data/".

      Comment


      • Originally posted by arrow014
        W00t! Make now finishes! Now THERE'S a reason for Thanks-giving...


        I went through your "post-build" instructions (initial run, modifying userprofile.txt, copying files, etc.) as best I could--I must have done something wrong, though, because the game still won't launch:

        FYI, I have the full game installed on a fat32 partition (path: /mnt/shared/Games/Call To Power) and I have the Linux source in /usr/src/ctp2, so the relative path I put in userprofile.txt was "../../../../../mnt/shared/Games/Call\ To\ Power\ 2/ctp2_data/".
        Two things:

        - I said that you could omit the first path if it was "../../ctp2_data". This is not in fact true. If you omit it it will be automatically added *after* the other one, where in fact it's needed *before* the other one. So, put that in if you're missing it.

        - The escaped spaces may be giving you grief. Try using just ' ' rather than '\ '. If that doesn't work, then rename the "Call To Power 2" directory to something without spaces in it.

        Comment


        • Ok I added the first path and changed the directory name to just "ctp2" and now I'm getting:

          ../ctp2 nointromovie
          Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
          Failed loading times.ttf
          ctp2: ui/aui_common/aui_textbase.cpp:415: void aui_TextBase::TextReloadFont(): Assertion `m_textfont != __null' failed.
          Aborted

          Comment


          • Originally posted by J Bytheway
            I don't think that's a problem. I think the problem would occur if a void* were not big enough to store a uint32... Of course, that's just based on the couple of examples I've seen. Perhaps there are other places where the reverse holds.
            Yes, sure. Thought you meant the opposite.

            Originally posted by Martin Gühmann
            Is there no way on Linux to check for modifications in your working copy?
            Sure there is, e.g. on command line by svn status and svn diff. I guess John has his .svn dirs messed up, because he says it doesn't work? If so, try this:[list=1][*]in broken wc, make a tar of it with .svn dirs in exclude list[*]in broken wc excute: grep revision .svn/entries[*]checkout that revision again: svn co -r revision ... target[*]maybe backup the new checkout at target[*]cd target[*]untar the backup of the broken working copy on the new checkout[*]run svn update[*]run svn status, svn diff, etc. as before, and merge manually (perhaps svn revert some stuff which was outdated on your broken wc)[/list=1]

            Comment


            • I'm not sure about the message about UC088.rim.

              There was a problem with the font search system which I fixed this morning - I'll upload that in a moment. Checkout that and see if it helps.

              If not, Check whether you have a times.ttf anywhere on your system. If not, then you'll need to install it somehow (the Debian package is msttcorefonts; there's also a website somewhere - this issue was discussed earlier in this thread).

              If you do have it, and it's not being found, then tell me where it is and I can fix the font search system to find it (or tell you how to do that).

              Comment


              • Originally posted by arrow014
                Ok I added the first path and changed the directory name to just "ctp2" and now I'm getting:
                Perhaps you are missing the corefonts package (perhaps named similar, it includes times.ttf, arial.ttf, e.t.c.). If so, install it and run xset fp rehash; if it won't work, maybe you have to restart xfs (the font server, if you installed it) and the X-Server, too.
                If it still doesn't find the fonts, locate times.ttf and copy the ttf fonts to the directory, where you start ctp2 from.

                For the .rim files, they are located in an .zfs Archive, maybe it's not installed within the ctp2_data path or isn't located within the search path mentioned in your userprofile. Sorry, if i can't tell more atm, i have no copy of ctp2 on this box.

                Comment


                • I've just commited those changes. This update should have the following effects:

                  - Game now doesn't always segfault on exit.

                  - All the font paths that were supposed to be searched really are searched.

                  - Some keyboard support in place (only keyboard-based scrolling, so far, but I think that was the hardest part - I've discovered that the way keyboard events are handled is really bizarre, so I had to do quite a lot of work to get this much working, but it should be downhill from here).

                  Comment


                  • For the UC088 problem:

                    You should have a file /ctp2_data/default/graphics/cursors/UC088.tga that was in the repository. If you do, then for some reason it's not being found (Don't worry about the fact that the message was about a .rim, not a .tga - it should search for the .tga first and then the .rim). Check your userprofile.txt and get back to us.

                    If you don't have that file, then do an "svn status" and see what's happened to it. If it was somehow deleted then you can get it back with "svn revert".

                    On an unrelated note: Since I'm in the middle of fixing the keyboard support, you may see some of my debugging messages if you press any keys in the game. Don't worry about that.

                    Comment


                    • Some more work on keyboard support done. Now all keys that are bound to game actions like settling or opening the city manager should work, although you still can't type into a text box, or move around in a list box.

                      For the moment the code assumes a British keyboard, because I needed to assume something, and a British keyboard was in front of me. I'm not sure how to make it properly support other keyboards, but it should be OK for most purposes - there will only be slight problems when the shift variants don't match up (e.g. pressing shift+2 will yield a double quote ("), whereas IIRC on an American keyboard it should be an at (@)).

                      Comment


                      • Sorry for the long period of inactivity--I've been lazy (ie. too busy playing with Fluxbox, Nethack and a certain obscenely-titled console IRC client ). Anyway, I found a copy of times.ttf and arial.ttf that quieted those messages. I do indeed have UC088.tga in /usr/src/ctp2/ctp2_data/default/graphics/cursors/, which should be ok since the line in userprofile.txt is:

                        Code:
                        RuleSets=../../ctp2_data/;../../../../../mnt/shared/Games/ctp2/ctp2_data/
                        After getting the fonts, I now get the opening CTP2 progress bar and everything looks cool for a second, then it quits with:

                        ../ctp2 nointromovie
                        No such device: No such device
                        Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
                        Messagebox(CRA_civilisation.txt line 114: Error): Could not find GREEK_DIPLOMAT_PHOTO in string database
                        Messagebox(¸8·civilisation.txt line 114: Error): Expected number of Civilisations not found
                        Messagebox(CivApp Error): Unable to Init the Databases.
                        Fatal error. Aborting.
                        At exit.
                        PeepEvents failed:
                        PeepEvents failed:
                        Fatal signal: Segmentation Fault (SDL Parachute Deployed)
                        Segmentation fault
                        So it seems I now have a plethora of new, weird errors, and I see that UC088 thing is still complaining.

                        And what is that "no such device" thing about? I have the CD in: before that I was getting a "medium not found" error. What "device" is it trying to access now?

                        NOTE: I haven't done an SVN checkout or anything since the initial one 'cause I was afraid of having to redo much of the build process and the resulting errors. Now I'm realizing that I'm probably a version or two behind you guys and that might be causing problems (besides, doing the build again shouldn't be TOO hard, right...?). What should I do?

                        Treatment tomorrow...wish me luck!
                        -- Michael

                        Comment


                        • Originally posted by arrow014
                          Sorry for the long period of inactivity--I've been lazy (ie. too busy playing with Fluxbox, Nethack and a certain obscenely-titled console IRC client ). Anyway, I found a copy of times.ttf and arial.ttf that quieted those messages. I do indeed have UC088.tga in /usr/src/ctp2/ctp2_data/default/graphics/cursors/, which should be ok since the line in userprofile.txt is:

                          Code:
                          RuleSets=../../ctp2_data/;../../../../../mnt/shared/Games/ctp2/ctp2_data/
                          Hmm... I'm not sure what could be going on there, then.

                          After getting the fonts, I now get the opening CTP2 progress bar and everything looks cool for a second, then it quits with:

                          ../ctp2 nointromovie
                          No such device: No such device
                          Messagebox(Targa Load Error): Unable to find the file 'UC088.rim'
                          Messagebox(CRA_civilisation.txt line 114: Error): Could not find GREEK_DIPLOMAT_PHOTO in string database
                          Messagebox(¸8·civilisation.txt line 114: Error): Expected number of Civilisations not found
                          Messagebox(CivApp Error): Unable to Init the Databases.
                          Fatal error. Aborting.
                          At exit.
                          PeepEvents failed:
                          PeepEvents failed:
                          Fatal signal: Segmentation Fault (SDL Parachute Deployed)
                          Segmentation fault
                          The fact that it's reading CRA_civilisation.txt suggests that you have Cradle set to be used (in ModSwapper/ModManager) on your wndows installation of CTP2. Check that, and if you do, then deactivate it - I'm not sure how backwards compatible we are with mods at the moment, and it would be safest to stick with the default game until that's working properly.

                          If un-selecting Cradle doesn't fix the UC088.rim problem then we'll have to dig a little deeper. If you're familiar with gdb, then I can tell you roughly what to do to find out what's happening. If not, then I can perhaps add some debugging output to the code so that we can find out exactly where it's looking for that file.

                          So it seems I now have a plethora of new, weird errors, and I see that UC088 thing is still complaining.

                          And what is that "no such device" thing about? I have the CD in: before that I was getting a "medium not found" error. What "device" is it trying to access now?
                          I'm not sure. In my output I get a "Operation not permitted: Operation not permitted" message. I don't know where either of these messages is coming from. Possibly somewhere in the SDL code for playing music off the CD. My message causes no problems, so hopefully yours doesn't either.

                          NOTE: I haven't done an SVN checkout or anything since the initial one 'cause I was afraid of having to redo much of the build process and the resulting errors. Now I'm realizing that I'm probably a version or two behind you guys and that might be causing problems (besides, doing the build again shouldn't be TOO hard, right...?). What should I do?
                          I suggest you do an "svn up" and rebuild. It shouldn't cause any problems, and it should be considerably faster than it was the first time .

                          Treatment tomorrow...wish me luck!
                          Good luck!

                          Comment


                          • The fact that it's reading CRA_civilisation.txt suggests that you have Cradle set to be used (in ModSwapper/ModManager) on your wndows installation of CTP2.
                            Ooooohhh, whoops. Hadn't thought of that. Actually I have several installs of CTP2 on that drive (w/ various mod combinations), so I guess I need to find the right one and rename some directories so that userprofile.txt is pointing to the right one. Thanks!

                            If un-selecting Cradle doesn't fix the UC088.rim problem then we'll have to dig a little deeper. If you're familiar with gdb, then I can tell you roughly what to do to find out what's happening.\
                            I'm vaguely familiar with it...I used it to debug a simple assembler program one time. But I sure would like to learn more. Actually...this whole CTP2-on-Linux project has become more of a learning exercise for me; I realized the other day that I'm not actually all that interested in actually PLAYING the game any more...I just want to get it to compile and work properly and learn all I can in the process. And then perhaps lend a hand if there's any relatively simple coding or documentation to be done...

                            I'm not sure. In my output I get a "Operation not permitted: Operation not permitted" message. I don't know where either of these messages is coming from. Possibly somewhere in the SDL code for playing music off the CD. My message causes no problems, so hopefully yours doesn't either.
                            Sweet. I'll hope that's the case, then...

                            I suggest you do an "svn up" and rebuild. It shouldn't cause any problems, and it should be considerably faster than it was the first time .
                            Ok...so what's the exact command for that? I tried to figure it out but I'm not quite sure of the syntax:

                            Code:
                            $ svn up svn://ctp2.kaan.dk/ctp2/branches/linux ctp2
                            svn: 'svn://ctp2.kaan.dk/ctp2/branches' is not a working copy
                            Or was the repo moved?

                            Good luck!
                            Thanks! The actual chemo injection went pretty uneventfully today and I'm feeling alright at the moment. The nightmare begins tomorrow (or possibly tonight)...

                            Be back in a week or so...

                            Comment


                            • Originally posted by arrow014
                              I'm vaguely familiar with it...I used it to debug a simple assembler program one time. But I sure would like to learn more.
                              OK, well, here's how you can do it if it proves necessary, or if you just want to play around in gdb to see how things work:

                              To start gdb just use "gdb ../ctp2" in the same directory you were running it from before (Be aware that it has to load pretty much all of the 250MB executable into memory, so if you have less than ~300MB of RAM, then it will start swapping frantically, and become quite slow - it can take a couple of minutes to load in this case. Even if you do have lots of RAM, it will still not be very fast). You can start ctp2 from inside gdb with the "run" command, and you can pass command line arguments to ctp2 through it. I suggest you use "run nointromovie".

                              The function that searches the asset tree for files (and that prints out the error you saw when it fails to find the file) is CivPaths::FindFile, defined in ctp2_code/gs/fileio/CivPaths.cpp. If you examine it you'll see that it searches first the current scenario path (whiuld be nothing in your case), then the current scenario pack path (again, should be nothing), then the paths defined in userprofile.txt, and then the default "../../ctp2_data" type paths.

                              Once gdb is loaded, but before starting ctp2, I suggest that you set a breakpoint at the start of the CivPaths::FindFile function (Simply use the command "break CivPaths::FindFile" - you can even tab-complete the class and function names). Now when you run ctp2 it should quickly reach your breakpoint and stop execution. step through execution for a while to get a feel for how the function works. When you want to stop stepping and let the program have free reign again, use "continue".

                              When gdb breaks ctp2, you'll notice that it conviniently tells you the values of the command line arguments. In particular, it should say something like
                              Code:
                              CivPaths::FindFile (this=0x8bf6da0, dir=C3DIR_DIRECT,
                                  filename=0x871f3d2 "userprofile.txt", path=0xbf807974 "", silent=0,
                                  check_prjfile=1)
                              the first time it breaks. Note that it lists the filename there. Because this function gets called a lot, you'll want to put a condition of the breakpoint to only break when the filename passed is "UC088.tga". What you want to say is:

                              Code:
                              condition 1 0==strcmp(filename,"UC088.tga")
                              (where 1 is the number of the breakpoint you just created - see "help condition" in gdb for more details on how this works) but that won't work, because you can't call strcmp in this context (I'm not sure whether that's a limitation of gdb, or simply because no one included in this file). To do the whole check you'd have to write the condition as:

                              Code:
                              filename[0]=='U' && filename[1]='C' && ...
                              and so on. Fortunately, if you just check characters 0, 3 and 4, that should suffice.

                              Then it will break while searching for the appropriate file, and you can follow the execution to see exactly where it's looking, and thus find out where it's going wrong.

                              I've just gone through this whole process in order to explain it to you, and in doing so, I've discovered what the problem is. I should have realised before - it's looking for UC088.TGA, but the file is called UC088.tga, and Unix filesystems are case-sensitive. It so happens that I also have a UC088.tga on my NTFS partition where it's looking next, and, for me, it finds that one. The function must be changed so that it searches case-insensitively. In the short term, if you just want to get it working, you can rename the file.

                              Actually...this whole CTP2-on-Linux project has become more of a learning exercise for me; I realized the other day that I'm not actually all that interested in actually PLAYING the game any more...I just want to get it to compile and work properly and learn all I can in the process. And then perhaps lend a hand if there's any relatively simple coding or documentation to be done...
                              I know the feeling. I knew few of these things I'm telling you before I set out on this project, but finding them out has been fun .

                              Ok...so what's the exact command for that? I tried to figure it out but I'm not quite sure of the syntax:

                              Code:
                              $ svn up svn://ctp2.kaan.dk/ctp2/branches/linux ctp2
                              svn: 'svn://ctp2.kaan.dk/ctp2/branches' is not a working copy
                              Or was the repo moved?
                              If you're at the root of your working copy, then you can simply execute "svn up", and it will work. If not, then you need to supply the path to the root of your working copy. The reason you're getting that error is because it wants you to pass the path of a working copy, not the url of a repository. svn remembers which repository the working copy was associated with, so you don't have to keep telling it every time.

                              Thanks! The actual chemo injection went pretty uneventfully today and I'm feeling alright at the moment. The nightmare begins tomorrow (or possibly tonight)...
                              I hope it goes as well as it can.

                              Be back in a week or so...
                              See you then.
                              Last edited by J Bytheway; December 8, 2005, 11:58.

                              Comment


                              • Ugh. *sigh* So I did "svn up", "./autogen.sh", "./configure" and "make" and all that and now it's complaining about those stupid headers again:

                                ../../tca/tca.c:33:34: error: 3rdparty/d3des/d3des.h: No such file or directory
                                ../../tca/tca.c:34:49: error: 3rdparty/md5/global.h: No such file or directory
                                ../../tca/tca.c:35:30: error: 3rdparty/md5/md5.h: No such file or directory
                                I got this before (see previous posts) and fixed it by unpacking those two ZIP files, but this time it still gives me that error after I've unpacked them...the files are definitely there:

                                [/usr/src/ctp2/ctp2_code] ls libs/anet/src/3rdparty/d3des/
                                d3des.c d3des.h readme unpacked

                                [/usr/src/ctp2/ctp2_code] ls libs/anet/src/3rdparty/md5
                                global.h md5.1 md5.1.txt md5c.c mddriver.c rfc1321.txt
                                Makefile md5.1.ps md5-announcement.txt md5.h README unpacked
                                I get the feeling I just moved several steps BACKWARDS...

                                Comment

                                Working...
                                X