Changes between Version 3 and Version 4 of user-examples


Ignore:
Timestamp:
May 28, 2006 12:20:30 PM (14 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • user-examples

    v3 v4  
    66in the directory {{{Coin-Pkg}}}. You have run {{{configure}}}, {{{make}}}, and {{{make install}}} from
    77the directory {{{Coin-Pkg}}}. Assume that you used {{{Coin-Pkg}}} as
    8 the install directory (i.e. the default), obtaining a library
    9 {{{Pkg.so}}} in {{{Coin-Pkg/lib}}} and include files in {{{Coin-Pkg/include}}}.
     8the install directory (i.e. the default), obtaining libraries
     9in {{{Coin-Pkg/lib}}} and include files in {{{Coin-Pkg/include}}}.
    1010
    1111For most packages, the main directory contains an {{{examples}}}
    12 subdirectory. Assuming that this is the case for the package {{{Pkg}}}, the directory {{{Coin-Pkg/examples}}}
     12subdirectory. Assuming that this is the case for the package {{{Pkg}}}, the directory {{{Coin-Pkg/Pkg/examples}}}
    1313contains a {{{Makefile}}} that  has been adapted to your system.
    1414If you want to hook up your own code to this COIN library, it might be a good idea to start by looking at this Makefile.
    1515
    1616{{{Note:}}}  You should use only the libraries and header files that have been installed in {{{Coin-Pkg/lib}}} and {{{Coin-Pkg/include}}}
    17 not those in any other directory.  We are using the GNU autotools to compile the code, and picking up libraries and headers from the source directories has a good chance of creating problems.
     17not those in any other directory.  Picking up libraries and headers from the source directories has a good chance of creating problems.
    1818
    1919In order to modify {{{examples/Makefile}}} to compile your own code, you usually only have to change the first part, which might look like this:
     
    7575
    7676# additional C++ Compiler options for linking
    77 CXXLINKFLAGS =  -Wl,--rpath -Wl,/home/me/CoinStuff/lib
     77CXXLINKFLAGS =  -Wl,--rpath -Wl,/home/me/Coin-Pkg/lib
    7878
    7979# Directory with COIN header files
    80 COININCDIR = /home/me/CoinStuff/include
     80COININCDIR = /home/me/Coin-Pkg/include
    8181
    8282# Directory with COIN libraries
    83 COINLIBDIR = /home/me/CoinStuff/lib
     83COINLIBDIR = /home/me/Coin-Pkg/lib
    8484
    8585# Libraries necessary to link with Clp
     
    125125}}}
    126126
    127 The compiler name variables {{{CXX}}, {{{CC}}} and {{{F77}}} will already be adapted to your system, as well as the corresponding variables for the compiler flags.  Those are the same that have been used to compile the COIN library, and it is probably not a bad idea to choose similar (or compatible) options.
     127The compiler name variables {{{CXX}}}, {{{CC}}} and {{{F77}}} will already be adapted to your system, as well as the corresponding variables for the compiler flags.  Those are the same that have been used to compile the COIN library, and it is probably not a bad idea to choose similar (or compatible) options.
    128128
    129 The {{{COININCDIR}}} and {{{COINLIBDIR}}} will have been adapted to the directory where the COIN libraries have been installed.  (In the above example, it is assumed that you ran {{{configure}}} with the flag {{{--prefix=/home/me/CoinStuff}}}, so that the result of the COIN compilation was installed into subdirectories there.)
     129The {{{COININCDIR}}} and {{{COINLIBDIR}}} is adapted to the directory where the COIN libraries have been installed.
    130130
    131131If you compiled the COIN library as a shared object, the {{{CXXLINKFLAGS}}} is set to the compiler link flag that hardcodes the search path to the installed library into the executables (if that is supported on your system).  Alternatively, you can set the {{{LD_LIBRARY_PATH}}} or similarly to include the directory with the shared object.
     
    133133The {{{LIBS}}} variable is set to the compiler link flags that are required to link with the COIN library.  In the above example, it is the Cbc library.  Note the {{{`cat $(COINLIBDIR)/*_addlibs.txt`}}} entries --- when a COIN library might have additional library dependency (e.g., for the GNU package zlib), the corresponding compiler link flags are listed in the {{{*_addlibs.txt}}} file as a string.  These files are installed in the same location as the libraries.
    134134
    135 The generic compilation rules (e.g., {{{.c.o}}}) might look somewhat complicated.  But with this, the Makefile can also be used by people how work with the MS compilers (e.g., {{{cl}}}) under Cygwin, since those compilers don't understand the UNIX-type directory paths.  In such a case, the {{{CYGPATH_W}}} will have been set to {{{cygpath -w}}} by {{{configure}}}.
     135The generic compilation rules (e.g., {{{.c.o}}}) might look somewhat complicated.  But with this, the Makefile can also be used by people who work with the MS compilers (e.g., {{{cl}}}) under Cygwin, since those compilers don't understand the UNIX-type directory paths.  In such a case, the {{{CYGPATH_W}}} will have been set to {{{cygpath -w}}} by {{{configure}}}.