From f49ce03f8820246b06d79701827157f02edcbefb Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 14 Jun 2012 21:06:46 +0000 Subject: [PATCH] Added documentation on using pkg-config --- doc/sphinx/cxx-guide/compiling.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/sphinx/cxx-guide/compiling.rst b/doc/sphinx/cxx-guide/compiling.rst index 92cb853ae..2bdf473a6 100644 --- a/doc/sphinx/cxx-guide/compiling.rst +++ b/doc/sphinx/cxx-guide/compiling.rst @@ -8,6 +8,33 @@ specifying the appropriate header and library paths, and specifying the required libraries when linking. It is also necessary to specify the paths for libraries used by Cantera, e.g. Sundials, BLAS, and LAPACK. +pkg-config +========== + +On systems where the ``pkg-config`` program is installed, it can be used to +determine the correct compiler and linker flags for use with Cantera. For +example: + +.. code-block:: bash + + g++ myProgram.cpp -o myProgram $(pkg-config --cflags --libs cantera) + +It can also be used to populate variables in a Makefile: + +.. code-block:: make + + CFLAGS += $(shell pkg-config --cflags cantera) + LIBS += $(shell pkg-config --libs cantera) + +Or in an SConstruct file:: + + env.ParseConfig("pkg-config --cflags --libs cantera") + +Note that ``pkg-config`` will work only if it can find the ``cantera.pc`` +file. If Cantera's libraries are not installed in a standard location such as +``/usr/lib`` or ``/usr/local/lib``, you may need to set the ``PKG_CONFIG_PATH`` +environment variable appropriately before using ``pkg-config``. + SCons =====