Skip to content

Problems while following first steps from the docs #548

Closed
@lamortenera

Description

@lamortenera

Hi,

thanks for building such a great tool. I used R and Rcpp for a while and I loved it, so I am looking for a python equivalent. I gave up with Python.Boost because I didn't manage to setup boost under windows.

I tried to follow the first steps from the guide in https://pybind11.readthedocs.io/en/latest/basics.html, but I encountered some problems. I am using Windows 7 with Visual Studio 2015 and Python 3.5.

I am not a python guru and pretty bad at compiling things, so it is perfectly possible that the problems I encountered are just a reflection of that.

The first issue is that the first steps do not seem to be really the first. Do I have to install pybind11 in some way before compiling the test cases? If yes how? with pip? with python stetup.py install? At the very least I have to download something, maybe this could be clarified under "first steps". The docs say "Before getting started, make sure that development environment is set up to compile the included set of test cases.", but I don't understand what "set up to compile" exactly means. I assumed that I just had to download the latest pybind release from github, uncompress it, and create a build directory from the root of the git repository. I downloaded release 1.8.1.

The second issue I had was with cmake. The first thing I tried was the command cmake .. from the build directory. This command gave the following complaint:

Python config failure: Python is 64-bit, chosen compiler is 32-bit.

It took a while to understand that I had to issue the command cmake -A x64 ... This was written in the docs, well done for that, but I misunderstood it and expected potential issues to show up later, not at this stage. I am also wondering whether this could be automated by cmake, it sounds like something a build tool could figure out.

The third issue, and the one where I gave up, was the command cmake --build . --config Release --target pytest, which gave the following output:

MSBUILD : error MSB1009: Project file does not exist.

Looking at the project files created under the build directory, I assumed (but this is just speculation) that the command should have been:

cmake --build . --config Release --target RUN_TESTS

After issuing this command I got the following compilation errors:

'''
2>------ Build started: Project: RUN_TESTS, Configuration: Debug x64 ------
2> Test project C:/Users/amammana/Desktop/python_c_api/pybind11-1.8.1/pybind11-1.8.1/build
2> Start 1: example1
2> 1/18 Test #1: example1 .........................***Failed 0.25 sec
2> Start 2: example2
2> 2/18 Test #2: example2 .........................***Failed 0.34 sec
2> Start 3: example3
2> 3/18 Test #3: example3 .........................***Failed 0.19 sec
2> Start 4: example4
2> 4/18 Test #4: example4 .........................***Failed 0.17 sec
2> Start 5: example5
2> 5/18 Test #5: example5 .........................***Failed 0.20 sec
2> Start 6: example6
2> 6/18 Test #6: example6 .........................***Failed 0.18 sec
2> Start 7: example7
2> 7/18 Test #7: example7 .........................***Failed 0.24 sec
2> Start 8: example8
2> 8/18 Test #8: example8 .........................***Failed 0.20 sec
2> Start 9: example9
2> 9/18 Test #9: example9 .........................***Failed 0.21 sec
2> Start 10: example10
2> 10/18 Test #10: example10 ........................***Failed 0.21 sec
2> Start 11: example11
2> 11/18 Test #11: example11 ........................***Failed 0.28 sec
2> Start 12: example12
2> 12/18 Test #12: example12 ........................***Failed 0.19 sec
2> Start 13: example13
2> 13/18 Test #13: example13 ........................***Failed 0.19 sec
2> Start 14: example14
2> 14/18 Test #14: example14 ........................***Failed 0.18 sec
2> Start 15: example15
2> 15/18 Test #15: example15 ........................***Failed 0.19 sec
2> Start 16: example16
2> 16/18 Test #16: example16 ........................***Failed 0.21 sec
2> Start 17: example17
2> 17/18 Test #17: example17 ........................***Failed 0.16 sec
2> Start 18: issues
2> 18/18 Test #18: issues ...........................***Failed 0.17 sec
2>
2> 0% tests passed, 18 tests failed out of 18
2>
2> Total Test time (real) = 3.80 sec
2>
2> The following tests FAILED:
2> 1 - example1 (Failed)
2> 2 - example2 (Failed)
2> 3 - example3 (Failed)
2> 4 - example4 (Failed)
2> 5 - example5 (Failed)
2> 6 - example6 (Failed)
2> 7 - example7 (Failed)
2> 8 - example8 (Failed)
2> 9 - example9 (Failed)
2> 10 - example10 (Failed)
2> 11 - example11 (Failed)
2> 12 - example12 (Failed)
2> 13 - example13 (Failed)
2> 14 - example14 (Failed)
2> 15 - example15 (Failed)
2> 16 - example16 (Failed)
2> 17 - example17 (Failed)
2> 18 - issues (Failed)
2> Errors while running CTest
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "setlocal
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: "C:\Program Files\CMake\bin\ctest.exe" --force-new-ctest-process -C Debug
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 8.
'''

Do you have any clue about what I should do?

Thanks very much in advance,
Alessandro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions