Menu

Porting GT.M to OS X -- need help

Developers
2009-04-13
2012-12-29
1 2 > >> (Page 1 of 2)
  • Duke Normandin

    Duke Normandin - 2009-04-13

    Hello GT.M users...

    Anybody have experience building GT.M on Linux?  I need your know-how to help me find my way while in the process of trying to build same on a OS X Leopard box.

    Of course, if successful, the OS X build process will be handed over to Bhaskar for public consumption.

    All interested parties please form a line to my right. ;))
    --
    duke

     
    • rnetmans

      rnetmans - 2009-04-13

      Moral support, moral support, moral support...(wouldn't moreREAL support be better?)

       
      • Amul

        Amul - 2009-04-14

        Duke,
        I sent you a private mail via SF's contact form.  It has my contact information.

        I was the last person to touch the Makefile and installation notes for GT.M, so I have a vested interest in seeing that what I did works for everyone. :)

        The abbreviated steps to building GT.M are:
        1) download the binary tarball from sourceforge and install it (typical location is /opt/gtm/).  You need the installed version to generate some C files (there is a relationship between them and M program files).

        2) download the source tarball from sourceforge and unpack it.  Keep a clean version of the source somewhere (setup a DVCS or an adjacent directory with a different name)

        3) read the README  and follow the instructions (really, you need to).  If the environment vars are not set up right the build won't work, which leads to frustration.

        4) Find the generated files in the sources that you built (compare src and inc directories against the clean sources that I mentioned) and copy them out.

        5) Try some of the commands to create a DB and use GT.M.  Nothing fancy, just get your feet wet
        See the admin guide:
        http://www.fidelityinfoservices.com/user_documentation/AdminOpsUNIX/UNIX_A_O/index.html
        See the programmers guide:
        http://www.fidelityinfoservices.com/user_documentation/GTM-PG-UNIX44/wwhelp/wwhimpl/js/html/wwhelp.htm

        6) Unpack on Mac OS X, and copy in the generated files.  Try to build.  Many of the build steps might not work.  Email me when this happens (see that private SF mail).

        Also if you know anyone with automake experience, please bring them in.  Getting the build to work with automake is something that I want to see happen.

        Amul

         
        • K.S. Bhaskar

          K.S. Bhaskar - 2009-04-14

          To install GT.M versions in compliance with lanana.org standards, please install in /opt/lsb-gtm/<ver>_<platform> e.g., /opt/lsb-gtm/V5.3-003_i686

          Regards
          -- Bhaskar

           
          • Duke Normandin

            Duke Normandin - 2009-04-15

            I'm not sure what you mean?
            --
            duke

             
        • Duke Normandin

          Duke Normandin - 2009-04-15

          Thanks Amul...

          I think that I'll stay away from Xcode and try to do it "long-hand" in OS X. Have you had a chance to go to that URL I provided?
          --
          duke

           
        • K.S. Bhaskar

          K.S. Bhaskar - 2009-04-15

          To install GT.M versions in compliance with lanana.org standards, please install in /opt/lsb-gtm/<ver>_<platform> e.g., /opt/lsb-gtm/V5.3-003_i686

          Regards
          -- Bhaskar

           
        • Stefan Traby

          Stefan Traby - 2009-04-17

          Hi Amul!

          I did a bit of GT.M autotools work in 2004-2006.

          http://oesiman.mine.nu/gtm-autotools/

          ciao -
             Stefan

           
          • Duke Normandin

            Duke Normandin - 2009-04-17

            Thanks for the input!  I'm going to let "Amul-the-GT.M-guru" advise us on this. ;)
            --
            duke

             
          • Amul

            Amul - 2009-04-18

            That's SO COOL!  Thanks Stefan.  I'll see what I can do with.

            Amul

             
    • K.S. Bhaskar

      K.S. Bhaskar - 2009-04-14

      Duke --

      Thanks for stepping up.  I have posted a link to your post on hardhats (http://groups.google.com/group/hardhats).

      The first step is to successfully build your own GT.M on x86 Linux.  To start, download the source tarball for GT.M V5.3-003.  It should come with a makefile and be ready to build on x86 Linux.  You will need an existing GT.M for a small bootstrapping step.  Once you are building successfully on Linux, you will do the bootstrap on Linux for  building on OS X.

      I know nothing about OS X.  I suspect many things will "just work" but there may be other things that require deeper surgery.  One big area to know more about is register usage and stack frames - whether they are different from Linux and how different will likely determine the effort involved.

      Thanks again.

      Regards
      -- Bhaskar

       
      • Duke Normandin

        Duke Normandin - 2009-04-15

        I have no Linux installation, and have no interest in installing GT.M on a Linux box at the moment.

        I gathered that you had limited OS X (and maybe BSD) experience. No matter! We'll finger it out. Thx.
        --
        duke

         
    • K.S. Bhaskar

      K.S. Bhaskar - 2009-04-15

      You are going to need a GT.M executable for a bootstrap.

      Also, if you are able to successfully build GT.M on Linux, then when you run into problems on OS X, you will know that it's your changes.  Otherwise, you will be wondering whether it's your changes or whether there's something wrong with your build setup.

      Just my two bits' worth, for what they're worth.

      Regards
      -- Bhaskar

       
    • LD Landis

      LD Landis - 2009-04-17

      Hi,

        I was able to create GT.M 5.3-003 last night for
        CentOS 5.2.

        The key for me was to look at the log file for errors,
        then install the missing packages, and trying again.

        I downloaed and built the ICU package from scratch,
        but think that there may be repository solution.

        The following "crib" sheet is an "example" I derived
        from the README included in the src distro.

        I am planning to also do the same for Ubuntu, which
        is needed because there is "variety" in repository's
        naming of things between CentOS and Ubuntu.

        Right now, I am rebuilding a CentOS 5.2 system
        from scratch so that I can create a minimal but
        complete recipe (e.g. try to find a working answer
        from the repositories for ICU).

      Cheers,
        --ldl

      Errata (supplied README):
      1. Fulfill the pre-requisites.
      <  $ tar xfz gtm_V53002_linux_i686_src.tar.gz
      >  $ tar xfz gtm_V53003_linux_i686_pro.tar.gz

        Install into /opt/lsb-gtm/5.3-003_i686

        Add the following items (to "Load GT.M Source Code")
        as they are not installed unless you do it.  These are
        also "pre-requisites" to building GT.M, so, IMO, should
        be included in the README (YMMV).

        Initially gmake was not found, but something along the
        way created a symlink /usr/bin/gmake -> /usr/bin/make.
        I want to clarify where this came from, and that is part
        of motivation to "start-over from scratch".

      CentOS 5.2
      ----------

      Install required stuff:
      ( ) sudo yum install tcsh        (already there)
      ( ) sudo yum install gmake   (not found, but 3.80+ is ok, CentOS 5.2 is 3.81)
      ( ) sudo yum install gcc
      ( ) sudo yum install gcc-c++
      ( ) sudo yum install zlib-devel
      ( ) sudo yum install ncurses ncurses-devel

      Build and install the ICU UNICODE stuff:
      ( ) wget http://download.icu-project.org/files/icu4c/4.0.1/icu4c-4_0_1-src.tgz
      ( ) tar xfz icu4c-4_0_1-src.tgz
      ( ) cd icu/source/
      ( ) chmod +x runConfigureICU configure install-sh
      ( ) ./runConfigureICU Linux > runConfigureICU.log 2>&1
      (?) ./configure
      ( ) gmake > mak.log 2>&1
      ( ) echo ==================================================== >>mak.log
      ( ) sudo gmake install >> mak.log 2>&1

      Load GT.M "pro":
      ( ) sudo su -
      ( ) mkdir -p /opt/lsb-gtm
      ( ) cd /opt/lsb-gtm
      ( ) mkdir x
      ( ) tar xfz ~<user>/gtm_V53003_linux_i686_pro.tar.gz
      ( ) ./configure
          Used "bin" user
          Did not restrict groups that can run GT.M
          Install into /opt/lsb-gtm/5.3-003_i686
      ( ) cd ..
      ( ) rm -rf x

      Load GT.M Source Code:
      ( ) tar tfz gtm_V53003_linux_i686_src.tar.gz
      ( ) mkdir gtm-5.3-003
      ( ) mkdir gtm-5.3-003.orig  (For reference)
      ( ) cd gtm-5.3-003
      ( ) tar xfz ../gtm_V53003_linux_i686_src.tar.gz
      ( ) cd ../gtm-5.3-003.orig/
      ( ) tar xfz ../gtm_V53003_linux_i686_src.tar.gz
      ( ) cd ..
      ( ) diff -r gtm-5.3-003*

      Build GT.M:
      ( ) make --version
          GNU Make 3.81
          This program built for i686-redhat-linux-gnu
      ( ) cd gtm-5.3-003
      ( ) tcsh
      ( ) ./mk_gtm.sh >& mk_gtm.log

      -----------------------------------------------------------------------------
      mk_gtm.sh
      ---------
      #!/bin/tcsh
      setenv gtm_curpro /opt/lsb-gtm/5.3-003_i686
      setenv gtm_exe    $gtm_curpro
      setenv gtm_tools `pwd`/sr_linux
      setenv gtm_inc   `pwd`/sr_linux
      setenv gtm_version_change 1
      source sr_unix/gtm_env.csh
      #make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=dbg gtm_ver=`pwd` clean
      make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux gtm_ver=`pwd` clean
      echo "done cleaning  --ldl"
      #make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=dbg gtm_ver=`pwd`
      make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux gtm_ver=`pwd`
      echo "done compiling --ldl"
      #make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=dbg gtm_ver=`pwd` package
      make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux gtm_ver=`pwd` package
      echo "done packaging --ldl"
      -----------------------------------------------------------------------------

         - [OPTIONAL] Ubuntu users must define 'distro'
         $ setenv distro ubuntu

         - [OPTIONAL] By default the build procedure will build 32 bit version of
         GT.M on a x86_64 bit machine.
         If you intend to build 64 bit version of GT.M on a x86_64 bit machine you
         have to explicitly set the environment variable 'OBJECT_MODE' to '64'
         $ setenv OBJECT_MODE 64

         - Define 'gtm_version_change' and execute gtm_env.csh
         $ setenv gtm_version_change 1
         $ source sr_unix/gtm_env.csh

      4. Building GT.M -

      ----------------------------------------------------------------------
        'distro' to 'ubuntu' and clean your build.
        $ setenv distro ubuntu

       
      • Duke Normandin

        Duke Normandin - 2009-04-17

        Cool!  I'm taking notes.....

        Your post will come in handy when I set up my Xubuntu box.
        --
        duke

         
      • Amul

        Amul - 2009-04-18

        Thanks for going over the README's instructions.  I'm partly to blame for them. ;)

        I will incorporate the dependencies part as well as better instructions in the next release.  In the meantime, I am saving this information into the internal wiki.

        thanks,
        Amul

         
    • Ken McKee

      Ken McKee - 2009-05-16

      I managed to get most of the C code to compile.

      One sizable problem is that the GNU assembler (GAS) is much different from Apple's assembler (AS). And it seems the GNU assembler  is the one gnu/linux tool that is not available in the BSD world that Mac OS X lives in. GAS allows for some macros and some other directives that AS doesn't recognize. Someone who is a little brighter than me could probably write a preprocessor to translate the assembler files.

      -Ken McKee

       
      • Duke Normandin

        Duke Normandin - 2009-05-16

        Hey Ken...

        Thanks for dropping in and leaving a note! What took you so long? Didn't you sense that we desperately needed your advise on how to go about porting GT.M to OS X? ;))

        Seriously, you would not happen to have any notes on how you "managed to get most of the C code to compile"? Did you use OS X's XCode? Which version of OS X did you compile on? TIA....
        --
        duke

         
        • Ken McKee

          Ken McKee - 2009-05-17

          Duke,

          Xcode can refer to the IDE and/or the SDK.  The Xcode IDE won't be used. The build process described in the readme file in the gt.m distribution will drive the Apple versions of gcc/make etc. Those tools are installed when you install the Xcode SDK from Apple. Apple's make is the same as gmake. If anyone objects to installing Xcode, then macports is a good way to get gcc/make etc.

          make did not like the makefile 'sr_unix/comlist.mk' for some reason.
          Changing some relative paths to absolute paths in 'sr_unix/comlist.mk' helps.
          Also, comlist.mk includes get_lib_dirs.mk, which determines the OS, which in turn triggers some conditional compilation. The OS type, Darwin, isn't recognized anywhere in the source. Eventually the source should be edited to include conditions for Darwin. However, I simply edited get_lib_dirs.mk and set the OS to Linux to get things started.

          This gets the build process going and successfully compiles a significant number of files.

          A required unicode library (http://site.icu-project.org/) can be installed with macports.
          sudo port install icu

          My experiments were with 5.2. I just downloaded 5.3 and made the same changes to comlist.mk and get_lib_dirs.mk.  Drop me a line at rkm1000 at bmrc.duhs.duke.edu and I will send them to you.

          As Bhaskar mentioned, eventually the build process looks for an existing gt.m to compile some files. Bhaskar has outlined the solution in previous posts. When you get that far, let me know.

          -Ken

           
          • K.S. Bhaskar

            K.S. Bhaskar - 2009-05-17

            Is the GNU tool chain - binutils, gcc, etc. available for OS X?  If so, might that make for a simpler port than using the Xcode tool chain?

            Regards
            -- Bhaskar

             
            • Duke Normandin

              Duke Normandin - 2009-05-17

              I just searched "macports" and found this:

              i386-elf-binutils @2.18.50.0.9 (cross, devel)
                  FSF Binutils for i386-elf cross development

              Would that do?
              --
              duke

               
              • K.S. Bhaskar

                K.S. Bhaskar - 2009-05-17

                I can't say - I haven't ever done development on a Mac.  But since GT.M on Linux is built using the GNU tool chain, I suspect that using it on OS X would make a port easier - assuming that it is complete, of course.

                Regards
                -- Bhaskar

                 
              • Ken McKee

                Ken McKee - 2009-05-17

                No. That is for generating elf object files (for linux I presume) from Mac OS X.

                The relevant macports package is called "binutils".

                However, the easiest way to get started is to install the Xcode SDK.

                 
                • Duke Normandin

                  Duke Normandin - 2009-05-17

                  Hey Ken....

                  I didn't think that anything extra was needed on my IMac. I have XCode SDK and the IDE and binutils. Bhaskar asked the question, and I went searching for "goodies".

                  Thanks for the tips!!
                  --
                  duke

                   
            • Ken McKee

              Ken McKee - 2009-05-17

              Apple's make *is* GNU Make 3.81 and Apple's C compiler (for now, at least) *is* gcc version 4.0.1. The simplest way to get started is to install the Xcode SDK from the Apple developer site.

              With a couple of modifications to comlist.mk and get_lib_dirs.mk (mentioned above)
              make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=pro gtm_ver=/Users/rkm/gtm53/src
              compiles over 1700 files.

              The build process ends with
              chk2lev.mdep:2: *** missing separator.  Stop.

              (I haven't had the time to explore what is generating that message, yet.)

              The message here is, start by installing the Xcode SDK.

              -Ken

               
1 2 > >> (Page 1 of 2)

Log in to post a comment.