Skip to content

Commit 3941bde

Browse files
authored
Merge pull request #511 from isuruf/cmake
Fix for platforms where purelib!=platlib
2 parents f0a013d + b932592 commit 3941bde

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 2.8.12...4.0.0)
22

33
if (POLICY CMP0057)
44
cmake_policy(SET CMP0057 NEW) # needed for llvm >= 16

cmake/FindPython.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
6060
endif()
6161

6262
execute_process(
63-
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])"
63+
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['platlib'])"
6464
OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp
6565
)
6666
string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp)

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def cmake_build(self):
117117

118118
cmake_cmd = ["cmake", source_dir,
119119
"-DCMAKE_BUILD_TYPE=" + cmake_build_type[0],
120-
"-DSYMENGINE_INSTALL_PY_FILES=OFF",
120+
"-DSYMENGINE_INSTALL_PY_FILES=ON",
121121
]
122122
cmake_cmd.extend(process_opts(cmake_opts))
123123
if not path.exists(path.join(build_dir, "CMakeCache.txt")):
@@ -232,7 +232,7 @@ def finalize_options(self):
232232
url="https://github.com/symengine/symengine.py",
233233
python_requires='>=3.9,<4',
234234
zip_safe=False,
235-
packages=['symengine', 'symengine.lib', 'symengine.tests'],
235+
packages=[],
236236
cmdclass = cmdclass,
237237
classifiers=[
238238
'License :: OSI Approved :: MIT License',

symengine/CMakeLists.txt

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
add_subdirectory(lib)
22

33
if (SYMENGINE_INSTALL_PY_FILES)
4-
add_subdirectory(tests)
5-
6-
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine)
7-
install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py
8-
DESTINATION ${PY_PATH}
9-
)
4+
add_subdirectory(tests)
5+
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine)
6+
install(
7+
FILES
8+
__init__.py
9+
functions.py
10+
printing.py
11+
sympy_compat.py
12+
test_utilities.py
13+
utilities.py
14+
DESTINATION
15+
${PY_PATH}
16+
)
1017
endif ()

symengine/tests/CMakeLists.txt

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine/tests)
2-
install(FILES __init__.py
2+
install(
3+
FILES
4+
__init__.py
35
test_arit.py
6+
test_cse.py
47
test_dict_basic.py
58
test_eval.py
69
test_expr.py
710
test_functions.py
8-
test_number.py
11+
test_lambdify.py
12+
test_logic.py
913
test_matrices.py
1014
test_ntheory.py
15+
test_number.py
16+
test_pickling.py
1117
test_printing.py
1218
test_sage.py
1319
test_series_expansion.py
@@ -16,10 +22,9 @@ install(FILES __init__.py
1622
test_subs.py
1723
test_symbol.py
1824
test_sympify.py
25+
test_sympy_compat.py
1926
test_sympy_conv.py
2027
test_var.py
21-
test_lambdify.py
22-
test_sympy_compat.py
23-
test_logic.py
24-
DESTINATION ${PY_PATH}
25-
)
28+
DESTINATION
29+
${PY_PATH}
30+
)

symengine_version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.14.0
1+
153b7e98f310bccaae586dab6b49284ccd5f4174

0 commit comments

Comments
 (0)