diff --git a/.gitmodules b/.gitmodules index 51341cc..fceb099 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = testscpp/Catch2 url = https://github.com/catchorg/Catch2.git branch = v2.x +[submodule "extern/spdlog"] + path = extern/spdlog + url = https://github.com/gabime/spdlog.git diff --git a/MANIFEST.in b/MANIFEST.in index e7418e2..c3defa4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include pyproject.toml recursive-include dwave/preprocessing/include/ *.hpp *.h recursive-include dwave/preprocessing *.pyx *.pxd *.pyx.src +graft extern/spdlog/include/ +include extern/spdlog/LICENSE diff --git a/dwave/preprocessing/include/dwave/presolve.h b/dwave/preprocessing/include/dwave/presolve.h index d6d63c1..08f4c7b 100644 --- a/dwave/preprocessing/include/dwave/presolve.h +++ b/dwave/preprocessing/include/dwave/presolve.h @@ -19,6 +19,7 @@ #include #include +#include "spdlog/spdlog.h" #include "dimod/constrained_quadratic_model.h" namespace dwave { diff --git a/extern/spdlog b/extern/spdlog new file mode 160000 index 0000000..ad0e89c --- /dev/null +++ b/extern/spdlog @@ -0,0 +1 @@ +Subproject commit ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36 diff --git a/setup.py b/setup.py index 4ea96c4..be30156 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,7 @@ def build_extensions(self): include_dirs=[ numpy.get_include(), dimod.get_include(), + 'extern/spdlog/include/', ], install_requires=[ 'numpy>=1.20.0,<2.0.0', # keep synced with circle-ci, pyproject.toml diff --git a/testscpp/Makefile b/testscpp/Makefile index a565fe2..b22be20 100644 --- a/testscpp/Makefile +++ b/testscpp/Makefile @@ -1,11 +1,12 @@ -ROOT := ../ +ROOT := .. SRC := $(ROOT)/dwave/preprocessing/ CATCH2 := $(ROOT)/testscpp/Catch2/single_include/ DIMOD := $(shell python -c 'import dimod; print(dimod.get_include())') -INCLUDES := -I $(SRC)/include/ -I $(DIMOD) -I $(CATCH2) +SPDLOG := $(ROOT)/extern/spdlog/include/ +INCLUDES := -I $(SRC)/include/ -I $(DIMOD) -I $(CATCH2) -I $(SPDLOG) FLAGS := -std=c++17 -Wall -Wno-unknown-pragmas -Wno-sign-compare -Wno-deprecated-declarations -fcompare-debug-second -O3 -all: catch2 test_main test_main_parallel tests tests_parallel +all: update test_main test_main_parallel tests tests_parallel tests: test_main.out ./test_main @@ -16,11 +17,12 @@ tests_parallel: test_main_parallel.out test_main: test_main.cpp g++ $(FLAGS) -c test_main.cpp g++ $(FLAGS) test_main.o tests/*.cpp -o test_main $(INCLUDES) + test_main_parallel: test_main.cpp g++ $(FLAGS) -fopenmp -c test_main.cpp -o test_main_parallel.o g++ $(FLAGS) -fopenmp test_main_parallel.o tests/*.cpp -o test_main_parallel $(INCLUDES) -catch2: +update: git submodule init git submodule update