| Windows | |
| GNU/Linux |
Instructions relevant to a particular OS are marked with the corresponding icon.
Please feel free to contact the GLE mailing list if you experience any problems while compiling GLE. Also, please contact the list if you find that some information on this page is outdated, incorrect, or missing.
To compile GLE on Windows with GCC, you need a Windows port of GCC, "make", and other Unix-like tools. There are two options: MinGW/MSYS and Cygwin. GLE compiles fine with both systems. In this tutorial I will focus on Cygwin. Download Cygwin's "Setup.exe" from this location and double click it in Explorer. This will guide you through Cygwin's installation process. After asking you, among others, to select a download mirror, Cygwin's setup will show you a list with all software packages that can be installed. It is best to keep all packages that are selected by default. In addition, make sure that the following packages are selected:
|
| To compile GLE on Linux with GCC, you need the GNU build tools GCC and "make". In many cases, these are installed by default. To find out, enter the command "g++ --version" in a terminal window ("Gnome Terminal" on Gnome, or "Konsole" on KDE). If this prints "bash: g++: command not found", then GCC is not installed. Try the same with "make". If GCC or make is missing, then check your Linux distribution's software package repository and install the packages for "g++", "gcc", "make", and "libc-devel". On Ubuntu, all these packages can be installed at once with the command "sudo apt-get install build-essential". |
I'm using the following versions of GCC and make (newer versions also work):
[~]$ g++ --version g++ (GCC) 3.3.5 (Debian 1:3.3.5-13) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [~]$ make --version GNU Make 3.80 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Note that "[~]$" is my command prompt. The command prompt on your system might appear different. Only type the part that comes after the prompt. I.e., type "g++ --version" and then press enter and next type "make --version" and press enter. In the following, I assume basic familiarity with Bash and simple Unix commands.
On Windows you obtain the optional software packages as follows:
|
|
The optional software packages should all be included in your Linux distribution's package repository. You should be able to find and install them by searching the repository for the package names (i.e., "qt4", "libtiff", "libpng", ...). If, for a given package, a version is available with "devel" or "dev" in the name, then install that version. The "devel" packages typically include the "C" header files of the library, which are required to compile GLE.
The following are the appropriate commands to install all of the optional software packages on some well known Linux distributions:
QGLE requires the file "libgs.so". Normally this file should be part of GhostScript. If your distribution does not include "libgs.so" in its GhostScript package, then download gs8.54-linux.zip and extract it in your home directory, or somewhere under "/usr" (as root). This ZIP file contains a GhostScript binary that includes "libgs.so". To check if you have "libgs.so" or not, become root ("su" or "sudo bash") and type the following commands:
|
Download GLE's source code archive GLE-x.y.z-src.zip (with x.y.z the version number) from the download page and save it to your home directory. Open a terminal or console window and unzip the archive with the following commands.
[~]$ cd [~]$ unzip GLE-x.y.z-src.zip Archive: GLE-x.y.z-src.zip inflating: gle4/Makefile.gcc inflating: gle4/Makefile.in ... inflating: gle4/src/samples/Makefile.vc inflating: gle4/src/samples/sample.gle inflating: gle4/src/samples/sample_compare.eps |
The unzip command above should have unzipped GLE to a subfolder of your home directory called "gle4".
[~]$ cd gle4/ [~/gle4]$ ./configure |
|
On Linux, the default is to install GLE system wide in /usr/share/gle/x.y.z (for all users). You will need the root password of your system to do this. Alternatively, you may wish to install GLE in your home directory. To do so, use the "--prefix" option of configure as follows.
|
|
On Windows, the default is to build a Cygwin executable. In order to create a native Windows executable, which can run on non-Cygwin systems, add the configure option "--with-win32=yes". This option is also required if you wish to build QGLE. If you downloaded the bitmap libraries mentioned above (bitmap-win32-vx.y.zip) then you indicate this with the option "--with-gnuwin32=c:/Devel/bitmap-win32", and if you have Qt installed, then you add "--with-qt=c:/Devel/Qt4".
|
The output of configure should look similar to this:
checking for g++... g++
checking for C++ compiler default output... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking whether byte ordering is bigendian... no
checking how to run the C++ preprocessor... g++ -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for XOpenDisplay in -lX11... yes
checking for deflate in -lz... yes
checking for library containing socket... none required
checking for library containing gethostbyname... none required
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for jpeg_destroy_decompress in -ljpeg... yes
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for TIFFReadScanline in -ltiff... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for libpng-config... no
checking for png_create_write_struct in -lpng... yes
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for library containing wbkgdset... -lncurses
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/gle/Makefile
config.status: creating src/gle/bitmap/Makefile
config.status: creating src/gle/letzfitz/Makefile
config.status: creating src/gle/surface/Makefile
config.status: creating src/gle/tokens/Makefile
config.status: creating src/fbuild/Makefile
config.status: creating src/makefmt/Makefile
config.status: creating src/manip/Makefile
config.status: creating src/TeX/Makefile
config.status: creating src/gui/MakefileAC
config.status: creating src/config.h
config.status: src/config.h is unchanged
CPPFLAGS: -DHAVE_CONFIG_H $(VERSION_INFO) -Wreturn-type -I/usr/X11R6/include
LDFLAGS: -L/usr/X11R6/lib
LIBS: -lpng -ltiff -ljpeg -lz -lX11
** Configuration summary for GLE x.y.z (i686-pc-linux-gnu):
** Bitmap support:
PNG support: yes
TIFF support: yes
JPEG support: yes
** X11 preview support: yes
** Socket support: yes
** Include 'manip' utility: yes
** GLE GUI support: no
(make sure you have Qt >= 4.1.1 devel and use ./configure --with-qt=/path/to/qt.)
** Install data into: /home/jan/apps/share/gle/x.y.z
** Install binary into: /home/jan/apps/bin
(use ./configure --prefix=dir to change the installation directory.)
GLE x.y.z has been configured. The next step is to run "make". After "make" completes, run "make install" to install GLE.
|
If you see some error messages instead, please contact the GLE mailing list. I will try to list the most common problems here based on your feedback.
[~/gle4]$ make mkdir -p build mkdir -p build/bin mkdir -p build/lib make -C src/gle make[1]: Entering directory `/home/jan/gle4/src/gle' g++ -DHAVE_CONFIG_H -D__GLEVN__="\"x.y.z\"" -Wreturn-type -I/usr/X11R6/include -c -o cutils.o cutils.cpp g++ -DHAVE_CONFIG_H -D__GLEVN__="\"x.y.z\"" -Wreturn-type -I/usr/X11R6/include -c -o file_io.o file_io.cpp g++ -DHAVE_CONFIG_H -D__GLEVN__="\"x.y.z\"" -Wreturn-type -I/usr/X11R6/include setrelpath.cpp cutils.o file_io.o -o ../../build/bin/setrelpath ../../build/bin/setrelpath /home/jan/apps/bin /home/jan/apps/share/gle/x.y.z ../config.h Binary: "/home/jan/apps/bin" GLE_TOP: "/home/jan/apps/share/gle/x.y.z" Relative: "1" Path: "share/gle/x.y.z" g++ -DHAVE_CONFIG_H -D__GLEVN__="\"x.y.z\"" -Wreturn-type -I/usr/X11R6/include -c -o gle.o gle.cpp **SNIP** ... **SNIP** [texcmssi.afm]==>[texcmssi.fmt] ../../build/bin/makefmt texcmsy.afm [texcmsy.afm]==>[texcmsy.fmt] ../../build/bin/makefmt texcmti.afm [texcmti.afm]==>[texcmti.fmt] ../../build/bin/makefmt texcmtt.afm [texcmtt.afm]==>[texcmtt.fmt] mkdir -p ../../build/font cp *.fve *.fmt ../../build/font cp font.dat ../../build/font cp psfont.dat ../../build/font touch movefonts make[1]: Leaving directory `/home/jan/gle4/src/fonts' make -C src/lib -f Makefile.gcc make[1]: Entering directory `/home/jan/gle4/src/lib' mkdir -p ../../build/lib cp *.gle ../../build/lib/ make[1]: Leaving directory `/home/jan/gle4/src/lib' make -C src/TeX make[1]: Entering directory `/home/jan/gle4/src/TeX' cp init.tex ../../build/ ../../build/bin/gle -mkinittex GLE x.y.z [/home/jan/gle4/build/init.tex]-C-R- If GLE says 'Saving definitions', then compilation was successful. >> /home/jan/gle4/build/init.tex (629) |end text| Saving definitions make[1]: Leaving directory `/home/jan/gle4/src/TeX' ********************************************************** Type "make install" to install GLE x.y.z Install data into: /home/jan/apps/share/gle/x.y.z Install binary into: /home/jan/apps/bin ********************************************************** |
rm -rf /home/jan/apps/bin/gle* rm -rf /home/jan/apps/bin/manip* **SNIP** ... **SNIP** cp -r build/lib /home/jan/apps/share/gle/x.y.z cp build/bin/gle* /home/jan/apps/bin/ cp build/bin/manip* /home/jan/apps/bin/ strip /home/jan/apps/bin/gle* strip /home/jan/apps/bin/manip* **************************************************************** GLE x.y.z has been installed You can use GLE now by entering the command "gle" (Provided that /home/jan/apps/bin is in your PATH.) **************************************************************** |
GLE should now be ready to use. Enter the command "gle" in your terminal to test it.
GLE version x.y.z Usage: gle [options] filename.gle More information: gle -help |
GLE should respond as in the example above. If you instead get the message "bash: gle: command not found", then the directory containing the "gle" executable is not in your system's search path. This is what happens if you have installed GLE in your home directory and "$HOME/apps/bin" is not in your path.
To fix this, enter "export PATH=$HOME/apps/bin:$PATH" and try again. Add this line to your "~/.bash_profile" file to make it permanent. Note: if this does not work, you can always start GLE using the full path, e.g., by entering the command "$HOME/apps/bin/gle".
Please feel free to contact the GLE mailing list if you have any feedback regarding this compilation guide.