Skip to content

Commit 92baf28

Browse files
committed
Remove numpy build time dependency and have it as runtime only
1 parent 90985ba commit 92baf28

File tree

4 files changed

+320
-339
lines changed

4 files changed

+320
-339
lines changed

CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ else()
5858
set(HAVE_SYMENGINE_LLVM False)
5959
endif()
6060

61-
if(WITH_NUMPY)
62-
set(WITH_NUMPY True CACHE BOOL INTERNAL)
63-
find_package(NumPy REQUIRED)
64-
include_directories(${NUMPY_INCLUDE_PATH})
65-
set(HAVE_NUMPY True)
66-
else()
67-
set(WITH_NUMPY False CACHE BOOL INTERNAL)
68-
set(HAVE_NUMPY False)
69-
endif()
70-
71-
7261
message("CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")
7362
message("CMAKE_CXX_FLAGS_RELEASE : ${CMAKE_CXX_FLAGS_RELEASE}")
7463
message("CMAKE_CXX_FLAGS_DEBUG : ${CMAKE_CXX_FLAGS_DEBUG}")
@@ -77,7 +66,6 @@ message("HAVE_SYMENGINE_MPC : ${HAVE_SYMENGINE_MPC}")
7766
message("HAVE_SYMENGINE_PIRANHA : ${HAVE_SYMENGINE_PIRANHA}")
7867
message("HAVE_SYMENGINE_FLINT : ${HAVE_SYMENGINE_FLINT}")
7968
message("HAVE_SYMENGINE_LLVM : ${HAVE_SYMENGINE_LLVM}")
80-
message("HAVE_NUMPY : ${HAVE_NUMPY}")
8169

8270
message("Copying source of python wrappers into: ${CMAKE_CURRENT_BINARY_DIR}")
8371
file(COPY symengine/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/symengine)

setup.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ def _process_define(arg):
6565
(defs, one), = getattr(arg, 'define', None) or [('', '1')]
6666
assert one == '1'
6767
defs = [df for df in defs.split(';') if df != '']
68-
if not any(define.startswith('WITH_NUMPY') for define in defs):
69-
try:
70-
import numpy as np
71-
except ImportError:
72-
defs.append('WITH_NUMPY=False')
73-
else:
74-
defs.append('WITH_NUMPY=True')
7568
return [(s.strip(), None) if '=' not in s else
7669
tuple(ss.strip() for ss in s.split('='))
7770
for s in defs]

symengine/lib/config.pxi.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ DEF HAVE_SYMENGINE_MPC = ${HAVE_SYMENGINE_MPC}
33
DEF HAVE_SYMENGINE_PIRANHA = ${HAVE_SYMENGINE_PIRANHA}
44
DEF HAVE_SYMENGINE_FLINT = ${HAVE_SYMENGINE_FLINT}
55
DEF HAVE_SYMENGINE_LLVM = ${HAVE_SYMENGINE_LLVM}
6-
DEF HAVE_NUMPY = ${HAVE_NUMPY}

0 commit comments

Comments
 (0)