Skip to content

Commit 14a77e7

Browse files
Updates
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
1 parent 2f322a4 commit 14a77e7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

multipy/runtime/interpreter/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
78
SET(INTERPRETER_DIR "${DEPLOY_DIR}/interpreter" )
89
SET(INTERPRETER_DIR "${DEPLOY_DIR}/interpreter" PARENT_SCOPE)
910

@@ -48,15 +49,18 @@ include(GoogleTest)
4849
# We find the built python modules, this is confusing because python build already outputs
4950
# the modules in a strange nested path, and then that path is relative to the
5051
# Cmake ExternalProject root in the cmake build dir.
52+
## From test devsrvr
5153
ExternalProject_Get_property(cpython SOURCE_DIR)
5254
SET(PYTHON_MODULE_DIR "${SOURCE_DIR}/build/temp.linux-x86_64-${CPYTHON_VERSION}/${SOURCE_DIR}/Modules")
5355
SET(PYTHON_STDLIB_DIR "${SOURCE_DIR}/Lib")
5456
SET(PYTHON_STDLIB "${PYTHON_INSTALL_DIR}/lib/libpython_stdlib${CPYTHON_VERSION}.a")
5557

56-
if(${CPYTHON_VERSION} MATCHES "3\.[8-9]")
58+
if(${CPYTHON_VERSION} MATCHES "3\.(7|8)")
5759
SET(PYTHON_MEM_MODULE "${PYTHON_MODULE_DIR}/_decimal/libmpdec/memory.o")
58-
elseif(${CPYTHON_VERSION} MATCHES "3\.1[0-1]")
60+
SET(LEGACY_PARSER_MODULE "${PYTHON_MODULE_DIR}/parsermodule.o")
61+
elseif(${CPYTHON_VERSION} MATCHES "3\.(9|1[0-9]*)")
5962
SET(PYTHON_MEM_MODULE "${PYTHON_MODULE_DIR}/_decimal/libmpdec/mpalloc.o")
63+
SET(LEGACY_PARSER_MODULE "")
6064
endif()
6165

6266
# Then we use a hardcoded list of expected module names and include them in our lib
@@ -66,9 +70,10 @@ ExternalProject_Add_Step(
6670
archive_stdlib
6771
DEPENDEES install
6872
BYPRODUCTS ${PYTHON_STDLIB}
69-
COMMAND ar -rc ${PYTHON_STDLIB} ${PYTHON_MODULES} ${PYTHON_MEM_MODULE}
73+
COMMAND ar -rc ${PYTHON_STDLIB} ${PYTHON_MODULES} ${PYTHON_MEM_MODULE} ${LEGACY_PARSER_MODULE}
7074
VERBATIM
7175
)
76+
7277
# Get python typing extension, needed by torch
7378
SET(TYPING_PKG "${INTERPRETER_DIR}/third_party/typing_extensions.py")
7479
ExternalProject_Add(

multipy/runtime/interpreter/CMakePythonModules.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ SET(PYTHON_MODULES
3939
${PYTHON_MODULE_DIR}/nismodule.o
4040
${PYTHON_MODULE_DIR}/_opcode.o
4141
${PYTHON_MODULE_DIR}/ossaudiodev.o
42-
${PYTHON_MODULE_DIR}/parsermodule.o
4342
${PYTHON_MODULE_DIR}/_pickle.o
4443
${PYTHON_MODULE_DIR}/_posixsubprocess.o
4544
${PYTHON_MODULE_DIR}/pyexpat.o ${PYTHON_MODULE_DIR}/expat/xmlparse.o ${PYTHON_MODULE_DIR}/expat/xmlrole.o ${PYTHON_MODULE_DIR}/expat/xmltok.o

0 commit comments

Comments
 (0)