conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
946 stars 1.72k forks source link

[package] boost/1.7x.0: numpy detection fails with paths that contain spaces #4968

Open pcbennion opened 3 years ago

pcbennion commented 3 years ago

The current boost recipe fails to detect numpy when python is installed to a path that contains spaces.

The recipe seems to pass in a python executable path that the boost build script cannot use, resulting in the following logs:

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified version: "3.7"
notice: [python-cfg]   user-specified cmd-or-prefix: "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe"
notice: [python-cfg]   user-specified includes: "c:/program files (x86)/microsoft visual studio/shared/python37_64/Include"
notice: [python-cfg]   user-specified libraries: "c:/program files (x86)/microsoft visual studio/shared/python37_64/libs/python37.lib"
notice: [python-cfg] Checking interpreter command "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" 2>&1'
...
notice: [python-cfg] ...does not invoke a working interpreter
notice: [python-cfg] No working Python interpreter found.
...
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
'c:/program' is not recognized as an internal or external command,
operable program or batch file.

Package and Environment Details

Conan profile

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.libcxx=libstdc++
compiler.version=9
compiler.runtime=MD
compiler.cppstd=17
os=Windows
os_build=Windows

boost:compiler=Visual Studio
boost:compiler.runtime=MD
boost:compiler.version = 16
[options]
[build_requires]
[env]
CONAN_CMAKE_GENERATOR=Ninja
CONAN_DISABLE_CHECK_COMPILER=TRUE
CC=clang-cl.exe
CXX=clang-cl.exe
boost:CC=cl.exe
boost:CXX=cl.exe
CFLAGS= -fms-compatibility-version=1800
CXXFLAGS= -fms-compatibility-version=1800

Steps to reproduce

Logs

