4 Miscellaneous

4.1 Environment Variables

The following environment variables are used in the Mjølner System on all platforms.

BETALIB
Specifies how ~beta is expanded in BETA fragment properties. I.e. it should be set to the path indicating where you installed the Mjølner System. It is used by many tools in the Mjølner System.
BETAOPTS
Specifies options that the beta compiler should be invoked with by default.
BETALINKOPTIONS
Specifies the linker options to be used by the BETA compiler when linking. If set, it totally overwrites the default link options the compiler would have used otherwise.
TMPDIR
Occationallyally, the link-directives in the job-file scripts will use a directory for temporary files. If a specific directory is to be used (e.g. because the default temporary directory used is full), setting TMPDIR to the name of a directory, prior to compilation, will cause the link-directives to place temporary files in this directory.
BETART
See BETALIB/doc/betarun/BETART.html

4.1.1 Windows Specific Environment Variables

If TMPDIR is not set, the environment variables TMP and TEMP are searched. If none of these are set, the directory C:\TEMP is used.

4.1.1.1 Automatic Setting of Environment Variables

For most uses, the defaults registered in the registry by the installer are sufficient.

You can make Windows NT set the BETALIB and Path environment variables automatically each time you log in via the System tool in the Control Panel.

You can make Windows 95/98/2000 set the BETALIB and Path environment variables automatically each time you log in by setting it in the autoexec.bat file.

4.1.2 UNIX specific Environment Variables

CC
Set by the compiler in the jobfiles on all UNIX platforms. Thus $(CC) can be used in BUILD property commands (see [MIA 90-02]) and Makefiles invoked using the MAKE property.
MACHINETYPE
Is set automatically by the compiler during the execution of the jobfiles and make files. It may be necessary to set this variable manually, if these command files are executed manually.
LD_LIBRARY_PATH
This is a colon separated list of directories to search for external libraries during linking. Notice that not all standard UNIX linkers supports this variable directly, but the jobfiles generated by the beta-compiler will still use this variable.
BETAREPORT
If set, cause automatic sending of reports by e-mail to Mjølner Informatics in case a tool in the Mjølner System crashes with a fatal error. See the section on Error Reports below.

4.1.2.1 LD_LIBRARY_PATH on Silicon Graphics

On Silicon Graphics machines, LD_LIBRARY_PATH is especially important: Most BETA programs are linked using shared object files. This means, that a part of the linking process is postponed until runtime, and in order for this to work, the runtime loader must be able to locate the shared object files generated by the compiler. The compiler will output a suggestion for setting LD_LIBRARY_PATH after each compilation, that uses shared object files. In this case, LD_LIBRARY_PATH must be set before attempting to run the program. Otherwise you will get a loadtime error like
793:./foo: rld: Fatal Error: <INX>cannot map soname</INX> 'foo1..so'
using any of the filenames                                     
  /usr/lib/foo1..so:/lib/foo1..so:
  /lib/cmplrs/cc/foo1..so:
  /usr/lib/cmplrs/cc/foo1..so:
-- either the file does not exist or the file is not
mappable (with reason indicated in previous msg)

4.1.3 Macintosh Specific Environment Variables

The following MPW environment variables are used by the Mjølner System.

Warning! Warning: Except for the Verbose, Time, and BETART variables, you should probably not change these variables yourself.

{Verbose}
To analyse the BETA compiler memory usage is could be useful to set the Verbose option by issuing the following command in the MPW WorkSheet:
Set <INX>Verbose</INX> 1
Export Verbose
Output from the garbage collector of the BETA compiler will then be directed to a special window. The following command will turn off the garbage collector output:
Unset Verbose
Export Verbose
{Time}
To analyse the time used by the BETA compiler and the linker set the Time option by:
Set <INX>Time</INX> 1
Export Time
Time usage of the compiler and the linker will be printed in the compiler output window. The following command will turn off the time usage output:
Unset Time
Export Time
{betart}
Example of setting it for an MPW tool:
set BETART &quot;InfoIOA:IOA=512:InfoFile=info.dump&quot; <BR>export BETART
Example of setting for an application:

For applications the BETART environment variable is read from the resource of type 'STR ' with number 129 and name BETART. To change this resource use a resource editor, e.g. ResEdit. Specify the value as The String:

Then specify the number and name using the Resource Info dialog.
{betaLinkLibs}
Internal linking variable. Specifies the linker libraries to be used by the BETA compiler when linking (using standard MPW linker). If set, it totally overwrites the default link options, the compiler would have used otherwise.
{BetaLinkCreator}
Specifies the application creator, default 'BETA'
{BetaLinkType}
Specifies the application type, default 'APPL'.

By using the -Application and -Tool items in the ß menu BetaLinkCreator and BetaLinkType is changed to 'MPS ' and 'MPST', respectively.

4.2 Using the GNU Emacs Editor

