Using Pulse on Visual Studio Code

Hi! I’m studying Pulse to implementate on a project and i have two issues:
1 - How to build using cmake and MSVC with Python 3.10 on Windows 11? Has another way to get the Python API easily?
2 - After build, how to use Pulse python API in Visual Studio Code?
Thanks!

So when you run CMake on Pulse with the Pulse_PYTHON_API option selected,


CMake is going to look for python on your system
I have C:\Programming\Tools\python\3.10 on my path, so it finds 3.10

Currently, to get python, you need to build pulse with python support

To get it to work in visual code, you really just need to add the same paths to your PYTHONPATH that we describe here

https://gitlab.kitware.com/physiology/engine/-/wikis/Using%20Pycharm

Cmake recognize my Python path, but in Visual Studio the build fails with the following output errors:
5>-- Found Java: C:/Program Files/OpenJDK/openjdk-11.0.14.1_1/bin/java.exe (found version “11.0.14”)
5>-- Found JNI: C:/Program Files/Microsoft/jdk-11.0.16.101-hotspot/include found components: AWT JVM
5>-- Configuring PulseJNI
5>CMake Error at src/python/CMakeLists.txt:4 (find_package):
5> Could not find a package configuration file provided by “pybind11” with any
5> of the following names:
5>
5> pybind11Config.cmake
5> pybind11-config.cmake
5>
5> Add the installation prefix of “pybind11” to CMAKE_PREFIX_PATH or set
5> “pybind11_DIR” to a directory containing one of the above files. If
5> “pybind11” provides a separate development package or SDK, be sure it has
5> been installed.
5>
5>
5>-- Configuring incomplete, errors occurred!
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: o build personalizado para ‘C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-mkdir.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-download.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-update.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-patch.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-configure.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-build.rule;C:\Programming\builds\pulse-engine\CMakeFiles\92e9b26d947d4accea34275b7de47ff0\Pulse-install.rule;C:\Programming\builds\pulse-engine\CMakeFiles\83c4c64f3fa9bc0cedfed22db873c451\Pulse-complete.rule;C:\Programming\builds\pulse-engine\CMakeFiles\beea2071a4f256d18aa725bea4521f50\Pulse.rule;C:\Programming\Pulse\engine\cmake\external\CMakeLists.txt’ foi encerrado com o código 1.
5>Projeto de compilação pronto “Pulse.vcxproj” – FALHA.
6>------ Compilação iniciada: Projeto: PulseData, Configuração: Release x64 ------
6>Building Custom Rule C:/Programming/Pulse/engine/cmake/external/CMakeLists.txt
6>EXEC : CMake error : Error processing file: run.cmake
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: O comando “setlocal
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: cd C:\Programming\builds\pulse-engine\install\bin
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: C:
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: “C:\Program Files\CMake\bin\cmake.exe” -DTYPE:STRING=genData -P run.cmake
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmErrorLevel
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: exit /b %1
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmDone
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: setlocal
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: cd C:\Programming\builds\pulse-engine\install\bin
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: C:
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: “C:\Program Files\CMake\bin\cmake.exe” -DTYPE:STRING=genStates -P run.cmake
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmErrorLevel
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: exit /b %1
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmDone
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :VCEnd” foi encerrado com o código 1.

Do you have something like this in your pulse build directory

The build should have pulled and built pybind11

No. The folder “install” doesnt exist.

If you open the Pulse.sln at the root of your build directory
You should see a pybind11 project
Can you build it and see if it reports any errors

The following errors are returned when i build the pybind11:

Hmmm
Can you post/send your C:\Programming\Builds\pulse-engine\External\pybind11\build\CMakeCache.txt