Error when space in path to python.exe
I tried using aGrUM 1.7.1.9 (c8c6300e) on Windows 10 but ran into an issue with the path to my python executable C:\Program Files\Python310\python.exe
. I added the console output below.
I was able to fix the problem by either using a python venv without a space in the path or editing acttools/builder.py#L78
from line += " -DPython_EXECUTABLE="+ current["python3target"]
to line += " -DPython_EXECUTABLE=" + '"' + current["python3target"] + '"'
Console Output
Dev Prompt VS2022
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.5.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
C:\projects\aGrUM>where python
C:\Program Files\Python310\python.exe
C:\projects\aGrUM>python --version
Python 3.10.9
C:\projects\aGrUM>where cmake
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
C:\projects\aGrUM>cmake --version
cmake version 3.25.1-msvc1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
C:\projects\aGrUM>where msbuild
C:\Program Files\Microsoft Visual Studio\2022\Professional\Msbuild\Current\Bin\amd64\MSBuild.exe
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
C:\projects\aGrUM>msbuild --version
MSBuild version 17.5.1+f6fdcf537 for .NET Framework
17.5.1.16304
C:\projects\aGrUM>python act --dry-run
aGrUM compilation tool 2.4 for aGrUM/pyAgrum 1.7.1.9
(c) 2010-21 aGrUM Team
-- ** act Notification : Options static and no-fun forced by option mvsc*
==> ** act Notification : cd build
==> ** act Notification : cd aGrUM
==> ** act Notification : cd release
==> ** act Notification : cmake.exe ../../.. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RELEASE -DUSE_NANODBC=OFF -DCMAKE_INSTALL_PREFIX="/usr/local" -DCMAKE_VERBOSE_MAKEFILE=OFF -DBUILD_SHARED_LIBS=OFF -DGUM_COVERAGE=OFF -DBUILD_ALL=OFF -DBUILD_BN=ON -DBUILD_BNLEARNING=ON -DBUILD_BASE=ON -DBUILD_ID=ON -DGUM_RANDOMSEED=0 -DBUILD_PYTHON=OFF -DPython_EXECUTABLE=C:\Program Files\Python310\python.exe -G "Visual Studio 16 2019" -A x64 -DCMAKE_GUM_THREADS=omp -DUSE_PROFILE=OFF
-- ** act Notification : Compilation using 7 jobs.
==> ** act Notification : msbuild INSTALL.vcxproj /p:Configuration="Release" /p:BuildInParallel=true /maxcpucount:7
==> ** act Notification : cd ..
==> ** act Notification : cd ..
==> ** act Notification : cd ..
C:\projects\aGrUM>python act
aGrUM compilation tool 2.4 for aGrUM/pyAgrum 1.7.1.9
(c) 2010-21 aGrUM Team
-- ** act Notification : Options static and no-fun forced by option mvsc*
CMake Warning:
Ignoring extra path from command line:
"Files\Python310\python.exe"
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30148.0
^C
Shutdown requested...exiting
Dev Prompt VS2019
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.25
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
C:\projects\aGrUM>where python
C:\Program Files\Python310\python.exe
C:\projects\aGrUM>python --version
Python 3.10.9
C:\projects\aGrUM>where cmake
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
C:\projects\aGrUM>cmake --version
cmake version 3.20.21032501-MSVC_2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
C:\projects\aGrUM>where msbuild
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
C:\projects\aGrUM>msbuild --version
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
16.11.2.50704
C:\projects\aGrUM>python act --dry-run
aGrUM compilation tool 2.4 for aGrUM/pyAgrum 1.7.1.9
(c) 2010-21 aGrUM Team
-- ** act Notification : Options static and no-fun forced by option mvsc*
==> ** act Notification : cd build
==> ** act Notification : cd aGrUM
==> ** act Notification : cd release
==> ** act Notification : cmake.exe ../../.. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RELEASE -DUSE_NANODBC=OFF -DCMAKE_INSTALL_PREFIX="/usr/local" -DCMAKE_VERBOSE_MAKEFILE=OFF -DBUILD_SHARED_LIBS=OFF -DGUM_COVERAGE=OFF -DBUILD_ALL=OFF -DBUILD_ID=ON -DBUILD_BNLEARNING=ON -DBUILD_BASE=ON -DBUILD_BN=ON -DGUM_RANDOMSEED=0 -DBUILD_PYTHON=OFF -DPython_EXECUTABLE=C:\Program Files\Python310\python.exe -G "Visual Studio 16 2019" -A x64 -DCMAKE_GUM_THREADS=omp -DUSE_PROFILE=OFF
-- ** act Notification : Compilation using 7 jobs.
==> ** act Notification : msbuild INSTALL.vcxproj /p:Configuration="Release" /p:BuildInParallel=true /maxcpucount:7
==> ** act Notification : cd ..
==> ** act Notification : cd ..
==> ** act Notification : cd ..
-- ** act Notification : Time spent in cmake : 0.000s , make : 0.001s and post : 0.000s
C:\projects\aGrUM>python act
aGrUM compilation tool 2.4 for aGrUM/pyAgrum 1.7.1.9
(c) 2010-21 aGrUM Team
-- ** act Notification : Options static and no-fun forced by option mvsc*
CMake Error: The source directory "C:/projects/aGrUM/build/aGrUM/release/Files/Python310/python.exe" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
-- ** act Error : Received error 1
-- Stopped.