Changeset 1519:17e367a93cbb in lemon-0.x
- Timestamp:
- 06/27/05 21:47:09 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2004
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/getstart.dox
r1517 r1519 2 2 \page getstart How to start using LEMON 3 3 4 In this page we detail how to start using LEMON, from downloading it to 5 your computer, through the steps of installation to showing a simple 6 "Hello World" type program that already uses LEMON. We assume that you have a 7 basic knowledge of your operating system and \c C++ or \c C 8 programming language. 4 In this page we detail how to start using LEMON, from downloading it to 5 your computer, through the steps of installation, to showing a simple 6 "Hello World" type program that already uses LEMON. We assume that you 7 have a basic knowledge of your operating system and \c C++ programming 8 language. The procedure is pretty straightforward, but if you have any 9 difficulties don't hesitate to 10 <a href="http://lemon.cs.elte.hu/mailinglists.html">ask</a>. 9 11 10 12 \section requirementsLEMON Hardware and software requirements 11 13 12 Hardware requirements ... 14 In LEMON we use C++ templates heavily, thus compilation takes a 15 considerable amount of time and memory. So some decent box would be 16 advantageous. But otherwise there are no special hardware requirements. 13 17 14 You will also need a C++ compiler. We mostly used the Gnu C++ Compiler (g++),15 from version 3.0 upwards. We also checked the Intel C compiler 16 (icc). Unfortunately, Visual C++ compiler knows not enough to compile the 17 library, so if you are using Microsoft Windows, then try to compile under 18 Cygwin. 18 You will need a recent C++ compiler. Our primary target is the GNU C++ 19 Compiler (g++), from version 3.3 upwards. We also checked the Intel C 20 compiler (icc). Microsoft Visual C++ .NET version was also reported to 21 work (but not the earlier versions). If you want to develop with LEMON 22 under Windows you could consider using Cygwin. 19 23 20 Ide kell írni:21 22 -Hol fordul (Windows-os fordító nem fordítja, unix/linux alatt gcc hanyas verziója kell)23 -24 24 25 In this description we will suppose a linux environment and G nuC Compiler.25 In this description we will suppose a linux environment and GNU C Compiler. 26 26 27 27 \section downloadLEMON How to download LEMON 28 28 29 29 You can download LEMON from the LEMON web site: 30 http://lemon.cs.elte.hu/dowload.html 31 . There you will find the issued distributions 32 in form of <tt> .tar.gz </tt> files. If you want a developer version (for example you want to contribute in developing the library LEMON) then you might want to use our Subversion repository. This case is not detailed here, so from now on we suppose that you downloaded a tar.gz file. 30 http://lemon.cs.elte.hu/dowload.html. 31 There you will find released versions in form of <tt>.tar.gz</tt> files. 32 If you want a developer version (for example you want to contribute in 33 developing the library LEMON) then you might want to use our Subversion 34 repository. This case is not detailed here, so from now on we suppose that 35 you downloaded a tar.gz file. 33 36 34 37 … … 38 41 In order to install LEMON you have to do the following 39 42 40 Download the tarball (named <tt>lemon-x.y.z.tar.gz</tt> where \c x,\c y and \c z are 41 numbers indicating the version of the library: in our example we will have lemon-0.3.1) and issue the following commands: 43 Download the tarball (named <tt>lemon-x.y.z.tar.gz</tt> where \c x,\c y 44 and \c z are numbers indicating the version of the library: in our example 45 we will have <tt>lemon-0.3.1.tar.gz</tt>) and issue the following 46 commands: 42 47 43 \ code48 \verbatim 44 49 tar xvzf lemon-0.3.1.tar.gz 45 50 cd lemon-0.3.1 46 51 ./configure 47 52 make 48 make check (This is optional, but recomended. It runs a bunch of tests.)53 make check #(This is optional, but recomended. It runs a bunch of tests.) 49 54 make install 50 \end code55 \endverbatim 51 56 52 These commands install LEMON under \c /usr/local (you will probably need \c root 53 privileges to be able to install to that directory). If you want to install it 54 to some other place, then pass the \c --prefix=DIR flag to \c ./configure. In 55 what follows we will assume that you were able to install to directory \c 56 /usr/local, otherwise some extra care is to be taken to use the library. 57 These commands install LEMON under \c /usr/local (you will 58 need root privileges to be able to install to that 59 directory). If you want to install it to some other place, then 60 pass the \c --prefix=DIR flag to \c ./configure. In what follows 61 we will assume that you were able to install to directory 62 \c /usr/local, otherwise some extra care is to be taken to use the 63 library. 57 64 58 65 We briefly explain these commands below. 59 66 60 \ code67 \verbatim 61 68 tar xvzf lemon-0.3.1.tar.gz 62 \endcode 63 This command untars the <tt>tar.gz</tt> file into a directory named <tt> lemon-0.3.1</tt>. 69 \endverbatim 70 This command untars the <tt>tar.gz</tt> file into a directory named <tt> 71 lemon-0.3.1</tt>. 64 72 65 \ code73 \verbatim 66 74 cd lemon-0.3.1 67 \end code75 \endverbatim 68 76 Enters the directory. 69 77 70 \ code78 \verbatim 71 79 ./configure 72 \end code80 \endverbatim 73 81 Does some configuration (creates makefiles etc). 82 \todo Explain the most important switches here (gui, doc, glpk, cplex). 74 83 75 \ code84 \verbatim 76 85 make 77 \endcode 78 This command compiles the <tt> .cc</tt> files of the library package (the 79 implementation of non-template functions and classes and some test and demo 80 programs) and creates the very important <b> libemon.la </b> file. When 81 linking your program that uses LEMON it needs to access this file. 86 \endverbatim 87 This command compiles the non-template part of LEMON into 88 <b>libemon.a</b> file. It also compiles some benchmark and demo 89 programs. 82 90 83 \ code84 make check (This is optional, but recomended. It runs a bunch of tests.)85 \end code86 This is an optional step: it runs the test programs that we developed for87 LEMON to check 88 whether the library works properly onyour platform.91 \verbatim 92 make check 93 \endverbatim 94 This is an optional step: it runs the test programs that we 95 developed for LEMON to check whether the library works properly on 96 your platform. 89 97 90 \ code98 \verbatim 91 99 make install 92 \end code100 \endverbatim 93 101 This will copy the directory structure to its final destination (e.g. to \c 94 /usr/local) so that your system can access it. 102 /usr/local) so that your system can access it. This command should 103 be issued as "root", unless you provided a \c --prefix switch to 104 the \c cofugure to install the library in non-default location. 95 105 96 106 \section helloworld My first program using LEMON 97 107 98 If you have installed LEMON on your system you 99 can paste the following code 100 segment into a fileto have a first working program that uses library LEMON.108 If you have installed LEMON on your system you can paste the 109 following code segment into a file (named e.g. \c hello_lemon.cc) 110 to have a first working program that uses library LEMON. 101 111 102 112 \code … … 104 114 #include <lemon/list_graph.h> 105 115 106 using namespace lemon;107 108 116 int main() 109 117 { 110 typedef ListGraph Graph;118 typedef lemon::ListGraph Graph; 111 119 typedef Graph::EdgeIt EdgeIt; 112 120 typedef Graph::NodeIt NodeIt; 121 using lemon::INVALID; 113 122 114 123 Graph g; … … 130 139 std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; 131 140 std::cout << std::endl; 132 141 } 133 142 \endcode 134 143 … … 151 160 \c source member functions can be used to access the endpoints of an edge. 152 161 153 If you have saved the preceding code into a file named, say, \c hemon.cc and your installation of LEMON into directory \c /usr/local was 154 successful then it is very easy to compile this program with the following 155 command (the argument <tt>-lemon</tt> tells the compiler that we are using the 156 installed library LEMON): 157 \code 158 g++ hemon.cc -o hemon -lemon 159 \endcode 162 If you have saved the preceding code into a file named, say, \c 163 hello_lemon.cc and your installation of LEMON into directory \c 164 /usr/local was successful then it is very easy to compile this 165 program with the following command (the argument <tt>-lemon</tt> 166 tells the compiler that we are using the installed library LEMON): 160 167 161 As a result you will get the exacutable \c hemon in 168 \verbatim 169 g++ hello_lemon.cc -o hello_lemon -lemon 170 \endverbatim 171 172 As a result you will get the exacutable \c hello_lemon in 162 173 this directory that you can run by the command 163 \ code164 ./he mon165 \end code174 \verbatim 175 ./hello_lemon 176 \endverbatim 166 177 167 178 168 If everything has gone well then the previous code fragment prints out the following: 179 If everything has gone well then the previous code fragment prints 180 out the following: 169 181 170 \ code182 \verbatim 171 183 Nodes: 2 1 0 172 184 173 185 Edges: (0,2) (1,2) (0,1) (2,1) (1,0) (2,0) 174 \end code186 \endverbatim 175 187 176 188 Congratulations! 177 189 178 If you want to see more features, go to the \ref quicktour "Quick Tour to 179 LEMON", if you want to see see some demo programs then go to our 190 If you want to see more features, go to the 191 \ref quicktour "Quick Tour to LEMON", 192 if you want to see see some demo programs then go to our 180 193 \ref demoprograms "Demo Programs" page! 181 194
Note: See TracChangeset
for help on using the changeset viewer.