diff --git a/docs/docs/compile.xml b/docs/docs/compile.xml index a5c2ecd82..2ff3b1cd5 100644 --- a/docs/docs/compile.xml +++ b/docs/docs/compile.xml @@ -2,17 +2,44 @@ - How to compile - - - - - -

Compiling C++ Example Programs on Any Operating System Using CMake

+ +

Using dlib from Python

+

+ Go to the base folder of the dlib repository and run python setup.py install. + Once that command finishes running + you are ready to use dlib from Python. Note that you need to + have CMake and a working C++ compiler installed for this to + work.

+ +

Also note that various optional features like GUI support (e.g. + dlib.image_window) and CUDA acceleration will be either enabled or + disabled based on what is available on your computer. When you run + the install command it will print messages telling you what it is + using. Read those messages and take appropriate action if you + don't like the results. For example, Linux and OSX users may have + to install libX11 to use the GUI tools. If you care about this + then read the messages since they tell you how to get these + optional features installed. +

+

+ Alternatively, if you want to add more python bindings to dlib's + python interface then you probably want to avoid the setup.py file + and work directly using CMake. In particular, dlib's python API is + built by the CMake project in the tools/python folder. You build + this project using the usual CMake commands and when compiled it + outputs the dlib shared library that defines the python API for dlib. +

+ + +
+
+
+

Using dlib from C++

+ The best way to compile a program that uses dlib is to use CMake. For example, the following commands will compile the example programs on any operating system: @@ -45,31 +72,6 @@ tell CMake which one you want it to use via the -G option.

-
-

Compiling Dlib's Python Interface

-

- Go to the base folder of the dlib repository and run python setup.py install. That - should compile and install the dlib python API on your system. Note that you need to have CMake - and a working C++ compiler installed for this to work.

- -

Also note that various optional features like GUI support (e.g. - dlib.image_window) and CUDA acceleration will be either enabled or - disabled based on what is available on your computer. When you run - the install process it will print messages telling you what it is - using. Read those messages and take appropriate action if you - don't like the results. For example, Linux and OSX users may have - to install libX11 to use the GUI tools. If you care about this - then read the messages since they tell you how to get these - optional features installed. -

-

- Alternatively, if you want to add more python bindings to dlib's - python interface then you probably want to avoid the setup.py file - and work directly using CMake. In particular, dlib's python API is - built by the CMake project in the tools/python folder. You build - this project using the usual CMake commands and when compiled it - outputs the dlib shared library that defines the python API for dlib. -


@@ -151,12 +153,13 @@ sudo apt-get install libx11-dev

Dlib's cmake scripts contain the standard install target. So you can use CMake to install dlib system wide as a precompiled static or - shared library just like you would with any other C++ library. - However, most users should use CMake as described at the top of this page since that's - the simplest method. In particular, it allows you to turn dlib's - debugging modes on and off whenever you want, which is something you - really should use since dlib's debugging modes are one of its - strongest features. + shared library just like you would any other C++ library. + However, most users should use CMake as described at the top of this + page (specifically as shown in the examples project) since + that's the simplest method. In particular, it allows you to turn + dlib's debugging modes on and off whenever you want, which is + something you really should use since dlib's debugging modes are one + of its strongest features.