tune_32bit_lmdb_defaults (new): Conditionalize dflt map sz (#969608).
authorAaron M. Ucko <ucko@debian.org>
Mon, 7 Sep 2020 03:01:40 +0000 (23:01 -0400)
committerAaron M. Ucko <ucko@debian.org>
Mon, 7 Sep 2020 03:04:32 +0000 (23:04 -0400)
Patch to avoid allocation failures on 32-bit platforms.

debian/changelog
debian/patches/series
debian/patches/tune_32bit_lmdb_defaults [new file with mode: 0644]

index 3c2014839eb3f7477c70fdbcc5366ff8ace3fa2a..16c8bc4c8e2124ea5ebff7eded580a5d5c2831e7 100644 (file)
@@ -3,8 +3,11 @@ ncbi-blast+ (2.10.0-2) UNRELEASED; urgency=medium
   * NOT RELEASED YET.
   * debian/patches/support_gcc10: Additionally tweak ncbifile.cpp to avoid
     narrowing errors on some platforms (i386, for one).
+  * debian/patches/tune_32bit_lmdb_defaults (new): Conditionalize default
+    map size to avoid allocation failures on 32-bit platforms.
+    (Closes: #969608.)
 
- -- Aaron M. Ucko <ucko@debian.org>  Sun, 06 Sep 2020 22:57:35 -0400
+ -- Aaron M. Ucko <ucko@debian.org>  Sun, 06 Sep 2020 23:01:38 -0400
 
 ncbi-blast+ (2.10.0-1) unstable; urgency=medium
 
index 419fdd9f893c8dd5c0376477c797e2efd9db8ed1..f6a3d5d7af5ebf4e4caddb5607f4b8927ad65991 100644 (file)
@@ -15,3 +15,4 @@ reprobuild
 spelling
 support_gcc10
 run_perl_directly
+tune_32bit_lmdb_defaults
diff --git a/debian/patches/tune_32bit_lmdb_defaults b/debian/patches/tune_32bit_lmdb_defaults
new file mode 100644 (file)
index 0000000..9786c7d
--- /dev/null
@@ -0,0 +1,36 @@
+Index: b/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp
+===================================================================
+--- a/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp
++++ b/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp
+@@ -48,6 +48,11 @@ USING_SCOPE(objects);
+ BEGIN_NCBI_SCOPE
++#if NCBI_PLATFORM_BITS >= 64
++#  define NCBI_WRITEDB_DEFAULT_MAP_SIZE 300 * 1000 * 1000 * 1000
++#else
++#  define NCBI_WRITEDB_DEFAULT_MAP_SIZE 1000 * 1000 * 1000
++#endif
+ /// This class supports creation of a string accession to integer OID
+ /// lmdb database
+@@ -59,7 +64,8 @@ public:
+     /// Constructor for LMDB write access
+     /// @param dbname Database name
+-    CWriteDB_LMDB(const string& dbname, Uint8 map_size = 300000000000, Uint8 capacity = 500000);
++    CWriteDB_LMDB(const string& dbname, Uint8 map_size = NCBI_WRITEDB_DEFAULT_MAP_SIZE,
++                Uint8 capacity = 500000);
+     // Destructor
+     ~CWriteDB_LMDB();
+@@ -130,7 +136,8 @@ public:
+     /// Constructor for LMDB write access
+     /// @param dbname Database name
+-    CWriteDB_TaxID(const string& dbname, Uint8 map_size = 300000000000, Uint8 capacity = 500000);
++    CWriteDB_TaxID(const string& dbname, Uint8 map_size = NCBI_WRITEDB_DEFAULT_MAP_SIZE,
++                 Uint8 capacity = 500000);
+     // Destructor
+     ~CWriteDB_TaxID();