Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NLopt #67

Merged
merged 64 commits into from
Apr 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b0e51b6
Initial bits for nlopt integration.
bluescarni Mar 31, 2017
0fb2b4a
Remove safe_cast in favor of boost::numeric_cast, since now we depend…
bluescarni Apr 1, 2017
14f8427
problem: various improvements in the sanity checking of sparsity and …
bluescarni Apr 1, 2017
6b85797
Restrict the sparsity patterns to be always sorted.
bluescarni Apr 2, 2017
b687dce
Some further WIP for the nlopt bits.
bluescarni Apr 2, 2017
ea6d7bb
Merge remote-tracking branch 'pagmo2/master' into nlopt
bluescarni Apr 2, 2017
453a13c
WIP.
bluescarni Apr 2, 2017
290cec3
More work.
bluescarni Apr 2, 2017
fd0cdf8
Small simplification.
bluescarni Apr 3, 2017
058afcf
Implement the gradient for the rosenbrock function.
bluescarni Apr 3, 2017
4d1af16
Add a few more NLopt algos.
bluescarni Apr 3, 2017
f13b98d
Merge remote-tracking branch 'pagmo2/master' into nlopt
bluescarni Apr 3, 2017
79d8240
More work on nlopt.
bluescarni Apr 3, 2017
cc3610f
First version that implements constraints handling.
bluescarni Apr 4, 2017
7f42824
Don't provide a setter for the population's problem.
bluescarni Apr 4, 2017
d1e944a
Doc update.
bluescarni Apr 4, 2017
331f182
More work on nlopt.
bluescarni Apr 4, 2017
7ce85a0
Don't provide a setter for the population's problem.
bluescarni Apr 4, 2017
f7e9a58
Doc update.
bluescarni Apr 4, 2017
15c5aa2
Small test addition.
bluescarni Apr 4, 2017
01063c4
Move all nlopt functionality in one file.
bluescarni Apr 4, 2017
f1cb651
Add missing NLopt algos and some cleanup work.
bluescarni Apr 4, 2017
900172a
Implement optimized gradient handling in the dense case.
bluescarni Apr 4, 2017
0660f45
Initial bits of support for the config file functionality.
bluescarni Apr 4, 2017
e908bde
Add global pagmo.hpp header.
bluescarni Apr 4, 2017
b836e71
First attempt at enabling nlopt in the CI.
bluescarni Apr 4, 2017
c5459e8
nlopt: some small improvements and CI debug.
bluescarni Apr 4, 2017
0ef7d66
More fixing.
bluescarni Apr 5, 2017
1f7860c
Another attempt at MSVC.
bluescarni Apr 5, 2017
f68a536
Some initial doc bits.
bluescarni Apr 5, 2017
83b967b
Merge remote-tracking branch 'pagmo2/master' into nlopt
bluescarni Apr 5, 2017
c7359ef
A few doc changes.
bluescarni Apr 5, 2017
a469d01
nlopt documentation.
bluescarni Apr 5, 2017
449e983
Small printing change.
bluescarni Apr 5, 2017
c2be478
First fully featured fully documented version of nlopt.
bluescarni Apr 5, 2017
1a7413c
Various small changes.
bluescarni Apr 5, 2017
fba4b3b
Tentative MSVC fix.
bluescarni Apr 6, 2017
fdfc917
Minor bits.
bluescarni Apr 6, 2017
faa4fc3
testing/doc bits.
bluescarni Apr 6, 2017
d77f65b
Merge branch 'iteration' into nlopt
bluescarni Apr 6, 2017
20e74b6
Restore appveyor builds.
bluescarni Apr 6, 2017
d220943
Testing bits and an important bugfix about not throwing exceptions fr…
bluescarni Apr 6, 2017
1995758
Small fix for the log.
bluescarni Apr 6, 2017
644c3b3
small doc add.
bluescarni Apr 7, 2017
7e4e116
nlopt: bits of work and a test fix.
bluescarni Apr 7, 2017
48d0e82
Small change.
bluescarni Apr 7, 2017
b2212f5
Merge branch 'nlopt' of github.com:bluescarni/pagmo2 into nlopt
bluescarni Apr 7, 2017
38d69f7
Merge remote-tracking branch 'pagmo2/master' into nlopt
bluescarni Apr 7, 2017
3d6ebd3
Various small improvements and fixes.
bluescarni Apr 7, 2017
e72f86b
Small udp exposition fixes.
bluescarni Apr 7, 2017
86989ee
Small piece of internal doc.
bluescarni Apr 7, 2017
85e1511
Fix mixing link to lv1 docs.
bluescarni Apr 7, 2017
b1e6f87
nlopt: fix handling of sparse gradients.
bluescarni Apr 7, 2017
a91dd5c
vl1: fixes.
bluescarni Apr 7, 2017
0e5537e
Another missing doc bit.
bluescarni Apr 8, 2017
11691be
More testing bits.
bluescarni Apr 8, 2017
4a3f2e8
nlopt: python exposition and docs.
bluescarni Apr 8, 2017
89aa3c3
Merge remote-tracking branch 'pagmo2/master' into nlopt
bluescarni Apr 8, 2017
cc608a6
Minor.
bluescarni Apr 8, 2017
922abde
Another small bit.
bluescarni Apr 8, 2017
268187b
lv1 doc fix in Python.
bluescarni Apr 8, 2017
b086332
nlopt: python testing.
bluescarni Apr 8, 2017
8be0382
Python 2.7 fix.
bluescarni Apr 8, 2017
9637411
Last minute fixes.
bluescarni Apr 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project(pagmo)
cmake_minimum_required(VERSION 3.2)

