diff options
-rw-r--r-- | var/spack/repos/builtin/packages/fastdb/fastdb-fmax-fmin.patch | 26 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/fastdb/package.py | 22 |
2 files changed, 48 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fastdb/fastdb-fmax-fmin.patch b/var/spack/repos/builtin/packages/fastdb/fastdb-fmax-fmin.patch new file mode 100644 index 0000000000..da2c65d61b --- /dev/null +++ b/var/spack/repos/builtin/packages/fastdb/fastdb-fmax-fmin.patch @@ -0,0 +1,26 @@ +diff --git a/examples/testtimeseries.cpp b/examples/testtimeseries.cpp +index 1f57bac..e3ed88e 100644 +--- a/examples/testtimeseries.cpp ++++ b/examples/testtimeseries.cpp +@@ -47,8 +47,8 @@ REGISTER_TEMPLATE(DailyBlock); + REGISTER(Stock);
+
+ inline int random(unsigned mod) { return rand() % mod; }
+-inline float fmax(float x, float y) { return x > y ? x : y; }
+-inline float fmin(float x, float y) { return x < y ? x : y; }
++inline float my_fmax(float x, float y) { return x > y ? x : y; }
++inline float my_fmin(float x, float y) { return x < y ? x : y; }
+
+ int main(int argc, char* argv[])
+ {
+@@ -66,8 +66,8 @@ int main(int argc, char* argv[]) + quote.timestamp = i;
+ quote.open = (float)random(10000)/100;
+ quote.close = (float)random(10000)/100;
+- quote.high = fmax(quote.open, quote.close);
+- quote.low = fmin(quote.open, quote.close);
++ quote.high = my_fmax(quote.open, quote.close);
++ quote.low = my_fmin(quote.open, quote.close);
+ quote.volume = random(1000);
+ proc.add(stockId, quote); // add new element in time series
+ }
diff --git a/var/spack/repos/builtin/packages/fastdb/package.py b/var/spack/repos/builtin/packages/fastdb/package.py new file mode 100644 index 0000000000..92ea8783b9 --- /dev/null +++ b/var/spack/repos/builtin/packages/fastdb/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Fastdb(MakefilePackage): + """Object-Relational Main-Memory Embedded Database system + tightly integrated with C++ language.""" + + homepage = "https://sourceforge.net/projects/fastdb/" + url = "https://sourceforge.net/projects/fastdb/files/fastdb/3.75/fastdb-3.75.tar.gz" + + version('3.75', sha256='eeafdb2ad01664c29e2d4053a305493bdedc8e91612ab25f1d36ad2f95b0dad6') + version('3.74', sha256='4d0c9a165a1031860d4853d7084b8fe4627f0004861e6070927d3b6c594af889') + + patch('fastdb-fmax-fmin.patch') + + def install(self, spec, prefix): + make('PREFIX=%s' % prefix, 'install') |