Click to expand log ``` notice: [zlib] Using pre-installed library notice: [zlib] Condition notice: [bzip2] Using pre-installed library notice: [bzip2] Condition notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "3.7" notice: [python-cfg] user-specified cmd-or-prefix: "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe" notice: [python-cfg] user-specified includes: "c:/program files (x86)/microsoft visual studio/shared/python37_64/Include" notice: [python-cfg] user-specified libraries: "c:/program files (x86)/microsoft visual studio/shared/python37_64/libs/python37.lib" notice: [python-cfg] Checking interpreter command "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe"... notice: [python-cfg] running command 'DIR /-C /A:S "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" 2>&1' notice: [python-cfg] running command 'c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe -c "from sys import *; print('version=%d.%d\nplatform=%s\nbase_prefix=%s\nbase_exec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,base_prefix,base_exec_prefix,executable))" 2>&1' notice: [python-cfg] ...does not invoke a working interpreter notice: [python-cfg] No working Python interpreter found. notice: [python-cfg] running command 'DIR /-C /A:S "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe" 2>&1' notice: [python-cfg] falling back to "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe" notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe" notice: [python-cfg] include path: "c:/program files (x86)/microsoft visual studio/shared/python37_64/Include" notice: [python-cfg] library path: "c:/program files (x86)/microsoft visual studio/shared/python37_64/libs/python37.lib" notice: [python-cfg] DLL search path: "" notice: [python-cfg] Checking for NumPy... notice: [python-cfg] running command 'c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"' 'c:/program' is not recognized as an internal or external command, operable program or batch file. notice: [python-cfg] NumPy disabled. Reason: notice: [python-cfg] c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())" aborted with notice: [python-cfg] notice: [msvc-cfg] msvc-14.2 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe' notice: [msvc-cfg] msvc-14.1 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe' notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe' for msvc, condition msvc-14.2 notice: [generate-setup-cmd] 14.24.28314 is 14.2 notice: [generate-setup-cmd] 14.24.28314 is 14.2 notice: [generate-setup-cmd] 14.24.28314 is 14.2 notice: [generate-setup-cmd] 14.24.28314 is 14.2 notice: [generate-setup-cmd] 14.24.28314 is 14.2 notice: [msvc-cfg] condition: 'msvc-14.2//', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat' notice: [msvc-cfg] condition: 'msvc-14.2//32', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat' notice: [msvc-cfg] condition: 'msvc-14.2/x86/', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat' notice: [msvc-cfg] condition: 'msvc-14.2/x86/32', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat' notice: [msvc-cfg] condition: 'msvc-14.2//64', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsx86_amd64.bat' notice: [msvc-cfg] condition: 'msvc-14.2/x86/64', setup: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsx86_amd64.bat' notice: [msvc-cfg] condition: 'msvc-14.2/ia64/', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [msvc-cfg] condition: 'msvc-14.2/ia64/64', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [msvc-cfg] condition: 'msvc-14.2/arm/', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [msvc-cfg] condition: 'msvc-14.2/arm/32', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [msvc-cfg] condition: 'msvc-14.2/arm/', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [msvc-cfg] condition: 'msvc-14.2/arm/64', setup: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat' notice: [zlib] zlib is already configured notice: [bzip2] bzip is already configured notice: iostreams: not using lzma compression notice: iostreams: not using zstd compression Performing configuration checks - default address-model : 32-bit - default architecture : x86 - compiler supports SSE2 : yes - compiler supports SSE4.1 : yes - has synchronization.lib : yes - C++11 mutex : yes - has BCrypt API : yes - has stat::st_mtim : no - has stat::st_mtimensec : no - has stat::st_mtimespec : no - has stat::st_birthtim : no - has stat::st_birthtimensec : no - has stat::st_birthtimespec : no - has statx : no - has statx syscall : no - cxx11_auto_declarations : yes - cxx11_constexpr : yes - cxx11_defaulted_functions : yes - cxx11_final : yes - cxx11_hdr_mutex : yes - cxx11_hdr_tuple : yes - cxx11_lambdas : yes - cxx11_noexcept : yes - cxx11_nullptr : yes - cxx11_rvalue_references : yes - cxx11_template_aliases : yes - cxx11_thread_local : yes - cxx11_variadic_templates : yes - has_icu builds : no - zlib : yes - bzip2 : yes - cxx11_alignas : yes - cxx11_decltype : yes - iconv (libc) : no - iconv (separate) : yes - native atomic int32 supported : yes - has message compiler : yes - native syslog supported : no - pthread supports robust mutexes : no - compiler supports SSSE3 : yes - compiler supports AVX2 : yes - gcc visibility : no - long double support : yes - cxx11_static_assert : yes - std::fstream is moveable and swappable : yes - Has Large File Support : yes - libbacktrace builds : no - addr2line builds : no - WinDbg builds : yes - WinDbgCached builds : yes - BOOST_COMP_GNUC >= 4.3.0 : no Component configuration: - atomic : building - chrono : building - container : building - context : building - contract : building - coroutine : building - date_time : building - exception : building - fiber : building - filesystem : building - graph : building - graph_parallel : not building - headers : not building - iostreams : building - json : building - locale : building - log : building - math : building - mpi : not building - nowide : building - program_options : building - python : building - random : building - regex : building - serialization : building - stacktrace : building - system : building - test : building - thread : building - timer : building - type_erasure : building - wave : building boost/1.75.0: Package '41210a149498722c689706bd7bfce258dd331844' built boost/1.75.0: Build folder C:\.conan\2ff40e\1 boost/1.75.0: Generated conaninfo.txt boost/1.75.0: Generated conanbuildinfo.txt boost/1.75.0: Generating the package boost/1.75.0: Package folder C:\.conan\120d35\1 boost/1.75.0: Calling package() boost/1.75.0 package(): Packaged 14262 '.hpp' files boost/1.75.0 package(): Packaged 145 '.h' files boost/1.75.0 package(): Packaged 250 '.ipp' files boost/1.75.0 package(): Packaged 17 files boost/1.75.0 package(): Packaged 2 '.inc' files: cpp_re.inc, strict_cpp_re.inc boost/1.75.0 package(): Packaged 40 '.lib' files boost/1.75.0 package(): Packaged 1 '.txt' file: LICENSE_1_0.txt boost/1.75.0: Package '41210a149498722c689706bd7bfce258dd331844' created boost/1.75.0: Created package revision 7fa7abb52db628aad7f05b210a97e171 boost/1.75.0: Disabled magic autolinking (smart and magic decisions) boost/1.75.0: running "c:/program files (x86)/microsoft visual studio/shared/python37_64/python.exe" -c "from __future__ import print_function; import sys; print('%s.%s' % (sys.version_info[0], sys.version_info[1]))" boost/1.75.0: WARN: Boost component 'numpy' is missing libraries. Try building boost with '-o boost:without_numpy'. ERROR: boost/1.75.0: Error in package_info() method, line 1341 raise ConanException("These libraries were expected to be built, but were not built: {}".format(non_built)) ConanException: These libraries were expected to be built, but were not built: {'libboost_numpy37'} ```
pcbennion commented 3 years ago

Workaround: using the option -o python_executable="python.exe" lets the boost build script resolve the python path without affecting the package id.

Renari commented 3 years ago

This may be a python issue, I recall python not liking when it's installed in a location with spaces so it always tries to install in C:\.