Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installion s2geometry on windows' issues #330

Closed
satoti opened this issue Oct 2, 2023 · 18 comments
Closed

installion s2geometry on windows' issues #330

satoti opened this issue Oct 2, 2023 · 18 comments

Comments

@satoti
Copy link

satoti commented Oct 2, 2023

I am trying to install s2geometry libaray in windows x64 11, I downloaded all the dependcy files. I still have this error.
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [119 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\s2geometry
copying src\python_init_.py -> build\lib.win-amd64-cpython-39\s2geometry

Any solustion for this plz ?

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

Can you paste the full output? That might give us more to go on.

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

This sounds like an issue with windows paths having backslashes in them, it's the \U in \Users that's causing the trouble:

https://stackoverflow.com/questions/13737370/cmake-error-invalid-escape-sequence-u

So I think there needs to be some more quoting of the paths somewhere.

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

I don't have a windows machine setup for development, so this'll require a little back and forth, but as a first thing let's try changing this line: https://github.com/google/s2geometry/blob/master/src/python/CMakeLists.txt#L10

from:

set(S2GEOMETRY_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

to:

cmake_path(SET S2GEOMETRY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

Yes you'd have to clone it manually and edit the file, you can follow the direction for building a wheel here. (Sorry, windows compilation has been a lower priority for S2 in general).

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

Now we're fully out of my depth. You'll have to make sure you have a working version of visual studio installed too to compile on Windows.

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

You'll have to have Abseil installed as well to compile.

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@smcallis
Copy link
Collaborator

smcallis commented Oct 2, 2023

Without a working windows development box I don't think I'll be able to be much more help. If you can get a working configuration that builds, it might be worth submitting a PR to update the build files so they're more cross platform compatible.

@satoti
Copy link
Author

satoti commented Oct 2, 2023 via email

@satoti
Copy link
Author

satoti commented Nov 2, 2023

Hi I tried installing Abseil using cmake and I get the following error. The steps are in the tutorial here

cmake --build . --target all
MSBuild version 17.7.2+d6990bcfa for .NET Framework
MSBUILD : error MSB1009: Project file does not exist.
Switch: all.vcxproj

Also here is the full output during the previous make step:

cmake -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=17 ..
-- Building for: Visual Studio 17 2022
-- The CXX compiler identification is MSVC 19.37.32824.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at CMakeLists.txt:82 (message):
  A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake
  3.8 and up.  We recommend enabling this option to ensure your project still
  builds correctly.


-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17
-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17 - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.27/Modules/ExternalProject.cmake:3136 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.27/Modules/ExternalProject.cmake:4345 (_ep_add_download_command)
  CMakeLists.txt:6 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (1.3s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/c1910526/source/abseil-cpp/build/googletest-external
MSBuild version 17.7.2+d6990bcfa for .NET Framework

  1>Checking Build System
  Creating directories for 'googletest'
  Building Custom Rule C:/Users/c1910526/source/abseil-cpp/build/googletest-external/CMakeLists.txt
  Performing download step (download, verify and extract) for 'googletest'
  -- Downloading...
     dst='C:/Users/c1910526/source/abseil-cpp/build/googletest-external/googletest-prefix/src/main.zip'
     timeout='none'
     inactivity timeout='none'
  -- Using src='https://github.com/google/googletest/archive/main.zip'
  -- Downloading... done
  -- extracting...
       src='C:/Users/c1910526/source/abseil-cpp/build/googletest-external/googletest-prefix/src/main.zip'
       dst='C:/Users/c1910526/source/abseil-cpp/build/googletest-src'
  -- extracting... [tar xfz]
  -- extracting... [analysis]
  -- extracting... [rename]
  -- extracting... [clean up]
  -- extracting... done
  No update step for 'googletest'
  No patch step for 'googletest'
  No configure step for 'googletest'
  No build step for 'googletest'
  No install step for 'googletest'
  No test step for 'googletest'
  Completed 'googletest'
  Building Custom Rule C:/Users/c1910526/source/abseil-cpp/build/googletest-external/CMakeLists.txt
-- The C compiler identification is MSVC 19.37.32824.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: C:/msys64/ucrt64/bin/python3.10.exe (found version "3.10.12") found components: Interpreter
-- Configuring done (36.1s)
-- Generating done (11.6s)
-- Build files have been written to: C:/Users/c1910526/source/abseil-cpp/build

@jmr
Copy link
Member

jmr commented Nov 2, 2023

Sorry, I don't really know anything about Windows. If I search for [cmake all.vcxproj], I find:

https://discourse.cmake.org/t/msbuild-error-msb1009-project-file-does-not-exist-switch-all-build-vcxproj/4107

https://stackoverflow.com/questions/71437697/cmake-msbuild-error-msb1009-project-file-does-not-exist

Try some of those suggestions.

@jherico
Copy link
Contributor

jherico commented Jan 5, 2024

#338 should fix these issues.

@jmr
Copy link
Member

jmr commented Jan 10, 2024

Reopen #338 if this is not fixed.

@jmr jmr closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants