Compilation of GNU TeXmacs



1. Verify the TeXmacs dependencies

Before you install TeXmacs on your system, you have to make sure that the other programs on which TeXmacs depends, namely TeX and Guile Scheme (from the Gnome project) have been installed correctly. You can do this by checking whether the latex and guile binaries exists in your path


    which latex

    which guile-config

  
If one of these commands yields an error message, then click here.

2. Download and unpack the source code

Download the latest version of the source code, cd into the directory where you wish to compile TeXmacs and type


    tar -zxvf TeXmacs-[source version].tar.gz

  
All files will be unpacked into the directory TeXmacs-[version], which is the 'installation directory'.

3. Compile, install and run

TeXmacs supports the standard GNU compilation and installation procedure. Assuming that you logged yourself in as root, cd into the installation directory and type


    ./configure

    make

    make install

  
The first command examines your particular system configuration. The second command launches the compilation. Actually, it will first build the generic preprocessors 'gencc' and 'gendep'. Next the main source will be built. The last command installs TeXmacs in /usr/local.

If everything works fine, you should be able to run TeXmacs by


    texmacs &

  
If this does not work, you should make sure that /usr/local/bin is in your PATH. Depending on your shell, you can ensure this by typing

    export PATH=/usr/local/bin:$PATH   or

    setenv PATH /usr/local/bin:$PATH

  

4. Configuration options

If you cannot log yourself in as root, or if you want to install TeXmacs elsewhere than in /usr/local, then you should use


    ./configure --prefix=[target directory]

  
instead of ./configure. In this case, TeXmacs will be installed in [target directory] and you will have to set your PATH accordingly, as to contain [target directory]/bin. Other options supported by configure are

5. Static compilation

By default, we build TeXmacs using dynamically linked libraries. If you rather want to build the static version, use


    make STATIC_TEXMACS

  
If you have already built a dynamic version of TeXmacs and if you want to replace it by a static version, you should first clean up some makefiles, libraries and binaries, and type

    make OTHER

    make STATIC_TEXMACS

  

6. Problems



Optimized compilation

Using recent versions of the egcs compiler, it is possible to considerably speed up TeXmacs (with a factor between two and three) by optimizing the compilation. I personally use the following options on my PC under Gnu-Linux:


    export CXXFLAGS="-O3 -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2"

  
In order to build TeXmacs using these optimization flags, just type

    make -e

  
Notice that you might want to separate the compilation of the gencc preprocessor and the actual editor. In order to build the preprocessor only, type

    make GENCC

  
In a similar fashion, you may compile the editor with debugging information. In this case, you have to use the following flags:

    export CXXFLAGS=-g

  
Other environment variables recognized during the compilation of TeXmacs are

Problems when compiling with egcs

Unfortunately, several bugs seem to persist in the egcs compiler. In order to compile TeXmacs using egcs 2.95.2, optimization and redhat linux, I had to change correct source at three places in order to avoid segmentation faults.

A typical example of the kind of changes needed to get things working is avoiding nested expressions :


    SI

    TER::get_length (string name) {

      string s= get (name)->label;

      return decode_length (s);

    }

  
instead of

    SI

    TER::get_length (string name) {

      return decode_length (get (name)->label);

    }

  



Copyright (C) 1999, 2000 by Joris van der Hoeven.

This webpage is part of GNU TeXmacs and the larger GNU project. Verbatim copying and distribution of it is permitted in any medium, provided this notice is preserved. For more information or questions, please contact Joris van der Hoeven.

Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA