3

I want to set up LEDA library in my system.

I have downloaded LEDA library from the following link

http://www.algorithmic-solutions.info/free/d5.php

    Instruction given in read me file



       2. Preparations
    ---------------

    Unpacking the LEDA distribution file 
    LEDA---.tar.gz will create the LEDA root 
    directory "LEDA---". You might want to rename 
    it or move it to some different place. Let  denote the final 
    complete path name of the LEDA root directory. 

    To install and use the Unix object code of LEDA you have to modify 
    your environment as follows: 

    a)  LEDAROOT:
    Set the environment variable LEDAROOT to the LEDA root directory: 

    csh/tcsh: setenv LEDAROOT  

    sh/bash: LEDAROOT= 
      export LEDAROOT 

    b)  Command Search Path:
    Include $LEDAROOT/Manual/cmd into your command search path 
    (environment variable path (csh) or PATH (sh)) and call rehash (if 
    required by your system). 

    c)  Shared Library: (for solaris, linux, irix, osf1) 
    If you planning to use shared libraries include $LEDAROOT into the 
    LD_LIBRARY_PATH search path. Then go to $LEDAROOT and type 
    make shared. This will construct the shared libraries from the static
    libraries. 
    Please note: Building the shared library is not supported on each
    platform.

    d)  xlman and demos: Go to $LEDAROOT and type make xlman to compile 
    and link LEDA's interactive manual reader xlman. Now you can start 
    xlman for reading and printing manual pages, starting demo programs 
    and browsing more release notes. 


    3. Compiling and linking application programs
    ---------------------------------------------

    a) Use the -I compiler flag to tell the compiler where to find the 
    LEDA header files.

    CC (g++) -I$LEDAROOT/incl -c file.c

    b) Use the -L compiler flag to tell the compiler where to find the 
    library (libleda.a/so)

    CC (g++)  -L$LEDAROOT file.o -lleda -lX11 -lm

    If using windows on solaris systems you might have to link 
    with the system socket library and the network services library as 
    well:
    CC (g++)  ... -lleda -lX11 -lsocket -lnsl -lm

    c) Compile and link simultaneously with

    CC (g++)  -I$LEDAROOT/incl -L$LEDAROOT file.c -lleda -lX11 -lm

    You may want to ask your system adminstrator to install the header 
    files and library in the system's default directories.
    Then you no longer have to specify header and library search paths on 
    the compiler command line.

I followed these instruction but I got error in command

> make xlman

    error
    coredump@coredump-VPCCB15FG:~/Documents/LEDA$ make xlman 
    make -C demo/xlman 
    make: *** demo/xlman: No such file or directory.  Stop.
    make: *** [xlman] Error 2

someone please help me to setup library.

user69910
  • 971
  • 2
  • 9
  • 14
  • Have you set up environmental variables? make can't find `demo/xlman` directory so I suppose there might be something messed up with (a) from your instructions. Eventualy just have a look if `~/Documents/LEDA/demo/xlman` exists – Greg0ry May 14 '13 at 19:38
  • NO there is no directory demo in LEDA folder – user69910 May 15 '13 at 05:19
  • Should I create demo and xlman directory myself???I have downloaded LEDA from that site http://www.algorithmic-solutions.info/free/d5.php – user69910 May 15 '13 at 06:17
  • Well, it's a bit strange what you are saying. This: `coredump@coredump-VPCCB15FG:~/Documents/LEDA$ make xlman` makes me thinking you were trying to run `make` from `~/Documents/LEDA$` directory. Other words this line suggests you were in that directory so you have either deleted it or you are looking for `LEDA` somewhere else than `~/Documents`. – Greg0ry May 15 '13 at 13:10
  • from where I have to run make command.In instructions it is given that "go to LEDAROOT and run make", and also when I downloaded LEDA there is no demo folder in that directory . – user69910 May 16 '13 at 01:57
  • When you unzip this into your `home` directory just navigate to that directory (I assume directory name is `LEDA` unless you change id). Just do `ls -la` and copy result here. – Greg0ry May 17 '13 at 07:52

1 Answers1

0

NOTE: For the free version of the Leda library, you don't have to build the package to use the library. It simply doesn't work.

To use the library simply include it in your compile line and linker.

If you are compiling from the shell (assuming you are using Linux), do the following:

1. Set the env variable to the library folder e.g export LEDAROOT= /path/to/Leda
2. Set the LD_LIBRARY_PATH env variable e.g export LD_LIBRARY_PATH=$LEDAROOT

Verify that this variables are set then you can compile and link and run. You can simply do

CC (g++)  -I$LEDAROOT/incl -L$LEDAROOT file.c -lleda -lX11 -lm

With this you should be good to go.

If you are using an IDE, simply add the include path (i.e /path/to/leda) to you project settings.

This is all you have to do. Building the library does not work. Simply include it

Emmanuel John
  • 2,296
  • 1
  • 23
  • 30