Top page

Tips, bugs and problems

This page gives information on how to solve bugs or other problems that have been discovered since v2.1.2 was released.

Cannot compile: GLUT include file 'glutbitmap.h' missing

If you have installed GLUT using the precompiled installable distribution, then it seems that the GLUT include file 'glutbitmap.h' (which is used by one of the clib files) is missing. This is an include file that is not really meant to be used externally, which is probably why it is not included in the compiled distribution.

To solve the problem, you should look at the the source code for the GLUT distribution, which ought to contain the 'glutbitmap.h' include file.

Alternatively, you can cut-and-paste the file from below. If you do this, then you should put the 'glutbitmap.h' file in the 'clib' directory. You must then edit the file 'ogl_bitmap_character.c' so that line number 26 reads:

#include "glutbitmap.h"
instead of:
#include <../lib/glut/glutbitmap.h>

Here follows the complete code for the 'glutbitmap.h' file. Warning: this was taken from the GLUT 3.6 distribution. If your version of GLUT is newer, this may not be adequate. In that case, you should get the complete source distribution (see above).

#ifndef __glutbitmap_h__
#define __glutbitmap_h__

/* Copyright (c) Mark J. Kilgard, 1994. */

/* This program is freely distributable without licensing fees 
   and is provided without guarantee or warrantee expressed or 
   implied. This program is -not- in the public domain. */

#if defined(WIN32)
#include <windows.h>
#pragma warning(disable:4244)
#endif /* WIN32 */
#include <GL/gl.h>

typedef struct {
  const GLsizei width;
  const GLsizei height;
  const GLfloat xorig;
  const GLfloat yorig;
  const GLfloat advance;
  const GLubyte *bitmap;
} BitmapCharRec, *BitmapCharPtr;

typedef struct {
  const char *name;
  const int num_chars;
  const int first;
  const BitmapCharRec * const *ch;
} BitmapFontRec, *BitmapFontPtr;

typedef void *GLUTbitmapFont;

#endif /* __glutbitmap_h__ */

Crash when using 'label' on Linux system

MolScript v2.0.1 (maybe also 2.0.2, 2.1 and 2.1.*) compiled on a Linux system (i486) using gcc (v2.7.2.1) seems to crash when using the 'label' command. The error message is something like:

  molscript: graphics.c:1314: apply_labelmask_case:
  Assertion `len > 0' failed.
  IOT trap/Abort

The reason for this is unknown. I have been unable to find an explanation. The same code runs fine on an SGI and other systems, so it may (just may) be a compiler bug.

The problem seems to go away if one compiles MolScript with the following flag set in the Makefile:


Just remove the comments for that line (it's already there) in the Makefile, and recompile molscript using the 'make' command, as described in the installation notes.

Thanks to Michael Merckel for information on this.

Bug in documentation: hsbreverseramp

In the documentation, a state parameter called hsbreverseramp is referred to. This is wrong: the state parameter is called hsbrampreverse and nothing else.

Thanks to John Tate for information on this.

Linking fails on SGI IRIX

Sometimes, linking together the MolScript software into executables fails on SGI IRIX systems. This is usually caused by attempting to link together object code files (*.o and *.a) of different types. The type of object code file is determined by different different compiler option flags during compilation.

It is not possible to mix object code files that have been compiled with the -32, -64 or -n32 flags of the SGI cc compiler. Only object code files of one single type can be compiled together into an executable.

Most often, the external software libraries are the problem here: these may have been compiled with different flags, in which case they must be recompiled with one single, consistent choice.

Compiling on DEC Alpha UNIX 4.0

To compile on a DEC Alpha UNIX 4.0 system, change the Makefile (both directories) lines:

     CC = cc
     COPT   = -O1 -mips2
     CCHECK = -ansi -fullwarn
     CC     = cc -migrate
     COPT   =
     CCHECK = -ansi
Thanks to Ethan Merritt for information on this.

Makefile for Linux (Redhat 4.2)

Note that since the directory structure for v2.1.1 is not the same as the one assumed in the Makefile for Linux Redhat 4.2, one should use the Makefile as modified below (for Linux Redhat 5.2), which was made for v2.1.1.

Ethan Merritt has successfully compiled the complete MolScript v2.0 implementation (i.e. including OpenGL support) on a Linux system (Redhat 4.2), using the Mesa software implementation of OpenGL by Brian Paul.

Warning: You must check that the GLUT library that may be included in your Linux system really is version 3.5 or newer. It is likely that it is older, and then it will probably not work.

The Makefile for Linux (Redhat 4.2) (pick it up from this link) was contributed by Ethan Merritt.

Thanks, Ethan!

Makefile for Linux (Redhat 5.2)

A contributor (who wishes to remain anonymous) has contributed an update of Ethan Merritt's Makefile for a complete compilation of MolScript under Linux (Redhat 5.2).

The Makefile.complete for Linux (Redhat 5.2) can be picked up from the link. It was made for MolScript v2.1.1, but is valid for v2.1.2 as well, since there was no change in the directory structure between the two.

Warning: You must check that the GLUT library that may be included in your Linux system really is version 3.5 or newer. It is likely that it is older, and then it will probably not work. See the links page in the MolScript documentation for info on where to get GLUT and Mesa.

Thanks, anonymous contributor.

Top page