Skip to content

Commit

Permalink
science/dwave-preprocessing: Update 0.4.0 → 0.5.4
Browse files Browse the repository at this point in the history
Reported by:	portscout
  • Loading branch information
yurivict committed Jun 18, 2023
1 parent 119327e commit fb1a3b6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 27 deletions.
10 changes: 7 additions & 3 deletions science/dwave-preprocessing/Makefile
@@ -1,5 +1,5 @@
PORTNAME= dwave-preprocessing
DISTVERSION= 0.4.0
DISTVERSION= 0.5.4
CATEGORIES= science # quantum-computing

MAINTAINER= yuri@FreeBSD.org
Expand All @@ -10,13 +10,17 @@ LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE

RUN_DEPENDS= dimod>0:science/dimod
TEST_DEPENDS= catch>0:devel/catch
TEST_DEPENDS= catch>0:devel/catch \
spdlog>0:devel/spdlog

USES= compiler:c++11-lang pkgconfig

USE_GITHUB= yes
GH_ACCOUNT= dwavesystems

CXXFLAGS+= `pkg-config --cflags catch2 spdlog`
LDFLAGS+= `pkg-config --libs catch2 spdlog`

NO_BUILD= yes
NO_ARCH= yes

Expand All @@ -34,7 +38,7 @@ do-install:
cd ${WRKSRC}/dwave/preprocessing/include && \
${COPYTREE_SHARE} dwave-preprocessing ${STAGEDIR}${PREFIX}/include

do-test:
do-test: # tests fail to link, see https://github.com/dwavesystems/dwave-preprocessing/issues/119
@cd ${WRKSRC}/testscpp && ${SETENV} ${MAKE_ENV} ${MAKE} DIMOD="-I${LOCALBASE}/include"

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions science/dwave-preprocessing/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1660494073
SHA256 (dwavesystems-dwave-preprocessing-0.4.0_GH0.tar.gz) = 04ff8937b131af3520d4197f256c4ba68cad0783af131c57ce20083d3f36fad3
SIZE (dwavesystems-dwave-preprocessing-0.4.0_GH0.tar.gz) = 80577
TIMESTAMP = 1687113085
SHA256 (dwavesystems-dwave-preprocessing-0.5.4_GH0.tar.gz) = 864ec18a8f14a83f0439d3cb6a9006c0d9577012f2cab14b622dc715bac17b24
SIZE (dwavesystems-dwave-preprocessing-0.5.4_GH0.tar.gz) = 104138
@@ -0,0 +1,11 @@
--- dwave/preprocessing/include/dwave/presolve.h.orig 2023-06-18 18:36:53 UTC
+++ dwave/preprocessing/include/dwave/presolve.h
@@ -19,7 +19,7 @@
#include <utility>
#include <vector>

-#include "spdlog/spdlog.h"
+#include <spdlog/spdlog.h>
#include "dimod/constrained_quadratic_model.h"

namespace dwave {
38 changes: 19 additions & 19 deletions science/dwave-preprocessing/files/patch-testscpp_Makefile
@@ -1,32 +1,32 @@
--- testscpp/Makefile.orig 2022-05-07 23:28:35 UTC
--- testscpp/Makefile.orig 2022-12-19 19:58:20 UTC
+++ testscpp/Makefile
@@ -1,22 +1,22 @@
ROOT := ../
@@ -1,10 +1,10 @@
ROOT := ..
SRC := $(ROOT)/dwave/preprocessing/
CATCH2 := $(ROOT)/testscpp/Catch2/single_include/
-DIMOD := $(shell python -c 'import dimod; print(dimod.get_include())')
+#DIMOD := $(shell python -c 'import dimod; print(dimod.get_include())')
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
+FLAGS := ${CXXFLAGS} -std=c++17 -Wall -Wno-unknown-pragmas -Wno-sign-compare -Wno-deprecated-declarations

all: catch2 test_main test_main_parallel tests tests_parallel
all: update test_main test_main_parallel tests tests_parallel

-tests: test_main.out
+tests: test_main
./test_main

-tests_parallel: test_main_parallel.out
+tests_parallel: test_main_parallel
@@ -15,12 +15,12 @@ tests_parallel: test_main_parallel.out
./test_main_parallel

test_main: test_main.cpp
- g++ -std=c++11 -Wall -c test_main.cpp
- g++ -std=c++11 -Wall test_main.o tests/*.cpp -o test_main -I $(SRC)/include/ -I $(DIMOD)
+ ${CXX} `pkg-config --cflags catch2` -std=c++11 -Wall -c test_main.cpp
+ ${CXX} `pkg-config --cflags catch2` -std=c++11 -Wall test_main.o tests/*.cpp -o test_main -I $(SRC)/include/ -I $(DIMOD)
- g++ $(FLAGS) -c test_main.cpp
- g++ $(FLAGS) test_main.o tests/*.cpp -o test_main $(INCLUDES)
+ ${CXX} $(FLAGS) -c test_main.cpp
+ ${CXX} $(FLAGS) ${LDFLAGS} test_main.o tests/*.cpp -o test_main $(INCLUDES)

test_main_parallel: test_main.cpp
- g++ -std=c++11 -fopenmp -Wall -c test_main.cpp -o test_main_parallel.o
- g++ -std=c++11 -fopenmp -Wall test_main_parallel.o tests/*.cpp -o test_main_parallel -I $(SRC)/include/ -I $(DIMOD)
+ ${CXX} `pkg-config --cflags catch2` -std=c++11 -fopenmp -Wall -c test_main.cpp -o test_main_parallel.o
+ ${CXX} `pkg-config --cflags catch2` -std=c++11 -fopenmp -Wall test_main_parallel.o tests/*.cpp -o test_main_parallel -I $(SRC)/include/ -I $(DIMOD)
- 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)
+ ${CXX} $(FLAGS) -fopenmp -c test_main.cpp -o test_main_parallel.o
+ ${CXX} $(FLAGS) ${LDFLAGS} -fopenmp test_main_parallel.o tests/*.cpp -o test_main_parallel $(INCLUDES)

catch2:
update:
git submodule init
@@ -1,10 +1,10 @@
--- testscpp/tests/test_roof_duality.cpp.orig 2022-08-28 01:26:12 UTC
--- testscpp/tests/test_roof_duality.cpp.orig 2022-12-19 19:58:20 UTC
+++ testscpp/tests/test_roof_duality.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

-#include "../Catch2/single_include/catch2/catch.hpp"
-#include "catch2/catch.hpp"
+#include <catch2/catch.hpp>
#include <dimod/quadratic_model.h>

Expand Down

0 comments on commit fb1a3b6

Please sign in to comment.