Personal tools

3.x Build Instructions

From OpenLaszlo

These are the instructions for building 3.1-3.3.3. The build system changed for 3.4; see SubversionBuildInstructions for build instructions for 3.4 and Legals.

Prefatory remarks: These are the instructions we use at Laszlo for setting up a new build environment for the OpenLaszlo platform. Setting up an OpenLaszlo build is reasonably complicated and there are number of places that things can go awry because of the large number of external dependencies. Sometime soon (with your input!), this document will improve and sometime after that, the build process for OpenLaszlo will also likely improve. In the meantime, the details below are intended for the intrepid folks who are determined to build their own copy of OpenLaszlo from the source distribution. If you are having trouble, it's best to try the laszlo-dev mailing list and the Laszlo developer forums.

(These instructions use the $ENV_VAR syntax for referring to environment variables). Mac OS X note: you will need to have the Developer Tools installed in order to complete these instructions.

Contents

Get the source and build tools

In this document, we refer to the top-most directory that contains the LPS and LPS-related source bits and build tools as ROOT.

If you are working from a source distribution, ROOT is the top level directory of the unpacked source distribution and will contain subdirectories named

  • 3rdparty - 3rd Party code that has been modified by Laszlo for use in LPS
  • lps-{version} - the source tree for LPS
  • tools - various tools (some modified, others not) for building LPS
  • 3rdPartyCredits - credits for all libraries and tools used in LPS
  • building-lps.html - this document

Set some environment variables

For most this will be something like:

Windows

 set LPS_HOME=C:\openlaszlo\trunk

Windows with Cygwin csh/tcsh

 setenv LPS_HOME C:\\openlaszlo\\trunk

UNIX/OS X csh/tcsh

 setenv LPS_HOME /home/username/openlaszlo/trunk

UNIX/OS X bash/sh

 export LPS_HOME=/home/username/openlaszlo/trunk


Note: it's recommended that you use the Windows-style path rather than a cygwin one for LPS_HOME.


Set up your environment variables

The rest of these instructions require set several environment variables. Cygwin, Mac OS X, and most linux distributions include bash as the default shell. Add these lines to your ~/.bashrc and set their values appropriately as you install the software in the rest of this document. This example .bashrc uses ~/openlaszlo as ROOT, and installs third-party tools into ~/loc.

   export WORK_HOME=~/openlaszlo
   export LPS_HOME=$WORK_HOME/trunk
   export LPS_BIN=$LPS_HOME/WEB-INF/lps/server/bin
   export ANT_HOME=$WORK_HOME/tools/jakarta-ant-1.5.1
   export JAVA_HOME=~/loc/java
   export JAVACC_HOME=$WORK_HOME/tools/javacc2.1
   export JYTHON_HOME=~/loc/jython-2.1
   export TOMCAT_HOME=~/loc/jakarta-tomcat-5.0.28
   export CATALINA_HOME=$TOMCAT_HOME
   export LPS_PATHS=$JAVA_HOME/bin:$ANT_HOME/bin:$JAVACC_HOME/bin:$JYTHON_HOME:$TOMCAT_HOME/bin:$LPS_BIN
   export PATH=$LPS_PATHS:$PATH

Modify your environment to use ant

We are currently using a slightly-modified version of Jakarta Ant 1.5.1 for builds. This version of ant is at ROOT/tools/jakarta-ant-1.5.1. Open Laszlo does not work with ant 1.6.x yet.

Set your ANT_HOME environment variable to point to ROOT/tools/jakarta-ant-1.5.1.

Add $ANT_HOME/bin to the beginning of your PATH environment variable to make sure you pick up the right version of ant.

For Windows and Linux systems, install Sun's J2SE SDK 1.4.2 as well.

Set your JAVA_HOME environment variable to point to the J2SDK 1.4 directory (e.g., on Windows, C:\j2sdk1.4.2_3). Also, make sure that $JAVA_HOME/bin is in your $PATH and occurs before any system java binary locations.

Mac OS X (Panther - 10.3) comes with Java 1.4.2 so there is no need to install it. On MacOS, set JAVA_HOME to /Library/Java/Home.


