Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spdlog #71

Merged
merged 8 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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