Difference between revisions of "Lua"

From PLplotWiki
Jump to: navigation, search
(Added Lua page)
 
m
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
== Instructions for Mac OS X ==
 
== Instructions for Mac OS X ==
  
* [[swig SWIG]] must already be installed.
+
* [[swig]] must already be installed.
 
* Download [http://www.lua.org/ftp/lua-5.0.3.tar.gz Lua 5.0.3]
 
* Download [http://www.lua.org/ftp/lua-5.0.3.tar.gz Lua 5.0.3]
 
* Untar lua-5.0.3.tar.gz into a folder of your choice
 
* Untar lua-5.0.3.tar.gz into a folder of your choice
Line 19: Line 19:
  
 
=== Set CMake paths ===
 
=== Set CMake paths ===
* set environment variables if you didn't use the standard path, e.g add the following lines to the ''.profile'' file in your home directory, if you installed Lua to ''$HOME/local/lua-5.0.3''
+
* Set environment variables if you didn't use the standard path, e.g add the following lines to the ''.profile'' file in your home directory, if you installed Lua to ''$HOME/local/lua-5.0.3''
 
  # add lua to PATH
 
  # add lua to PATH
 
  export PATH=$HOME/local/lua-5.0.3/bin:$PATH  
 
  export PATH=$HOME/local/lua-5.0.3/bin:$PATH  

Latest revision as of 01:28, 19 August 2009

Description

LUA is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Instructions for Mac OS X

  • swig must already be installed.
  • Download Lua 5.0.3
  • Untar lua-5.0.3.tar.gz into a folder of your choice
  • Edit the file config. In particular you need to uncomment the following lines to enable dynamic loading of libraries.
LOADLIB= -DUSE_DLOPEN=1
DLLIB= -ldl
  • Further set the installation prefix in config if you don't like the standard path.
  • Run
make && make install
  • Lua executable, libraries and headers are now installed.

Set CMake paths

  • Set environment variables if you didn't use the standard path, e.g add the following lines to the .profile file in your home directory, if you installed Lua to $HOME/local/lua-5.0.3
# add lua to PATH
export PATH=$HOME/local/lua-5.0.3/bin:$PATH 
export CMAKE_LIBRARY_PATH=$HOME/local/lua-5.0.3/lib:$CMAKE_LIBRARY_PATH 
export CMAKE_INCLUDE_PATH=$HOME/local/lua-5.0.3/include:$CMAKE_INCLUDE_PATH

CMake is now able to find Lua.

Instructions for Linux

N/A

Instructions for Windows

N/A