Compiling OpenAstexViewer

Compiling the Main Source Code

If you wish to compile your own version of OpenAstexViewer or modify the source code, you can download a ZIP file from here.

Unpack the ZIP file into your preferred directory. A directory called OpenAstexViewer will be created. Within this directory is a subdirectory called src. This contains the OpenAstexViewer source code.

Also in the src directory are tools for compiling OpenAstexViewer. Under Microsoft Windows the compilation instructions are as follows.

  1. Compile the OpenAstexViewer scripting language interpreter.
    compile_parser.bat
    
  2. Compile the OpenAstexViewer source code
    compile_openastexviewer.bat
    

The final stage will have created a jar file called OpenAstexViewer.jar. This should contain all of the code and resources necessary to run OpenAstexViewer.

An example of how to run OpenAstexViewer as an application is given in run_openastexviewer.bat.

Compiling the OpenAstexViewer Renderer Class

Most of the source code for OpenAstexViewer is supplied as standard Java source code, which can be compiled with essentially any Java compiler.

The exception to this is the astex.Renderer class, which is preprocessed from the file astex/Renderer.j by the C preprocessor. This is to allow simplification and better performance of some parts of the graphics library. The source code distribution contains the preprocessed version of the code, and so you do not need to install any additional tools if you are not planning to make changes to the rendering components.

If you wish to make changes to the OpenAstexViewer Renderer class you must edit the file astex/Renderer.j and preprocess it using the compile_renderer.bat file. After this, you should be able to compile OpenAstexViewer using the instructions described above.

You will need to have a working C preprocessor for this stage. If you are compiling under linux you will almost certainly have this available already. If you are compiling under windows you should install one of the following sets of tools

Cygwin
This is an application that will install a Unix shell that you can use for other many tasks. The C preprocessor (cpp) is in the directory c:\cygwin\bin\cpp if you follow the standard installation procedure. There is a fairly automatedinstallation procedure available for Cygwin. To gain access to the C preprocessor in a Windows command shell add the directory c:\cygwin\bin to your path.
MinGW
This is a set of tools (Minimalist GNU for Windows) that will install compilers and other files for compiling programs under windows. This will install a working C preprocessor that can be used for the Renderer class.
When you have installed the compiler tools of your choice, you should add the directory containing the C preprocessor to your Windows PATH.
  1. Right click on the 'My Computer' on the desktop.
  2. Choose the Advanced tab.
  3. Click on Environment Variables near the bottom of the tab.
  4. Scroll through the System variables section till you find Path.
  5. Select Path and then click Edit.
  6. Scroll to the end of the definition and Add ;c:\cygwin\bin to the definition (note, use the actual directory where cpp is installed if it is different)
  7. Press OK
Now any new Windows command shells you open should have cpp available. Test this by typing cpp in a new window.

AstexViewer™ Copyright (C) 1999-2007 Astex Therapeutics Ltd.
OpenAstexViewer Copyright (C) 2007-2017 Mike Hartshorn