Skip to content

Commit 8b5c9c1

Browse files
authored
Feature/remove scipy (#481)
## Changes - OpenJijからscipy依存性を消しました。これによりnumpy2系がインストールされるようになります。ただしtest時には必要なためtestのときのみscipyがインストールされます。 - macのビルドにおいてbrewが入れたlibompが存在するか判定してる箇所が判定できてなかったので修正しました。macにおいてlibompが存在しない状態で`pip install .`ができることを確認しました。
2 parents 8bc6492 + 72d487c commit 8b5c9c1

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,13 @@ if (APPLE)
9191
add_compile_options(-Wno-unused-command-line-argument)
9292
find_program(BREW_EXECUTABLE brew)
9393
if(BREW_EXECUTABLE)
94-
execute_process(COMMAND brew --prefix libomp COMMAND tr -d '\n' OUTPUT_VARIABLE OMP_DIR)
95-
if(OMP_DIR)
94+
execute_process(
95+
COMMAND ${BREW_EXECUTABLE} list libomp
96+
RESULT_VARIABLE IS_LIBOMP_INSTALLED
97+
OUTPUT_QUIET ERROR_QUIET
98+
)
99+
if(IS_LIBOMP_INSTALLED EQUAL 0)
100+
execute_process(COMMAND brew --prefix libomp COMMAND tr -d '\n' OUTPUT_VARIABLE OMP_DIR)
96101
message(STATUS "Found libomp at: ${OMP_DIR}")
97102
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -lomp -Wno-unused-command-line-argument")
98103
include_directories(SYSTEM ${OMP_DIR}/include)

dev-requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ pytest-runner
3030
pytest-randomly
3131
pytest-spec
3232
coverage
33+
scipy # Required for test_cxx.py CSRSparse tests

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ python_requires = >=3.8, <3.13
5454
install_requires =
5555
numpy >=1.17.3, < 2.4.0
5656
dimod < 0.13.0
57-
scipy >= 1.7.3, < 1.12.0
5857
requests >= 2.28.0, < 2.32.0
5958
jij-cimod >= 1.6.0, < 1.8.0
6059
typing-extensions >= 4.2.0

tests/test_cxx.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import openjij.cxxjij.result as R
1212
from scipy import sparse
1313

14-
1514
class CXXTest(unittest.TestCase):
1615

1716
def setUp(self):

0 commit comments

Comments
 (0)