enable_testing()
project(pagmo VERSION 2.0)

cmake_minimum_required(VERSION 3.2)
enable_testing()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules" "${CMAKE_SOURCE_DIR}/cmake_modules/yacma")

Expand All @@ -27,6 +27,9 @@ option(PAGMO_BUILD_PYGMO "Build PyGMO." OFF)
# Build option: enable features depending on Eigen3.
option(PAGMO_WITH_EIGEN3 "Enable features depending on Eigen3 (such as CMAES). Requires Eigen3." OFF)

# Build option: enable NLopt.
option(PAGMO_WITH_NLOPT "Enable wrappers for the NLopt algorithms." OFF)

# Build option: install header.
option(PAGMO_INSTALL_HEADERS "Enable the installation of PaGMO's header files." ON)

Expand Down Expand Up @@ -66,6 +69,13 @@ if(PAGMO_WITH_EIGEN3)
message(STATUS "Eigen version detected: ${EIGEN3_VERSION}")
endif()

# NLopt setup
if(PAGMO_WITH_NLOPT)
find_package(NLOPT REQUIRED)
message(STATUS "NLopt include directory: ${NLOPT_INCLUDE_DIRS}")
message(STATUS "NLopt libraries: ${NLOPT_LIBRARIES}")
endif()

# Python setup.
# NOTE: we do it here because we need to detect the Python bits *before*
# looking for boost.python.
Expand All @@ -90,15 +100,29 @@ add_library(pagmo INTERFACE)
target_link_libraries(pagmo INTERFACE Threads::Threads Boost::boost)
target_include_directories(pagmo INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)

