How to specify python?

未關閉
#122 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
25/100
Issue 類型
文件
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
cmake, cpp, python

研究方向

從 issue 中所示的 CMakeLists.txt 設定和 pybind11 子目錄設定開始。記錄如何選取所需的 Python 版本,以及該設定應放在哪裡;完成的標準是新貢獻者能夠依照專案說明重現明確選取。

由索引模型根據 Issue 內容生成。

描述

Hello

Thanks for this awesome test!
I'm lost with customization tho...
How can I specify python in CMakeList.txt file?
I build this file without using your python. setup routine tho... just added

add_definitions(-DVERSION_INFO=3.10)

To cmake and it build locally.
Works great, locally, but I Have no idea how it knows which python to use.

I want to be explicit.
Any ideas?
Pinging our 2 biggest contributors hoping for a miracle :- )
@dean0x7d @henryiii

SOLVED>
To specify python version using "new methods"

set(PYBIND11_PYTHON_VERSION 3.9)
set(OLD_PATH ${CMAKE_PREFIX_PATH})
set(CMAKE_PREFIX_PATH ${P3_ROOT_DIR})
add_subdirectory(S:/pybind11 S:/pybind11)
set(CMAKE_PREFIX_PATH ${OLD_PATH})

at least on windows before adding pybind11
big thanks to @henryiii !!

主要語言
C++
星號
671
分支
220
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pybind/cuda_example 的其他 Issue

查看 pybind/cuda_example 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。