We are using JavaCC, Jython, and Python (with PyXML package installed)

Install ROOT/tools/JavaCC2_1.class.

Typical command is java -cp . JavaCC2_1.

Set your $JAVACC_HOME environment variable to the location where you installed JavaCC. You may need to make the cache directory writing enabled on a linux and Mac OS X machine.

IMPORTANT Check to see if $LPS_HOME/3rd-party/jars/dev/JavaCC.zip exists. If it doesn't, copy $JAVACC_HOME/bin/lib/JavaCC.zip to $LPS_HOME/3rd-party/jars/dev/JavaCC.zip

Get and install Jython 2.1

Typical command is java -cp . jython-21.

Mac OS X Note: If the GUI installer fails to install Jython, try the command line installation, where $JYTHON_INSTALL_DIR is where you want Jython installed.

 java -cp . jython-21 -o $JYTHON_INSTALL_DIR

Set your $JYTHON_HOME environment variable to the location where you installed jython. Copy the jythonc (jythonc.bat on Windows) script to a directory that is in your $PATH.

Mac OS X and Linux note: there are certain directories in the jython installed directory that need to be writable - if you install this in /usr/local as root, make sure the installed tree is world writable.


Get and install Python 2.2 or 2.3 - the windows installer is included.

After you install it, make sure the directory where you installed python is in your $PATH.

Windows CYGWIN users note: make sure that this directory comes before /usr/bin so that you pick up Windows Python2 instead of CYGWIN python. This can be changed in the profile file in your cygwin/etc directory.

Mac OS X and most modern Linux distros come with Python 2.2 or 2.3 already loaded.

Note for linux: python-devel must be installed, this is often not the default and will require your install CDs.

Install PyXML

Download PyXML

Version 0.8.3 is needed and included for Mac OS X Panther/10.3 and up.

For Linux and Mac OS X unpack the distribution and use the commands python setup.py build and python setup.py install to install PyXML correctly. On Linux and Mac OS X need to do this as root - using sudo or the like.

Windows installer is included in this release

Mac OS X note: you will need to install the Developer Tools in order to successfully build and install PyXML.

[ptw's notes: On OS X, you need to:

   python setup.py build
   sudo python setup.py install --install-lib /usr/local/lib/python2.3/site-packages

I set the `--install-lib` option so that I won't lose my local extensions if OS X updates Python. I also put the following in my .bashrc so Python sees the local packages:

   # we use _xmlplus, which I put here to stay out of the /System dir
   export PYTHONPATH=/usr/local/lib/python2.3/site-packages

]

Install the modified Tomcat 5.0.24 found in ROOT/3rdparty

Important Notes for Windows: You will have an easier time typing pathnames if you install it at C:\tomcat5 instead of the default location. Also, when asked, create an administrative user named 'admin' with password 'laszlo'. And finally, At the end of installing tomcat 5.0.24, do NOT start the server (the default is to start it). Let the build system do that for you. (If the installer leaves the service running, the LPS build system can't be used to stop/start it). (For those who care to know details, the LPS build system installs the Tomcat5 NT service under the name 'LPS' so you can use net stop LPS, net start LPS to start/stop the service)

Important Notes for Linux and Mac OS X: If you install this as root in /usr/local - make sure the whole installed tree is world writable.

Set the $TOMCAT_HOME environment variable to point to where you installed it.

For example C:\Program Files\Apache Group\Tomcat 5.0.24 . (For windows users, it should be a windows PATH and not a cygwin one).

Windows users should install Cygwin

Add the Cygwin bin directory to your $PATH.

Try it out!

Add $LPS_HOME/WEB-INF/lps/server/bin to your $PATH to make lzc, lzmc, and other LPS development utilities generally available from the shell.

From the top of your source tree, try 'cd $LPS_HOME ; ant build ; ant start ; ant install'. Then browse to http://localhost:8080/lps-{version}.

For other details, see ant -projecthelp from the top level lps-{version} directory

[_pw9_]

nvnv