if(PAGMO_WITH_EIGEN3)
# Link pagmo to eigen3.
add_library(Eigen3::eigen3 INTERFACE IMPORTED)
set_target_properties(Eigen3::eigen3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
target_link_libraries(pagmo INTERFACE Eigen3::eigen3)
# FIXME: this needs to go into config.hpp, once implemented.
target_compile_definitions(pagmo INTERFACE PAGMO_WITH_EIGEN3)
set(PAGMO_ENABLE_EIGEN3 "#define PAGMO_WITH_EIGEN3")
endif()

if(PAGMO_WITH_NLOPT)
# Link pagmo to NLopt.
add_library(NLOPT::nlopt UNKNOWN IMPORTED)
set_target_properties(NLOPT::nlopt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${NLOPT_INCLUDE_DIRS}")
set_target_properties(NLOPT::nlopt PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${NLOPT_LIBRARIES}")
target_link_libraries(pagmo INTERFACE NLOPT::nlopt)
set(PAGMO_ENABLE_NLOPT "#define PAGMO_WITH_NLOPT")
endif()

# Configure config.hpp.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/include/pagmo/config.hpp")

if(PAGMO_BUILD_TESTS)
add_subdirectory("${CMAKE_SOURCE_DIR}/tests")
endif()
Expand All @@ -113,4 +137,5 @@ endif()

if(PAGMO_INSTALL_HEADERS)
install(DIRECTORY include/ DESTINATION include)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/pagmo/config.hpp" DESTINATION include/pagmo)
endif()
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ install:
- if [%BUILD_TYPE%]==[Python35] set PATH=C:\Miniconda35-x64\Scripts;%PATH%
- if [%BUILD_TYPE%]==[Python36] set PATH=C:\Miniconda36-x64\Scripts;%PATH%
- conda config --add channels conda-forge --force
- if [%BUILD_TYPE%]==[Debug] conda create -y --name pagmo python=3.6 cmake boost eigen
- if [%BUILD_TYPE%]==[Python35] conda create -y --name pagmo python=3.5 cmake boost eigen
- if [%BUILD_TYPE%]==[Python36] conda create -y --name pagmo python=3.6 cmake boost eigen
- if [%BUILD_TYPE%]==[Debug] conda create -y --name pagmo python=3.6 cmake boost eigen nlopt
- if [%BUILD_TYPE%]==[Python35] conda create -y --name pagmo python=3.5 cmake boost eigen nlopt
- if [%BUILD_TYPE%]==[Python36] conda create -y --name pagmo python=3.6 cmake boost eigen nlopt
- activate pagmo
- if [%BUILD_TYPE%]==[Python35] conda install -y numpy dill ipyparallel
- if [%BUILD_TYPE%]==[Python36] conda install -y numpy dill ipyparallel

build_script:
- mkdir build
- cd build
- if [%BUILD_TYPE%]==[Debug] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -DPAGMO_BUILD_TESTS=YES -DPAGMO_BUILD_TUTORIALS=YES -DPAGMO_WITH_EIGEN3=YES ..
- if [%BUILD_TYPE%]==[Debug] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -DPAGMO_BUILD_TESTS=YES -DPAGMO_BUILD_TUTORIALS=YES -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes ..
- if [%BUILD_TYPE%]==[Debug] cmake --build . --config Debug --target install
- if [%BUILD_TYPE%]==[Python35] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DPAGMO_WITH_EIGEN3=YES -DPAGMO_BUILD_PYGMO=yes ..
- if [%BUILD_TYPE%]==[Python35] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DPAGMO_BUILD_PYGMO=yes ..
- if [%BUILD_TYPE%]==[Python35] cmake --build . --config Release --target install
- if [%BUILD_TYPE%]==[Python36] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DPAGMO_WITH_EIGEN3=YES -DPAGMO_BUILD_PYGMO=yes ..
- if [%BUILD_TYPE%]==[Python36] cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DPAGMO_BUILD_PYGMO=yes ..
- if [%BUILD_TYPE%]==[Python36] cmake --build . --config Release --target install

test_script:
Expand Down
43 changes: 43 additions & 0 deletions cmake_modules/FindNLOPT.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2015-2016, Humanoid Lab, Georgia Tech Research Corporation
# Copyright (c) 2015-2017, Graphics Lab, Georgia Tech Research Corporation
# Copyright (c) 2016-2017, Personal Robotics Lab, Carnegie Mellon University
# This file is provided under the "BSD-style" License

# Find NLOPT
#
# This sets the following variables:
# NLOPT_FOUND
# NLOPT_INCLUDE_DIRS
# NLOPT_LIBRARIES
# NLOPT_DEFINITIONS
# NLOPT_VERSION

find_package(PkgConfig QUIET)

# Check to see if pkgconfig is installed.
pkg_check_modules(PC_NLOPT nlopt QUIET)

# Definitions
set(NLOPT_DEFINITIONS ${PC_NLOPT_CFLAGS_OTHER})

# Include directories
find_path(NLOPT_INCLUDE_DIRS
NAMES nlopt.h
HINTS ${PC_NLOPT_INCLUDEDIR}
PATHS "${CMAKE_INSTALL_PREFIX}/include")

# Libraries
find_library(NLOPT_LIBRARIES
NAMES nlopt nlopt_cxx
HINTS ${PC_NLOPT_LIBDIR})

# Version
set(NLOPT_VERSION ${PC_NLOPT_VERSION})

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NLOPT
FAIL_MESSAGE DEFAULT_MSG
REQUIRED_VARS NLOPT_INCLUDE_DIRS NLOPT_LIBRARIES
VERSION_VAR NLOPT_VERSION)

40 changes: 40 additions & 0 deletions config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Copyright 2017 PaGMO development team

This file is part of the PaGMO library.

The PaGMO library is free software; you can redistribute it and/or modify
it under the terms of either:

* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.

or

* the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any
later version.

or both in parallel, as here.

The PaGMO library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the PaGMO library. If not,
see https://www.gnu.org/licenses/. */

#ifndef PAGMO_CONFIG_HPP
#define PAGMO_CONFIG_HPP

// Start of defines instantiated by CMake.
// clang-format off
#define PAGMO_VERSION @pagmo_VERSION@
@PAGMO_ENABLE_EIGEN3@
@PAGMO_ENABLE_NLOPT@
// clang-format on
// End of defines instantiated by CMake.

#endif
4 changes: 3 additions & 1 deletion doc/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,9 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED = PAGMO_DOXYGEN_INVOKED
PREDEFINED = PAGMO_DOXYGEN_INVOKED \
PAGMO_WITH_EIGEN3 \
PAGMO_WITH_NLOPT

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
Binary file added doc/doxygen/images/nlopt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions doc/sphinx/docs/cpp/algorithms/nlopt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NLopt solvers
=============

.. doxygenclass:: pagmo::nlopt
:members:
3 changes: 2 additions & 1 deletion doc/sphinx/docs/cpp/cpp_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Implemented algorithms
algorithms/moead
algorithms/mbh
algorithms/cstrs_self_adaptive
algorithms/nlopt
algorithms/nsga2
algorithms/pso
algorithms/sade
Expand All @@ -54,13 +55,13 @@ Implemented problems
problems/dtlz
problems/hock_schittkowsky_71
problems/inventory
problems/luksan_vlcek1
problems/translate
problems/decompose
problems/cec2006
problems/cec2009
problems/cec2013
problems/unconstrain
problems/luksan_vlcek1

Implemented islands
^^^^^^^^^^^^^^^^^^^
Expand Down
7 changes: 6 additions & 1 deletion doc/sphinx/docs/python/algorithms/py_algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@ Algorithms exposed from C++
-------------------------------------------------------------

.. autoclass:: pygmo.core.cstrs_self_adaptive
:members:
:members:

-------------------------------------------------------------

.. autoclass:: pygmo.core.nlopt
:members:
5 changes: 5 additions & 0 deletions doc/sphinx/docs/python/problems/py_problems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Problems exposed from C++

-------------------------------------------------------------

.. autoclass:: pygmo.core.luksan_vlcek1
:members:

-------------------------------------------------------------

.. autoclass:: pygmo.core.translate
:members:

Expand Down
10 changes: 8 additions & 2 deletions doc/sphinx/docs/python/tutorials/coding_udp_simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ be revealed only when calling the malformed method:
...
AttributeError: 'numpy.float64' object has no attribute '__iter__'

In this case, the issue is that the ``fitness()`` method returns a scalar instead of an array-like object (remember that pygmo is also
able to solve multi-objective and constrained problems, thus the fitness value must be, in general, a vector). pygmo will complain
about the wrong return type the first time the ``fitness()`` method is invoked.

Notes on computational speed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -227,6 +231,8 @@ our fitness method into C code.
>>> start_time = time.time(); [prob_jit.fitness(dummy_x) for i in range(1000)]; print(time.time() - start_time) #doctest: +SKIP
0.03771...

With a bit more elbow grease, we can further improve performance:

.. doctest::

>>> from numba import jit, float64
Expand All @@ -250,9 +256,9 @@ our fitness method into C code.
0.01687...


much better right?
Much better, right?

.. note:: For more information on using Numba to speed up your python code see `Numba documentation pages <http://numba.pydata.org/>`_.
.. note:: For more information on using Numba to speed up your python code see the `Numba documentation pages <http://numba.pydata.org/>`_.
In particular, note that only a limited part of NumPy and the python language in general is supported by this use.


4 changes: 3 additions & 1 deletion doc/sphinx/docs/python/tutorials/using_problem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ Let us start:
Lower bounds: [-5, -5, -5, -5, -5]
Upper bounds: [10, 10, 10, 10, 10]
<BLANKLINE>
Has gradient: false
Has gradient: true
User implemented gradient sparsity: false
Expected gradients: 5
Has hessians: false
User implemented hessians sparsity: false
<BLANKLINE>
Function evaluations: 0
Gradient evaluations: 0
<BLANKLINE>
Thread safety: basic
<BLANKLINE>
Expand Down
25 changes: 14 additions & 11 deletions doc/sphinx/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ C++

Pagmo is a header-only library which has the following third party dependencies:

* `Boost <http://www.boost.org/>`_, headers only (needs the libraries only if you intend to compile the python bindings)
* `Eigen <http://eigen.tuxfamily.org/index.php?title=Main_Page>`_, headers only (optional)
* `Boost <http://www.boost.org/>`_, **mandatory**, header-only (needs the libraries only if you
intend to compile the python bindings)
* `Eigen <http://eigen.tuxfamily.org/index.php?title=Main_Page>`_, optional, header-only
* `NLopt <http://ab-initio.mit.edu/wiki/index.php/NLopt>`_, optional, requires linking


After making sure the dependencies above are installed in your system and their headers visible to your compiler, you can download
After making sure the dependencies above are installed in your system, you can download the
pagmo source via the ``git`` command

.. code-block:: bash
Expand All @@ -28,7 +30,7 @@ and configure your build using ``cmake``. When done, type (in your build directo

make install

The headers will be installed in the ``CMAKE_INSTALL_PREFIX/include directory``. To check that all went well
The headers will be installed in the ``CMAKE_INSTALL_PREFIX/include`` directory. To check that all went well
compile the :ref:`quick-start example <getting_started_c++>`.

-----------------------------------------------------------------------
Expand All @@ -38,8 +40,8 @@ Python
The python module correponding to pagmo is called pygmo
It can be installed either directly from ``conda`` or ``pip`` or by building the module from source.

Installing with pip
^^^^^^^^^^^^^^^^^^^
Installation with pip/conda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The python package pygmo (python binding of the C++ code) can be installed using ``pip`` or ``conda``:

.. code-block:: bash
Expand All @@ -53,13 +55,14 @@ or
conda config --add channels conda-forge
conda install pygmo

Building the module
^^^^^^^^^^^^^^^^^^^
Installation from source
^^^^^^^^^^^^^^^^^^^^^^^^

To build the module you need to have the boost python libraries installed and to activate the ``BUILD_PYGMO`` option from within ``cmake``.
To build the module from source you need to have the Boost.Python libraries installed and to activate the cmake
``PAGMO_BUILD_PYGMO`` option.

Check carefully what python version is detected and what libraries are linked to. In particular select the correct boost_python
according to the python version (2 or 3) you want to compile the module for.
Check carefully what python version is detected and what libraries are linked to. In particular, select the correct Boost.Python
version according to the python version (2 or 3) you want to compile the module for.

The ``CMAKE_INSTALL_PREFIX`` will be used to construct the final location of headers and Python module after install.

Expand Down
15 changes: 12 additions & 3 deletions doc/sphinx/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ After following the :ref:`install` you will be able to compile and run your firs
:language: c++
:linenos:

Place it into a getting_started.cpp text file and compile it (for example) with:
Place it into a ``getting_started.cpp`` text file and compile it (for example) with:

.. code-block:: bash

g++ -std=c++11 getting_started.cpp -pthread
g++ -O2 -DNDEBUG -std=c++11 getting_started.cpp -pthread

If you installed pagmo with support for optional 3rd party libraries, you might need to
add additional switches to the command-line invocation of the compiler. For instance,
if you enabled the optional NLopt support, you will have to link your executable to the
``nlopt`` library:

.. code-block:: bash

g++ -O2 -DNDEBUG -std=c++11 getting_started.cpp -pthread -lnlopt

-----------------------------------------------------------------------

Expand All @@ -36,7 +45,7 @@ If you have successfully installed pygmo following the :ref:`install` you can tr
:language: python
:linenos:

Place it into a getting_started.py text file and run it with:
Place it into a ``getting_started.py`` text file and run it with:

.. code-block:: bash

Expand Down
Loading