If you want to use the very popular GNU Emacs text editor as an alternative to the structure editor included in the Mjølner System Integrated Tool ([MIA 99-39], [MIA 99-40], [MIA 99-34]), you may benefit from the beta-mode for Emacs located in the file

BETALIB/emacs/beta-mode.el
By putting the following lines of Emacs-Lisp code into your .emacs file, you can make Emacs automagically recognize your BETA source code file if they have the suffix .bet (textual BETA files).
(setq betalib (getenv "BETALIB"))
(if (not betalib) (setq betalib "/usr/local/lib/beta"))
;; or if you are on a PC: 
;; (if (not betalib) (setq betalib "c:\\beta"))

(setq load-path (append load-path 
                     (list (format "%s/emacs" betalib))))

(autoload 'beta-mode "beta-mode")
(setq auto-mode-alist (append (list (cons "\\.bet$" 'beta-mode))
                               auto-mode-alist))

When in beta-mode, you can get to know more about beta-mode by using M-x describe-mode. Also you may want to byte-compile beta-mode.el from within Emacs for improved performance. The directory BETALIB/emacs also contains various other contributions for using Emacs to edit BETA programs. For instance, the file beta-hilit19.el contains a setup for syntactic colouring of your BETA programs when using Emacs version 19 or later

Emacs is available for UNIX, PC and Macintosh.

4.2.1 Adding the BETA menu

The BETA menu in Emacs 19 or later can be added using the beta-mode-hook:
(defun mybeta ()
   "Adds BETA menu"  
   (interactive)
   (load "beta-menu19" t t)
   )

(setq beta-mode-hook 'mybeta)

4.2.2 Other useful thing to hook in

You may do more things using the beta-mode-hook. Here is a larger example:
(defun mybeta ()
   "Make the following local bindings in beta-mode:
C-xC-rj   calls beta-comment-justify
C-xC-rC-r calls beta-comment-justify-region
C-xC-rC-c calls beta-convert-region-to-comment
C-xC-ru   calls beta-remove-comment
C-xC-ri   calls indent-buffer.

Also adds BETA menu and beta-hilit19.
"  
   (interactive)
   (local-set-key "\C-x\C-rj"    'beta-comment-justify)
   (local-set-key "\C-x\C-r\C-r" 'beta-comment-justify-region)
   (local-set-key "\C-x\C-r\C-c" 'beta-convert-region-to-comment)
   (local-set-key "\C-x\C-ru"    'beta-remove-comment)
   (local-set-key "\C-x\C-ri"    'indent-buffer)
   (load "beta-menu19" t t)
   (load "beta-hilit19" t t)
   )

(setq beta-mode-hook 'mybeta)

4.3 Documentation on the World Wide Web

The latest version of these manual pages can always be found on the Internet at the URL

http://www.mjolner.com/mjolner-system/documentation/index.html

Various other information about BETA and The Mjølner System can be found at

Mjølner Informatics Homepage:
http://www.mjolner.com/
The BETA Language Homepage:
https://beta.cs.au.dk/

4.3.1 Introductory material

You may find introductory material in the distribution in

BETALIB/doc/tutorials.html

4.4 The comp.lang.beta Newsgroup

The USENET newsgroup comp.lang.beta is intended for discussions about the BETA language and the programs and systems written in or supporting BETA. Discussions concerning object-oriented programming principles based on the concepts known from BETA will also take place in comp.lang.beta, possibly cross-posted to comp.object.

The BETA language Frequently Asked Questions will be posted to comp.lang.beta, and the most frequently asked questions from comp.lang.beta will be included in the subsequent versions of this FAQ .

4.5 Error Reports

The following e-mail address can be used to send error reports and comments:

support@mjolner.com

This is not a hot-line support; but all e-mails will be answered as fast as possible. Mjølner Informatics can offer a contract for hot-line support.

For errors specific to either the mjolner tool or the beta compiler, the following two e-mail addresses may be used instead:

Mjølner Tool specific errors:
bug-mjolner@mjolner.com
BETA compiler specific errors:
bug-beta@mjolner.com

The following classification characters can be used to indicate which priority an error should have in the maintenance process.

An error report should include

On UNIX systems, the shell scripts in $BETALIB/bin, which invokes the beta compiler and the mjolner tool can be configured to cause automatic collecting of the necessary information and sending of it to Mjølner Informatics in case of serious bugs. This is done by setting the BETAREPORT environment variable to the value "yes":
setenv BETAREPORT yes
Errors in manuals can be reported using the on-line Manual Error Reporting Facility.

4.6 Legal Notice

Apple and Macintosh are registered trademarks of Apple Computer, Inc.
MPW is a trademark of Apple Computer, Inc.
UNIX is a registered trademark of AT&T.
Motorola is a trademark of Motorola, Inc.


Installation Guide and Platform Specific Issues
© 1999-2002 Mjølner Informatics
[Modified: Friday October 27th 2000 at 14:56]