Recompiling ScarletDME

From ScarletDME
Revision as of 15:49, 25 June 2013 by Geneb (talk | contribs) (Created page with "==Compiling ScarletDME from source== The first step is to "clone into" the git repository that has the ScarletDME source code. If you haven't done this yet, the command is: ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Compiling ScarletDME from source

The first step is to "clone into" the git repository that has the ScarletDME source code. If you haven't done this yet, the command is:

git clone git://

This will create a directory called ScarletDME and it will contain the full C and BASIC source code tree.

If you just want to compile and install ScarletDME, it's very simple:

sudo make install

And you're done! :)

By default "make install" will place the system in /usr/qmsys, so you'll need to either be root on the system you're using or have access to root privilege commands via "sudo".

If you do not want the files being installed into /usr/qmsys, you can edit the Makefile and change the line shown below to point where you'd like the installation action to put ScarletDME.

INSTROOT := /usr/qmsys

If you only want to update all the system data files from the source repository, you can use the make target "datafiles". This will copy all the system data into the INSTROOT location. Note that it WILL OVER-WRITE ANY EXISTING DATA! Please use the "datafiles" target with caution.

If you want to start from a clean slate, there is a make target called "clean" that will remove all the object files from the "gplobj" directory. The make target "distclean" will also remove the compiled binaries as well as the terminfo database.

The terminfo database can be built by hand with the following command executed from the root of the ScarletDME source directory:

bin/qmtic -pterminfo terminfo.src

Recompiling the original GPL OpenQM

If you want to recompile OpenQM there are two different sections you need to look at: the C code and the QMBasic code. If you make any changes to the code then you really should run buildgpl again, as this basically rebuilds the system from the ground up.

If you alter the C code in gplsrc simply run "qm -stop", then buildgpl. This will compile your code and link it into the main routines. Depending upon compiler and library versions you may need to change some of the QM_GCC_OPTIONS in the buildgpl script. Try these in various combinations:

   * remove -Werror
   * add -Wno-packed
   * add -Wno-pointer-sign

Recent Ubuntu (11.10) and other distributiuons have moved some of the library locations. You may have to edit the QMLIBS line in the buildgpl script. Try these

   * QMLIBS="-lm -lcrypt -ldl"
   * QMLIBS="-Wl,--no-as-needed -lm -lcrypt -ldl"

If you change the basic programs in GPL.BP, however, you first need to compile them. First login to the sysprog account using "qm - Internal"; this allows you to compile the internal subroutines that would normally throw a compiler error. Then compile your altered routine. As GPL.BP.OUT doesn't exist immediately after an install, I'd suggest avoiding "* CHANGED" unless you actually want to compile them all. Finally exit qm and run .buildgpl. I'm not sure why this is necessary, but without it the changes only appear in the system account; running buildgpl propagates the changes properly.

Quick checklist:

After changing some C-code:

   * cd /usr/qmsys
   * qm -stop
   * ./buildgpl
   * qm -start

After changing Basic code:

   * qm -Internal "BASIC GPL.BP progname"
   * ./buildgpl

Gene and Ashley discovered that there was a missing file that prevented QPROC being recompiled. TODO:- recall and document this.