Skip to content

Commit

Permalink
bliss@0.73 (#1894)
Browse files Browse the repository at this point in the history
mmorel-35 authored Apr 29, 2024
1 parent 6a4b46a commit 6faef0d
Showing 7 changed files with 245 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/bliss/0.73/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module(
name = "bliss",
version = "0.73",
)
46 changes: 46 additions & 0 deletions modules/bliss/0.73/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
--- /dev/null
+++ a/BUILD.bazel
@@ -0,0 +1,43 @@
+# Copyright 2010-2024 Google LLC
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cc_library(
+ name = "bliss",
+ srcs = [
+ "bliss_C.cc",
+ "defs.cc",
+ "graph.cc",
+ "heap.cc",
+ "orbit.cc",
+ "partition.cc",
+ "timer.cc",
+ "uintseqhash.cc",
+ "utils.cc",
+ ],
+ hdrs = [
+ "bignum.hh",
+ "bliss_C.h",
+ "defs.hh",
+ "graph.hh",
+ "heap.hh",
+ "kqueue.hh",
+ "kstack.hh",
+ "orbit.hh",
+ "partition.hh",
+ "timer.hh",
+ "uintseqhash.hh",
+ "utils.hh",
+ ],
+ includes = ["."],
+ visibility = ["//visibility:public"],
+)
147 changes: 147 additions & 0 deletions modules/bliss/0.73/patches/bliss-0.73.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
diff -u bliss-0.73.orig/graph.cc bliss-0.73/graph.cc
--- bliss-0.73.orig/graph.cc 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/graph.cc 2020-07-03 10:11:29.480649776 +0200
@@ -67,6 +67,9 @@

report_hook = 0;
report_user_param = 0;
+
+ limit_search_nodes = 0;
+ limit_generators = 0;
}


@@ -609,13 +612,7 @@



-
-typedef struct {
- unsigned int splitting_element;
- unsigned int certificate_index;
- unsigned int subcertificate_length;
- UintSeqHash eqref_hash;
-} PathInfo;
+// struct PathInfo moved to graph.hh by Thomas Rehn, 2011-07-12


void
@@ -745,7 +742,7 @@
initialize_certificate();

std::vector<TreeNode> search_stack;
- std::vector<PathInfo> first_path_info;
+ // first_path_info moved to graph.hh by Thomas Rehn, 2011-07-12
std::vector<PathInfo> best_path_info;

search_stack.clear();
@@ -1054,6 +1051,8 @@
const unsigned int child_level = current_level+1;
/* Update some statistics */
stats.nof_nodes++;
+ if (limit_search_nodes && stats.nof_nodes >= limit_search_nodes)
+ break;
if(search_stack.size() > stats.max_level)
stats.max_level = search_stack.size();

@@ -1642,6 +1641,8 @@
best_path_automorphism);
/* Update statistics */
stats.nof_generators++;
+ if (limit_generators && stats.nof_generators >= limit_generators)
+ break;
}

/*
@@ -1733,6 +1734,8 @@

/* Update statistics */
stats.nof_generators++;
+ if (limit_generators && stats.nof_generators >= limit_generators)
+ break;
continue;

} /* while(!search_stack.empty()) */
@@ -5452,7 +5455,7 @@
component.clear();
component_elements = 0;
sh_return = 0;
- unsigned int sh_first = 0;
+ unsigned int sh_first = 1 << 31;
unsigned int sh_size = 0;
unsigned int sh_nuconn = 0;

Seulement dans bliss-0.73: graph.cc.orig
diff -u bliss-0.73.orig/graph.hh bliss-0.73/graph.hh
--- bliss-0.73.orig/graph.hh 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/graph.hh 2020-07-03 10:11:29.484649847 +0200
@@ -20,6 +20,9 @@
along with bliss. If not, see <http://www.gnu.org/licenses/>.
*/

+/** This is a patched version of bliss by Thomas Rehn extended by method AbstractGraph::set_search_limits() */
+#define BLISS_PATCH_PRESENT
+
/**
* \namespace bliss
* The namespace bliss contains all the classes and functions of the bliss
@@ -111,6 +114,14 @@



+/** moved here from graph.cc by Thomas Rehn, 2011-07-12 */
+typedef struct {
+ unsigned int splitting_element;
+ unsigned int certificate_index;
+ unsigned int subcertificate_length;
+ UintSeqHash eqref_hash;
+} PathInfo;
+



@@ -284,7 +295,20 @@
opt_use_long_prune = active;
}

+ /// information vector about first path
+ /** added by Thomas Rehn, 2011-07-12 */
+ std::vector<PathInfo> get_first_path_info() { return first_path_info; }

+ /// limits number of search nodes and generators during the backtrack search
+ /** added by Thomas Rehn, 2012-01-12
+ *
+ * \param searchNodeLimit if non-zero, limits the number of search nodes in search tree
+ * \param generatorLimit if non-zero, limits the maximal number of automorphism group generators to be found
+ */
+ void set_search_limits(const unsigned int searchNodeLimit, const unsigned int generatorLimit) {
+ limit_search_nodes = searchNodeLimit;
+ limit_generators = generatorLimit;
+ }

protected:
/** \internal
@@ -519,6 +543,11 @@



+ /** added by Thomas Rehn, 2011-07-12 */
+ std::vector<PathInfo> first_path_info;
+
+ unsigned int limit_search_nodes;
+ unsigned int limit_generators;
};


diff -u bliss-0.73.orig/Makefile bliss-0.73/Makefile
--- bliss-0.73.orig/Makefile 2015-09-01 09:23:10.000000000 +0200
+++ bliss-0.73/Makefile 2020-07-03 10:11:29.484649847 +0200
@@ -5,7 +5,7 @@
CFLAGS += --pedantic
CFLAGS += -O9
#CFLAGS += -DBLISS_DEBUG
-CFLAGS += -fPIC
+CFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden

SRCS = defs.cc graph.cc partition.cc orbit.cc uintseqhash.cc heap.cc
SRCS += timer.cc utils.cc bliss_C.cc
7 changes: 7 additions & 0 deletions modules/bliss/0.73/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--- a/MODULE.bazel
+++ a/MODULE.bazel
@@ -0,0 +1,4 @@
+module(
+ name = "bliss",
+ version = "0.73",
+)
16 changes: 16 additions & 0 deletions modules/bliss/0.73/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
bazel:
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@bliss//:bliss'
11 changes: 11 additions & 0 deletions modules/bliss/0.73/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"url": "http://www.tcs.hut.fi/Software/bliss/bliss-0.73.zip",
"integrity": "sha256-9XvzKAQUDK1YsSQLgE4NvWj35r9n66jgwPo6Yv1/D4Q=",
"strip_prefix": "bliss-0.73",
"patches": {
"bliss-0.73.patch": "sha256-uXmLE+tjw4E3j3ZN18ojhWW5fNLnDV317mspzvGv514=",
"add_build_file.patch": "sha256-ckihvTO3E5uwj0n9oheqMAVNiCaOxiwK+ik71LmrsXU=",
"module_dot_bazel.patch": "sha256-9AO6KkEkub5BjunpdmImGMIDSXM1tKumt0D+IACRLMo="
},
"patch_strip": 1
}
14 changes: 14 additions & 0 deletions modules/bliss/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"homepage": "http://www.tcs.hut.fi/Software/bliss/",
"maintainers": [
{
"email": "bcr-maintainers@bazel.build",
"name": "No Maintainer Specified"
}
],
"repository": [],
"versions": [
"0.73"
],
"yanked_versions": {}
}

0 comments on commit 6faef0d

Please sign in to comment.