Changes between Version 5 and Version 6 of user-examples


Ignore:
Timestamp:
Jun 2, 2006 12:50:14 PM (14 years ago)
Author:
andreasw
Comment:

cleaned up

Legend:

Unmodified
Added
Removed
Modified
  • user-examples

    v5 v6  
    33Again, this information only pertains to UNIX-like systems, where you use {{{configure}}} and {{{make}}}.  If you want to use the MS Developer Studio, please check [http://projects.coin-or.org/MSDevStudio here] for more information.
    44
    5 Assume that you have dowloaded the package {{{Pkg}}}
     5Assume that you have dowloaded the COIN package {{{Pkg}}}
    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
     
    99in {{{Coin-Pkg/lib}}} and include files in {{{Coin-Pkg/include}}}.
    1010
    11 For most packages, the main directory contains an {{{examples}}}
     11For most COIN packages, the main directory contains an {{{examples}}}
    1212subdirectory. 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.
    14 If 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.
     14If you want to hook up your own code to this COIN library, it might be a good idea to start by looking at the example 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}}}
     
    4646}}}
    4747
    48 The modification is pretty straightforward:
     48The modifications are pretty straightforward:
    4949
    50  * {{{EXE}}} should be set to the name of the executable you want to compile with this Makefile.
     50 * '''EXE''' should be set to the '''name of the executable''' you want to compile with this Makefile.
    5151
    52  * {{{OBJS}}} should be set to the list of all object files that correspond to the source files you want to compile.
     52 * '''OBJS''' should be set to the list of '''all object files''' that correspond to the source files you want to compile.
    5353
    54  * {{{ADDLIBS}}} should list additonal compiler link flags to link with (non-COIN) libraries required to link your final program.
     54 * '''ADDLIBS''' should list '''additonal compiler link flags''' to link with (non-COIN) libraries required to link your final program.
    5555
    56  * {{{ADDINCFLAGS}}} should be set to compiler flags that tell it where to look for additional (non-COIN) header files required to compile your code - if required.
     56 * '''ADDINCFLAGS''' should be set to compiler flags that tell it where to look for '''additional (non-COIN) header files''' required to compile your code - if required.
    5757
    58  * {{{SRCDIR}}} and {{{VPATH}}} should be set to the directory where your source code is.  (This allows you to compile your code with the Makefile in a different directory from the source code directory.)
     58 * '''SRCDIR''' and '''VPATH''' should be set to the '''directory where your source code is'''.  (This allows you to compile your code with the Makefile in a different directory from the source code directory.)
    5959
    6060The lower part of the Makefiles looks somewhat like this:
     
    126126}}}
    127127
    128 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.
     128The '''compiler name''' variables '''CXX''', '''CC''' and '''F77''' will already be adapted to your system, as well as the corresponding variables '''CXXFLAGS''', '''CFLAGS''', '''FFLAGS''' 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 the same (or compatible) options.
    129129
    130 The {{{COININCDIR}}} and {{{COINLIBDIR}}} is adapted to the directory where the COIN libraries have been installed.
     130The '''COININCDIR''' and '''COINLIBDIR''' is adapted to the '''directories where the COIN header files and libraries have been installed'''.
    131131
    132 If 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.
     132If 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 shared libraries''' into the executables (if that is supported on your system).  Alternatively, you can set the {{{LD_LIBRARY_PATH}}} or similarly names environment variable to point to the directory with the COIN shared object.
    133133
    134 The {{{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.
     134The '''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.
    135135
    136 The 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}}}.
     136The '''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}}}, otherwise it is just "{{{echo}}}".