Compiling OpenEB on Windows from sources
This section describes how to compile OpenEB on Windows.
Compilation and execution were tested on platforms that meet the following requirements:
Windows: version 10 64-bit
Architecture: amd64 (a.k.a. x64)
Graphic card with support of OpenGL 3.0 minimum
Compilation on other versions of Windows was not tested. For those, some adjustments to this guide or to the code itself may be required.
Note
OpenEB is the open source version of our code base for the modules Base, Core, Core ML, Stream, UI, and HAL (see Metavision modules organization). If you own the full source code of the SDK (see our SDK offers), OpenEB will also be the basis of your installation, but you should follow the installation guide of SDK from sources.
If you don’t want to go through some compilation steps, you can download pre-built Windows installer of Metavision modules. To do so, follow our specific installation guide.
Warning
Some steps of this procedure don’t work on FAT32 and exFAT file system. Make sure that you are using a NTFS file system before going further.
Table of Contents
Supported Cameras
OpenEB contains the source code of the Prophesee camera plugin, enabling to stream data from our event-based cameras and to read recordings of event-based data. The supported cameras are:
If you want to use a Prophesee EVK that is not in the list above, it might have been discontinued. Refer to the Prophesee EVKs Support section to find out which previous version of OpenEB is supporting it.
If you own a third-party vendor event-based camera, refer to the Camera Plugin Installation page to see how it can be deployed and configured.
Downloading the Source Code
Retrieve the source code of OpenEB
git clone https://github.com/prophesee-ai/openeb.git --branch 5.0.0
Warning
If you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
you need to ensure that you select a Full.Source.Code.*
archive instead of using
the automatically generated Source.Code.*
archives. This is because the latter do not include
a necessary submodule.
Absolute path to the openeb
directory in this extracted archive is called OPENEB_SRC_DIR
in next sections.
Upgrading OpenEB
If you are upgrading OpenEB from a previous version, you should first read carefully the Release Notes as some changes may impact your usage of our SDK (e.g. API updates) and cameras (e.g. firmware update might be necessary).
Then, if you have previously installed any Prophesee software, you will need to uninstall it first.
Remove the folders where you installed Metavision artifacts (check both the build
folder of the source code and
C:\Program Files\Prophesee
which is the default install path of the deployment step).
Prerequisites
System Settings
You must enable the support for long paths:
Hit the Windows key, type gpedit.msc and press Enter
Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem
Double-click the “Enable Win32 long paths” option, select the “Enabled” option and click “OK”
Development tools
To compile OpenEB, you will need to install some extra tools:
install git
install CMake 3.26 (more recent versions might not be compatible)
install Microsoft Visual C++ compiler (MSVC, 64-bit version) included in Visual Studio 2022 - Fall 2023 LTSC (version 17.8). If you install the Build Tools only, make sure Windows 10 SDK is checked, and add English Language Pack.
Installing Dependencies
Install some dependencies with vcpkg:
download and extract vcpkg version 2024.04.26 as a folder referred to as
VCPKG_SRC_DIR
in the following sections.In a command prompt, navigate to VCPKG_SRC_DIR` and launch the following commands:
bootstrap-vcpkg.bat vcpkg updateCopy the
vcpkg-openeb.json
file located in the OpenEB source code atutils/windows
into``VCPKG_SRC_DIR`` and rename it tovcpkg.json
:copy OPENEB_SRC_DIR\utils\windows\vcpkg-openeb.json VCPKG_SRC_DIR\vcpkg.json
Finally, launch the following command that will install the dependencies:
vcpkg install --triplet x64-windows --x-install-root installed
Note
If you’re using vcpkg across multiple projects or versions of OpenEB, it’s beneficial to streamline the number of vcpkg installations you manage. To achieve this, you’ll need the specific versions of the libraries required. You can find these versions by cross-referencing our
vcpkg.json
file with the official vcpkg repository, but for your convenience, we’ve listed them below:
libusb: 1.0.27
boost: 1.78.0
opencv: 4.8.0
dirent: 1.24.0
gtest: 1.14.0
pybind11: 2.12.0
glew: 2.2.0
glfw3: 3.4.0
hdf5: 1.14.2
protobuf: 3.21.12
You should also install FFMPEG library that is required to write videos:
Add the
bin
directory of the FFMPEG install to yourPATH
Installing Python and libraries
To execute our Python Samples and use the Python API, you will need Python and some additional libraries.
Install Python if not yet available on your machine:
Download the installer for one of the supported Python versions:
Python 3.9 (“Windows installer (64-bit)”)
Python 3.10 (“Windows installer (64-bit)”)
Python 3.11 (“Windows installer (64-bit)”)
Python 3.12 (“Windows installer (64-bit)”)
Run the installer and follow the prompt
Add Python install and script directories in your
PATH
and make sure they are listed before theWindowsApps
folder which contains a Python alias launching the Microsoft Store. So, if you installed Python 3.9 in the default path, your userPATH
should contain those three lines in that order:%USERPROFILE%\AppData\Local\Programs\Python\Python39 %USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
We recommend using Python with virtualenv to avoid conflicts with other installed Python packages.
Create a virtual environment:
python -m venv C:\tmp\prophesee\py3venv --system-site-packages
When creating the virtual environment, it is necessary to use the --system-site-packages
option to ensure that
the OpenEB Python packages installed in the system directories are accessible. However, this option also makes your local
user site-packages visible by default. To prevent this and maintain a cleaner virtual environment,
you should set the environment variable PYTHONNOUSERSITE
to true (which you may add to your system configuration to make it permanent):
set PYTHONNOUSERSITE=true
Finally, install the necessary dependencies:
C:\tmp\prophesee\py3venv\Scripts\python -m pip install pip --upgrade
C:\tmp\prophesee\py3venv\Scripts\python -m pip install -r OPENEB_SRC_DIR\utils\python\requirements_openeb.txt
Optionally, you can run the activate
command (C:\tmp\prophesee\py3venv\Scripts\activate
) to modify your shell’s environment variables,
setting the virtual environment’s Python interpreter and scripts as the default for your current session.
This allows you to use simple commands like python
without needing to specify the full path each time.
For simplicity, throughout the documentation of the Code Samples, we will assume
the python
command refers to the interpreter within the activated virtual environment.
Note
You can also use anaconda to install Python and
conda to manage your Python packages, but be sure to use a Python version that we support.
You will need to adapt the library installation steps accordingly and use conda
whenever we use pip
.
In addition, check that conda PYTHONPATH
contains the aforementioned PATH
. For example for Python 3.9:
%USERPROFILE%\AppData\Local\Programs\Python\Python39
%USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
If not, add them. For example with sys.path.append()
method of python module sys
:
import sys
print(sys.path)
# Add %USERPROFILE%\AppData\Local\Programs\Python\Python39 to PYTHONPATH if the output of print(sys.path) does not mention it.
sys.path.append("%USERPROFILE%\AppData\Local\Programs\Python\Python39")
In this documentation, we chose to use pip as a package manager.
Prerequisites for the ML module
If you have some Nvidia hardware with GPUs, you can optionally install CUDA (11.8) and cuDNN to leverage them with PyTorch and LibTorch. Make sure that you install a version of CUDA that is compatible with your GPUs by checking Nvidia compatibility page.
Note
At the moment, we don’t support OpenCL and AMD GPUs.
Compilation
By now, you should have downloaded the source code from the “Downloading the Source Code” section. Let’s proceed with the compilation steps.
Compilation using CMake
Open a command prompt inside the OPENEB_SRC_DIR
folder and follow those steps:
Create and open the build directory where temporary files will be created:
mkdir build && cd build
Generate the solution using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):
cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF
Compile:
cmake --build . --config Release --parallel 4
Once the compilation is done, you have two options: you can choose to work directly from the build
folder
or you can deploy the OpenEB files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use OpenEB directly from the
build
folder, you need to update some environment variables using this script:utils\scripts\setup_env.bat
Option 2 - deploying in a directory of your choice
To deploy OpenEB in the default folder (
C:\Program Files\Prophesee
), execute this command (your console should be launched as an administrator):cmake --build . --config Release --target install
To deploy OpenEB in another folder, you should generate the solution again (step 2 above) with the additional variable
CMAKE_INSTALL_PREFIX
having the value of your target folder (OPENEB_INSTALL_DIR
).Similarly, to specify where the Python packages will be deployed (
PYTHON3_PACKAGES_INSTALL_DIR
), you should use thePYTHON3_SITE_PACKAGES
variable.Here is an example of a command customizing those two folders:
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF
After this command, you should launch the actual compilation and installation of OpenEB (your console should be launched as an administrator):
cmake --build . --config Release --parallel 4 cmake --build . --config Release --target installYou also need to manually edit some environment variables:
append
<OPENEB_INSTALL_DIR>\bin
toPATH
(C:\Program Files\Prophesee\bin
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\metavision\hal\plugins
toMV_HAL_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\metavision\hal\plugins
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\hdf5\plugin
toHDF5_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\hdf5\plugin
if you used default configuration)append
<PYTHON3_PACKAGES_INSTALL_DIR>
toPYTHONPATH
(not needed if you used default configuration)
Compilation using MS Visual Studio
Open a command prompt inside the openeb
folder and follow the steps:
(absolute path to this directory is called OPENEB_SRC_DIR
in next sections).
Create and open the build directory where temporary file will be created:
mkdir build && cd build
Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF
Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.
Once the compilation is done, you have two options: you can choose to work directly from the build
folder
or you can deploy the OpenEB files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use OpenEB directly from the
build
folder, you need to update the environment variables as done in this script:utils\scripts\setup_env.bat
Option 2 - deploying OpenEB
To deploy OpenEB, you need to build the
INSTALL
project. By default, files will be deployed inC:\Program Files\Prophesee
You also need to manually edit some environment variables:
append
<OPENEB_INSTALL_DIR>\bin
toPATH
(C:\Program Files\Prophesee\bin
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\metavision\hal\plugins
toMV_HAL_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\metavision\hal\plugins
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\hdf5\plugin
toHDF5_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\hdf5\plugin
if you used default configuration)append
<PYTHON3_PACKAGES_INSTALL_DIR>
toPYTHONPATH
(not needed if you used default configuration)
Camera Plugins
Prophesee camera plugin is included in OpenEB, but you need to install the drivers for the cameras to be available on Windows. To do so, follow this procedure:
download wdi-simple.exe from our file server
execute the following commands in a Command Prompt launched as an administrator:
wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f4 wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f5 wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f3
Note
In some cases, the installation of the drivers fails with a message similar to
libwdi:warning [wdi_prepare_driver] could not sign cat file
.
This is generally a consequence of the security policies applied by your IT department.
If you are in that situation, check our FAQ entry covering that topic.
Note
If your EVK is listed in the Device Manager, but the Properties tab shows a message similar to
No drivers are installed for this device
,
check the FAQ entry about this driver issue.
If you own an EVK2 or an RDK2, there are a few additional steps to complete.
First, check in your device manager that you have the three following interfaces when your camera is connected: CDC NCM
; EVK2
; fastboot
, displayed as below with a warning sign
(from left to right, picture 1
). If not, uninstall the device already installed as shown in picture 2
and 3
(generally the already installed device is, either EVK2 if you connect an EVK2 device or fastboot if you connect an RDK2 device).
Kindly note that you should repeat this uninstall operation until your device (EVK2/fastboot) is not recognized anymore and appears in other devices
with a warning sign
.
Now, you should install the relevant driver for each of the three interfaces (EVKv2, CDC-NCM and FastbootInterface).
To do so, follow those steps for each interface:
find out the name of interface by checking the Device Manager as shown in the picture below:
For example, we can see on the right picture that the interface number is
03
.install the relevant driver with the following command launched as an administrator:
wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x03fd -p 0x5832 -i <INTERFACE_NUMBER>
If you are using a third-party camera, you need to follow the instructions provided by the camera vendor
to install the driver and the camera plugin. Make sure that you reference the location of the plugin in
the MV_HAL_PLUGIN_PATH
environment variable.
Running tests
Running the test suite is a sure-fire way to ensure you did everything well with your compilation and installation process.
Go to this page and click on the
Download All
button to retrieve an archive of all the files necessary to run the tests. Please be aware that the archive you’ll receive is approximately 1.5 Gb in size.Extract and put the contents of this archive into
<OPENEB_SRC_DIR>/datasets
. For instance, the correct path of sequence gen31_timer.raw should be <OPENEB_SRC_DIR>/datasets/openeb/gen31_timer.raw.To run the test suite you need to reconfigure your build environment using CMake and to recompile.
Compilation using only CMake
Regenerate the build using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):
cd <OPENEB_SRC_DIR>/build cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
Compile:
cmake --build . --config Release --parallel 4
Compilation using CMake and MS Visual Studio
Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.
Running the test suite (after making sure you launched the script
utils\scripts\setup_env.bat
mentioned before):ctest -C Release
Get started!
You are now ready to use OpenEB. The best way to start getting familiar with the event-based technology is to open an event-based camera with Metavision Viewer to begin data collection and visualization. You can choose to dive directly in the SDK by following a getting started guide or looking at a Code Sample.