Skip to content

Commit

Permalink
Merge pull request #71 from mdcoury/add_logging
Browse files Browse the repository at this point in the history
Add spdlog
  • Loading branch information
arcondello authored Dec 19, 2022
2 parents 0868ba4 + a5d4e13 commit dcdec35
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions dwave/preprocessing/include/dwave/presolve.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <utility>
#include <vector>

#include "spdlog/spdlog.h"
#include "dimod/constrained_quadratic_model.h"

namespace dwave {
Expand Down
1 change: 1 addition & 0 deletions extern/spdlog
Submodule spdlog added at ad0e89
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions testscpp/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down

0 comments on commit dcdec35

Please sign in to comment.