manpagez: man pages & more
info ginac
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

B. Package tools

If you are creating a software package that uses the GiNaC library, setting the correct command line options for the compiler and linker can be difficult. The pkg-config utility makes this process easier. GiNaC supplies all necessary data in ‘ginac.pc’ (installed into /usr/local/lib/pkgconfig by default). To compile a simple program use (6)

 
g++ -o simple `pkg-config --cflags --libs ginac` simple.cpp

This command line might expand to (for example):

 
g++ -o simple -lginac -lcln simple.cpp

Not only is the form using pkg-config easier to type, it will work on any system, no matter how GiNaC was configured.

For packages configured using GNU automake, pkg-config also provides the PKG_CHECK_MODULES macro to automate the process of checking for libraries

 
PKG_CHECK_MODULES(MYAPP, ginac >= MINIMUM_VERSION, 
                  [ACTION-IF-FOUND],
                  [ACTION-IF-NOT-FOUND])

This macro:


© manpagez.com 2000-2024
Individual documents may contain additional copyright information.