diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2022-08-27 19:34:12 -0700 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2022-08-27 19:35:08 -0700 |
commit | 999d53d6e9c79c4d3e8017ec6466cfabc46248c2 (patch) | |
tree | 295d450b9c073d102166e2dd68415c3006e76251 | |
parent | devel/golangci-lint: Update to 1.49.0 (diff) |
science/dwave-preprocessing: New port: DWave: Preprocessing tools to aid in solving binary quadratic models
-rw-r--r-- | science/Makefile | 1 | ||||
-rw-r--r-- | science/dwave-preprocessing/Makefile | 39 | ||||
-rw-r--r-- | science/dwave-preprocessing/distinfo | 3 | ||||
-rw-r--r-- | science/dwave-preprocessing/files/patch-testscpp_Makefile | 32 | ||||
-rw-r--r-- | science/dwave-preprocessing/files/patch-testscpp_test__main.cpp | 9 | ||||
-rw-r--r-- | science/dwave-preprocessing/files/patch-testscpp_tests_test__roof__duality.cpp | 11 | ||||
-rw-r--r-- | science/dwave-preprocessing/pkg-descr | 4 |
7 files changed, 99 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile index 28e271d2ba1b..f41ec7bd287d 100644 --- a/science/Makefile +++ b/science/Makefile @@ -75,6 +75,7 @@ SUBDIR += dlib-cpp SUBDIR += drawxtl SUBDIR += dvc + SUBDIR += dwave-preprocessing SUBDIR += dynare SUBDIR += eccodes SUBDIR += elk diff --git a/science/dwave-preprocessing/Makefile b/science/dwave-preprocessing/Makefile new file mode 100644 index 000000000000..e6f53ef8c8e8 --- /dev/null +++ b/science/dwave-preprocessing/Makefile @@ -0,0 +1,39 @@ +PORTNAME= dwave-preprocessing +DISTVERSION= 0.4.0 +CATEGORIES= science # quantum-computing + +MAINTAINER= yuri@FreeBSD.org +COMMENT= DWave: Preprocessing tools to aid in solving binary quadratic models + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= dimod>0:science/dimod +TEST_DEPENDS= catch>0:devel/catch + +USES= compiler:c++11-lang pkgconfig + +USE_GITHUB= yes +GH_ACCOUNT= dwavesystems + +NO_BUILD= yes +NO_ARCH= yes + +PLIST_FILES= include/dwave-preprocessing/fix_variables.hpp \ + include/dwave-preprocessing/helper_data_structures.hpp \ + include/dwave-preprocessing/helper_graph_algorithms.hpp \ + include/dwave-preprocessing/implication_network.hpp \ + include/dwave-preprocessing/mapping_policy.hpp \ + include/dwave-preprocessing/posiform_info.hpp \ + include/dwave-preprocessing/push_relabel.hpp + +BINARY_ALIAS= git=true + +do-install: + cd ${WRKSRC}/dwave/preprocessing/include && \ + ${COPYTREE_SHARE} dwave-preprocessing ${STAGEDIR}${PREFIX}/include + +do-test: + @cd ${WRKSRC}/testscpp && ${SETENV} ${MAKE_ENV} ${MAKE} DIMOD="-I${LOCALBASE}/include" + +.include <bsd.port.mk> diff --git a/science/dwave-preprocessing/distinfo b/science/dwave-preprocessing/distinfo new file mode 100644 index 000000000000..a83055cb266e --- /dev/null +++ b/science/dwave-preprocessing/distinfo @@ -0,0 +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 diff --git a/science/dwave-preprocessing/files/patch-testscpp_Makefile b/science/dwave-preprocessing/files/patch-testscpp_Makefile new file mode 100644 index 000000000000..35530211b3d6 --- /dev/null +++ b/science/dwave-preprocessing/files/patch-testscpp_Makefile @@ -0,0 +1,32 @@ +--- testscpp/Makefile.orig 2022-05-07 23:28:35 UTC ++++ testscpp/Makefile +@@ -1,22 +1,22 @@ + ROOT := ../ + SRC := $(ROOT)/dwave/preprocessing/ +-DIMOD := $(shell python -c 'import dimod; print(dimod.get_include())') ++#DIMOD := $(shell python -c 'import dimod; print(dimod.get_include())') + + all: catch2 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 + ./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) + + 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) + + catch2: + git submodule init diff --git a/science/dwave-preprocessing/files/patch-testscpp_test__main.cpp b/science/dwave-preprocessing/files/patch-testscpp_test__main.cpp new file mode 100644 index 000000000000..1fce02ce2668 --- /dev/null +++ b/science/dwave-preprocessing/files/patch-testscpp_test__main.cpp @@ -0,0 +1,9 @@ +--- testscpp/test_main.cpp.orig 2022-08-27 22:08:08 UTC ++++ testscpp/test_main.cpp +@@ -1,5 +1,5 @@ + #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file +-#include "Catch2/single_include/catch2/catch.hpp" ++#include <catch2/catch.hpp> + + /* + The purpose of this file is to include Catch's main(). Tests can be found inside tests directory. diff --git a/science/dwave-preprocessing/files/patch-testscpp_tests_test__roof__duality.cpp b/science/dwave-preprocessing/files/patch-testscpp_tests_test__roof__duality.cpp new file mode 100644 index 000000000000..01a4bff4b58c --- /dev/null +++ b/science/dwave-preprocessing/files/patch-testscpp_tests_test__roof__duality.cpp @@ -0,0 +1,11 @@ +--- testscpp/tests/test_roof_duality.cpp.orig 2022-08-28 01:26:12 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 <dimod/quadratic_model.h> + + #include "dwave-preprocessing/fix_variables.hpp" diff --git a/science/dwave-preprocessing/pkg-descr b/science/dwave-preprocessing/pkg-descr new file mode 100644 index 000000000000..602f35493d33 --- /dev/null +++ b/science/dwave-preprocessing/pkg-descr @@ -0,0 +1,4 @@ +dwave-preprocessing is a package of common preprocessing tools that can aid in +solving binary quadratic models (BQM). + +WWW: https://github.com/dwavesystems/dwave-preprocessing |