Luban Build
and Install Guide
Copyright (C) 2005 by Xiaochuan(Peter) Huang
All rights reserved.
Luban programming language package is free software; you can redistribute it and/or modify it under the terms of the "Luban License" which comes with this package.
Luban is a scripting language with a component and composition model. It is simple and intuitive for scripting purpose, while its component model will help you manage and share your code when your luban code base grows.
Requirements for building Luban package
1) gcc version 3.0 and up
Lower version of gcc would build, but the result Luban package will be thread unsafe
And the threading feature of Luban will be unuseable.
2) POSIX pthread library
If you like to change Luban’s grammar and syntax, you need below, else above are all you need to build Luban.
3) bison grammar parser v1.85 and up
4) flex the lexical parser
Build and Install Instructions For
Linux and UNIX alike:
0) Requirements for building Luban package
i. gcc version 3.0 and up
Lower version of gcc would build, but the result Luban package will be thread unsafe
And the threading feature of Luban will be unuseable.
ii. bison the grammar parser v1.85 and up
iii. flex the lexical parser
iv. you can modify the Luban build process to make it build
on other UNIX system other than Linux, as far as
- libc is thread safe (check your OS)
- pthread available
- STL used by compiler is thread safe
1) Download, unzip and untar the Luban package.
2) Change into the untared Luban directory and run "lbnbuild"
This will build all necessary executable and libraries
Starting from Beta2.0, if you don’t have env variable JAVA_HOME set up, you have to type in the value of JAVA_HOME at the start of the script
3) If you have root user privilege, change to root and run "lbninstall"
This will install "luban" executable into /usr/bin
and all libraries into /usr/lib,
all header files into /usr/lib/luban/include
all other files including import type list to /usr/lib/luban
4) If you do not have root access, you can install Luban into any directory,
for example /home/mydir/myluban, by typing "lbninstall /home/mydir/myluban"
This will install "luban" executable into /home/mydir/myluban/bin
and all libraries into /home/mydir/myluban/lib
all header files into /home/mydir/myluban/include
all other files including import type list to /home/mydir/myluban
5) After installation, you can start Luban by typing "luban -i"
If you install Luban as decribed in above step 4, you also need to do the following
before starting Luban:
a.) Make sure "luban" executable is reachable in your "PATH"
in our example add "/home/mydir/myluban/bin" to your PATH env variable
b.) Add the directory of Luban libraries to your LD_LIBRARY_PATH
in our example append "/home/mydir/myluban/lib" to LD_LIBRARY_PATH
c.) set env variable LUBAN_HOME to the directory you install luban
in our example, LUBAN_HOME=/home/mydir/myluban
Without above a) and/or b) luban won't start, without c) luban will start
but some standard utility data types and structure will be missing
Build and Install Instructions For Cygwin
on NT, 2000 and XP:
1) Download, unzip and untar the Luban package.
2) Change into the untared Luban directory and run "./lbnbuild.cygwin"
This will build all necessary executable and libraries
Starting from Beta2.0, if you don’t have env variable JAVA_HOME set up, you have to type in the value of JAVA_HOME at the start of the script
3) If you have root user privilege, change to root and run "./lbninstall.cygwin"
This will install "luban" executable into /usr/bin
and all libraries into /usr/bin,
all header files into /usr/lib/luban/include
all other files including import type list to /usr/lib/luban
4) If you wish to install Luban into a specific directory,
for example /home/mydir/myluban, by typing "./lbninstall.cygwin /home/mydir/myluban"
This will install "luban" executable into /home/mydir/myluban/bin
and all libraries into /home/mydir/myluban/lib
all header files into /home/mydir/myluban/include
all other files including import type list to /home/mydir/myluban
5) After installation, you can start Luban by typing "luban -i"
If you happen to install Luban as decribed in above step 4, you also need to do the following
before starting Luban:
a.) Make sure "luban" executable is reachable in your "PATH"
in our example add "/home/mydir/myluban/bin" to your PATH env variable
b.) Add the directory of Luban libraries to your PATH too
in our example append "/home/mydir/myluban/lib" to PATH
c.) set env variable LUBAN_HOME to the directory you install luban
in our example, LUBAN_HOME=/home/mydir/myluban
Without above a) and/or b) luban won't start, without c) luban will start
but some standard utility data types and structure will be missing
6) Programming details regarding Luban language can be found in "lubandoc.txt"
inside this package.
Extra Instructions For
Starting from Luban Beta 2.0, Luban user can use Luban Java Bridge (LJB)to access arbitrary Java classes. To build and run LJB, user only needs to follow the same instruction as above, with the following extra configurations:
1) set up environment variable JAVA_HOME before build and install
For example, you have your JDK at C:\jdk1.5.0_02 you need to specify this in POSIX format on cygwin:
JAVA_HOME=/cygdrive/c/jdk1.5.0_02
On linux, you need to do the same thing.
If you don’t have JAVA_HOME env variable setup, the build script will ask you for the value of JAVA_HOME at the beginning.
On Windows with Cygwin, you also need to make sure you have the write permission to JAVA_HOME/lib directory. Luban build script will copy one file jvm.dll.a file into that directory to enable gcc to link against jvm.dll
2) Make sure jvm.dll accessible at run time
On Linux, for example you have Java installed on /usr/lib/java, you need to have the environment variable LD_LIBRARY_PATH setup like below:
LD_LIBRARY_PATH=
/usr/lib/java/jre/lib/i386/client:/usr/lib/java/jre/lib/i386
On Windows, for example your Java installed at C:\jdk1.5.0, you need to put this into PATH environment variable:
PATH=C:\jdk1.5.0\jre\bin\client
3) Put the Java class jar files and directories into CLASSPATH
For all the classes you wish to load and use in LJB, if they are not part of Java standard package, you need to put the files or directories containing the Java classes into CLASSPATH environment variable.
For example, the luban.InvocationQueue class that LJB GUI code needs is inside a jar in LUBAN_HOME/javacode/luban.jar in order to use that, suppose you install Luban at C:\luban, then you need to set up CLASSPATH like this:
CLASSPATH=C:\luban\javacode\luban.jar
On Linux, it would be something like:
CLASSPATH=/usr/lib/Luban/javacode/luban.jar
4) Put all JVM start options into LUBAN_JVMOPTIONS
For example if you wish to specify heap size for JVM you can set the LUBAN_JVMOPTIONS environment variable like below:
LUBAN_JVMOPTIONS=”-Xms64m –Xmx256m”
Separate the options with space.
Enjoy