-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi, I'm interested in your great work on supporting multiple interpreters in one process.
After testing the sample code in this repo, I have two corrections to the CMake file.
- CMake complains about missing
cmake_minimum_required. - It seems that you missed
src/loader.cppin thefind_shared_functionlibrary, which will give me an unresolved symbol error when running the main program.
I use the following CMakelists.txt to successfully build the sample code:
cmake_minimum_required(VERSION 3.17)
project(singleprocessmultiprocess)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(third_party/fmt)
find_package(Python COMPONENTS Development)
add_library(python_runner SHARED src/python_runner.cpp)
target_include_directories(python_runner PRIVATE third_party/pybind11/include ${Python_INCLUDE_DIRS})
add_library(find_shared_function SHARED src/find_shared_function.cpp src/loader.cpp)
target_link_libraries(find_shared_function PRIVATE fmt::fmt-header-only)
add_executable(main src/main.cpp src/loader.cpp)
target_compile_definitions(main PRIVATE PYTHON_SO_PATH=\"${Python_LIBRARIES}\")
target_link_libraries(main PRIVATE dl pthread fmt::fmt-header-only)I recommend choosing 3.17 as the minimum required because it introduces the ability to resolve Python paths in an Anaconda environment.
I also have a question about the implementation, for which I will open a new issue.
Metadata
Metadata
Assignees
Labels
No labels