Skip to content

Commit

Permalink
Update instructions for python bindings on windows with conda
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Mar 13, 2024
1 parent b9d021d commit 6be65b4
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions doc/tutorial/python/tutorial-install-python-bindings.dox
Original file line number Diff line number Diff line change
Expand Up @@ -397,39 +397,26 @@ We strongly recommend using Conda to build ViSP Python bindings. Below are instr
(base) $ conda activate visp-conda-ws
(visp-conda-ws) $

- Install pybind11 using conda (this will install Python as it is a dependency of pybind11):

(visp-conda-ws) $ conda install pybind11

Proceed ([y]/n)? y

You can also specify the Python version if desired:

(visp-conda-ws) $ conda install pybind11 python=3.10

- At this stage, you can also install the other ViSP dependencies using conda, depending on the features you wish to compile.
- Install `pybind11` and all the other ViSP dependencies you wish to enable using conda.

- **A. On macOS**:

You will need to install at least the X11 libraries:

(visp-conda-ws) $ conda install xorg-libx11

However, we recommend this minimal set of dependencies to get the main features of ViSP available:

(visp-conda-ws) $ conda install xorg-libx11 eigen libopencv libjpeg-turbo libpng
(visp-conda-ws) $ conda install cmake xorg-libx11 xorg-libxfixes libxml2 libdc1394 >=2.2.6 librealsense libopencv eigen libjpeg-turbo libpng libopenblas llvm-openmp pybind11

- **B. On Ubuntu or other linux-like**:

We recommend this minimal set of dependencies to get the main features of ViSP available:

(visp-conda-ws) $ conda install eigen libopencv libjpeg-turbo libpng
(visp-conda-ws) $ conda install cmake xorg-libx11 xorg-libxfixes libxml2 libdc1394 >=2.2.6 librealsense libgomp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11

- **C. On Windows**:

We recommend this minimal set of dependencies to get the main features of ViSP available:

(visp-conda-ws) C:\Users\User> conda install eigen libopencv libjpeg-turbo libpng
(visp-conda-ws) C:\Users\User> conda install cmake llvm-openmp openmp libopencv eigen libjpeg-turbo libpng mkl-devel pybind11

\note In the previous installation commands you can also specify the Python version if desired adding
for example `python=3.10` to the previous command lines.

- Create a ViSP workspace to host source code and the build material

Expand Down Expand Up @@ -481,20 +468,7 @@ We strongly recommend using Conda to build ViSP Python bindings. Below are instr

(visp-conda-ws) C:\visp-ws> mkdir visp-build-bindings
(visp-conda-ws) C:\visp-ws> cd visp-build-bindings
(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake -G "Visual Studio 17 2022" -A "x64" ../visp -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% -DBUILD_PYTHON_BINDINGS=OFF -DVISP_LIB_INSTALL_PATH=lib -DVISP_BIN_INSTALL_PATH=bin -DVISP_CONFIG_INSTALL_PATH=cmake
(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake --build . --config Release --target install --parallel 8

At this point, ViSP DLL should be installed in `%CONDA_PREFIX%/bin`. This can be checked by:

(visp-conda-ws) C:\visp-ws\visp-build-bindings> dir %CONDA_PREFIX%\bin
... libvisp_ar361.dll
... libvisp_blob361.dll
... libvisp_core361.dll
...

Then configure ViSP again to enable Python bindings:

(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake -G "Visual Studio 17 2022" -A "x64" ../visp -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX% -DBUILD_PYTHON_BINDINGS=ON
(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake -G "Visual Studio 17 2022" -A "x64" ../visp -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library -DVISP_LIB_INSTALL_PATH="lib" -DVISP_BIN_INSTALL_PATH="bin" -DVISP_CONFIG_INSTALL_PATH="cmake"

- At this point, in the build folder there is the `ViSP-third-party.txt` file in which you should see something similar

Expand Down Expand Up @@ -534,6 +508,18 @@ We strongly recommend using Conda to build ViSP Python bindings. Below are instr

- **C. On Windows**:

(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake --build . --config Release --target install --parallel 8

At this point, ViSP DLL should be installed in `%CONDA_PREFIX%/Library/bin`. This can be checked by:

(visp-conda-ws) C:\visp-ws\visp-build-bindings> dir %CONDA_PREFIX%\Library\bin
... libvisp_ar361.dll
... libvisp_blob361.dll
... libvisp_core361.dll
...

Now you cab build the bindings

(visp-conda-ws) C:\visp-ws\visp-build-bindings> cmake --build . --config Release --target visp_python_bindings --parallel 8

- Test the Python bindings
Expand Down

0 comments on commit 6be65b4

Please sign in to comment.