Download | Reference | Community | Parts Library | Login

  Get Started | Parts Updates | Windows | Macintosh | Linux | DOS | Source Code

Download: Get Started: Linux Users

Linux Users

This section will help you getting started with LDraw on Linux. You need system operator rights (the password for the "root" account) to follow these instructions.

Before You Start...

These instructions assume you have some tools installed on your system. Here is a list:

wget
You can check if you have wget installed with the command:
wget --version
If you don't have it, you may download it from http://wget.sunsite.dk/.
Perl
You can check if you have Perl installed with the command:
perl --version
If you don't have it, you may download it from http://www.perl.org/.
bzip2
You can check if you have bzip2 installed with the command:
bzip2 --version
If you don't have it, you may download it from http://sources.redhat.com/bzip2/.
GNU Compiler Collection
The LDraw tools for Linux comes in source form, so you need the GNU Compiler collection (at least gcc and make) to translate the programs to executable form. These tools usually come in the "development" section of your Linux distribution.

Step 1 (latest update 2003-03-11):

Download and install the LDraw Parts Library.

user$ cd /tmp
user$ wget http://www.ldraw.org/download/start/linux/linux-ldraw-library-2003-03-11.tar.bz2
...
user$ su -
Password:
root# cd /usr/local/share/
root# tar xjf /tmp/linux-ldraw-library-2003-03-11.tar.bz2 && echo OK
...
OK
root# mkdir -p ldraw/bitmap
root# chmod a+w ldraw/bitmap
root# chown -R root.root ldraw
root# exit
exit
user$

Step 2 (latest update 2002-05-23):

Download and install the general 3D graphics library Mesa. It might already be on your system and in that case you can skip this step. Having the packages "XFree86", "XFree86-devel", "glut" and "glut-devel" on a Red Hat system appears to be equivalent to having Mesa installed.

user$ cd /tmp
user$ wget http://download.sourceforge.net/mesa3d/MesaLib-4.0.2.tar.bz2
...
user$ bunzip2 < MesaLib-4.0.2.tar.bz2 | tar xf -
user$ wget http://download.sourceforge.net/mesa3d/MesaDemos-4.0.2.tar.bz2
...
user$ bunzip2 < MesaDemos-4.0.2.tar.bz2 | tar xf -
user$ cd Mesa-4.0.2
user$ ./configure && make && echo OK
...
OK
user$ su root -c 'make install && echo /usr/local/lib >> /etc/ld.so.conf && ldconfig && echo OK'
...
OK
user$ cd ..
user$ rm -rf Mesa-4.0.2

Step 3 (latest update 2002-05-23):

Install the building instruction renderer LDGLite. LDGLite is a rather efficient tool for showing building instructions "on the fly", when you download them as ".dat", ".ldr" or ".mpd" files from the web.

user$ cd /tmp
user$ wget http://ldglite.sourceforge.net/ldglitesrc0_9_5.zip
...
user$ unzip -uoa ldglitesrc0_9_5.zip
...
user$ cd ldglite
user$ make -f makefile.linux && echo OK
...
OK

There is a small risk that you may run into errors at this point, if your system lacks some libraries. These errors will probably be of the form .../bin/ld: cannot find -lX11. If you don't know how to handle this, please contact an experienced Linux system administrator.

user$ su
Password:
root# chown root.root l3glite l3gledit ldglite readme.txt
root# mv l3glite l3gledit ldglite /usr/local/bin
root# mv readme.txt /usr/local/share/ldraw/ldglite.readme
root# exit
exit
user$ cd ..
user$ rm -rf ldglite

Now you should be ready to run LDGLite - as the command ldglite - but since the LDraw library has been placed differently from what LDGLite expects, you have to set the environment variable LDRAWDIR to that directory (/usr/local/share/ldraw). You can do that in your runtime configuration scripts, just before you run ldglite, or you can create a script that sets LDRAWDIR and then calls ldglite. I have chosen the last of these three solutions (where I also make sure that there is no limits on the stack size):

user$ su
Password:
root# cat > /usr/local/bin/ldglite-run << THE-END
? #!/bin/tcsh
? setenv LDRAWDIR /usr/local/share/ldraw
? limit stacksize unlimited
? /usr/local/bin/ldglite \$*
? THE-END
root# chmod a+x /usr/local/bin/ldglite-run
root# cat >> /etc/mailcap << THE-END
? application/x-ldraw;/usr/local/bin/ldglite-run -mc %s
? application/x-multi-part-ldraw;/usr/local/bin/ldglite-run -mc %s
? THE-END
root# exit
exit
user$

Step 4 (latest update 2002-05-23):

Now your browser should be ready to open LEGO building instructions directly in LDGLite, when you click on links to them on the internet. You can test it by clicking on tux.dat, which should open a window with building instructions for a penguin (Tux, the mascot of Linux). You may have to restart your browser to make it recognise the existence of LDGLite.

Step 5:

There are currently two ways to create LEGO building instructions on your computer. You can either write/edit the raw text LDraw files or you can use an interactive drawing program, where you can move pieces around on the screen. If you chose the former method, you should just use your usual text editor and skip this step. If you would like to try the latter method, you should install the program LeoCAD.

LeoCAD

LeoCAD is a great 3D editor for Linux (and Windows) which has offered several improvements to the straight LDraw .dat format. It supports some basic animation (via keyframing) and can also export to 3DStudioMax, POV-Ray, and Alias Wavefront.

To download, visit the LeoCAD site and follow the instructions.

Step 6:

Dive In!
Learning how to use your new editor or understanding the LDraw file format may be a challenge, but with a little practice you will get the hang of it. The LeoCAD Manual by Leonardo Zide will help you getting started.

Step 7:

Introduction to LDraw Utilities

There is a lot you can do with LDraw files beyond just creating LEGO models! Many contributors have developed utilities to make the most of the LDraw file format. Check out a brief introduction to a few utilities, and then move on to download them.

Step 8:

Download Software

Check out LDraw.org's (incomplete) list of software packages to download which supplement the standard editors. Download programs like L3P, POV-Ray, various file format converters and rendering tools.

Help!

Need help with any of this? Check out LDraw.org's Help Section, or check out the Lugnet CAD discussion groups and ask a large group of users for help.

LegoŽ is a registered trademark of the Lego Group. Please see our legal page for details. LDraw, the LDraw file format, MLCad, and other software mentioned on this website are not official software titles published by the LEGO Group, they are developed by private, individual enthusiasts. For more information and discussion, please visit the Lugnet CAD discussion group.

  Get Started | Parts Updates | Windows | Macintosh | Linux | DOS | Source Code

© 2003 LDraw.org. See Legal Info for details.

In Memory of James Jessiman - 1971-1997