Re: [Monotone-devel] heads up on nvm.stripped

2009-01-16 Thread Lapo Luchini
Markus Wanner wrote:
 Hi,
 
 Lapo Luchini wrote:
 Markus Wanner wrote:
 nvm.stripped now compiles fine and passes all tests again.
 Tested and fully working (All 3 test suites passed) on FreeBSD-7:
 
 That is 7.0, not 7.1, I guess, right?

Right, but wouldn't be much different (mtn doesn't rely on many
base-system libraries, and the ports are the ports are the ports - i.e.
always the same for every revision).

I'll update it to 7.1 soon, anyways.

 Though, I'm wondering: I get a failure during compile time for lua (or
 was it botan?), because it's pkg-config is missing and it got installed
 under /usr/local.
 
 Any flags you did set to run configure with?

Ah, yes, I used this one:

nice sh -c 'SHELL=/bin/sh ; autoreconf -i 
CXXFLAGS=-I/usr/local/include LUA_CFLAGS=-I/usr/local/include/lua51
LUA_LIBS=-llua-5.1 LDFLAGS=-L/usr/local/lib ./configure  gmake'

Actually lua installs a .pc for pkg-config, but it's versioned:
% pkg_info -L lua-5.1.3_3|fgrep .pc
/usr/local/libdata/pkgconfig/lua-5.1.pc

I think using flags is easier. And when I will do the port I could
automatically copy the detected version's flags to configure's flags.
(would it accept 5.0 or only 5.1?)

-- 
Lapo Luchini - http://lapo.it/

“I think I can safely say that nobody understands quantum mechanics.”
(Richard Feynman, 1965)


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] heads up on nvm.stripped

2009-01-16 Thread Markus Wanner
Hi,

Lapo Luchini wrote:
 Right, but wouldn't be much different (mtn doesn't rely on many
 base-system libraries, and the ports are the ports are the ports - i.e.
 always the same for every revision).

Oh, good, thanks.

 nice sh -c 'SHELL=/bin/sh ; autoreconf -i 
 CXXFLAGS=-I/usr/local/include LUA_CFLAGS=-I/usr/local/include/lua51
 LUA_LIBS=-llua-5.1 LDFLAGS=-L/usr/local/lib ./configure  gmake'

Aha, so it was lua, which posed some problems.

What's the purpose of SHELL=/bin/sh?  Is that required if there's
already a 'configure' (i.e. as in the tarball)?

 Actually lua installs a .pc for pkg-config, but it's versioned:
 % pkg_info -L lua-5.1.3_3|fgrep .pc
 /usr/local/libdata/pkgconfig/lua-5.1.pc

Hm.. on Debian it's just lua5.1. Strange.

However, it's simple enough to teach the lua.m4 script. Done in
2a7c7d45284e1eedee141f5627f612a954c6eb9d.

I've successfully compiled mtn on FreeBSD 6.4:

 Running on  : FreeBSD 6.4-RELEASE-p1 FreeBSD 6.4-RELEASE-p1 #0: Sun 
 Dec 21 07:56:41 UTC 2008 
 r...@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
 C++ compiler: GNU C++ version 3.4.6 [FreeBSD] 20060305
 C++ standard library: GNU libstdc++ version 20060311
 Boost version   : 1_34_1
 SQLite version  : 3.6.4 (compiled against 3.6.4)
 Lua version : Lua 5.1
 PCRE version: 7.8 2008-09-05 (compiled against 7.8)
 Botan version   : 1.6.5 (compiled against 1.6.5)

..it's running make check just now.

 I think using flags is easier.

Not having to use flags is even easier, no?

 And when I will do the port I could
 automatically copy the detected version's flags to configure's flags.
 (would it accept 5.0 or only 5.1?)

Only 5.1.

Having a monotone ports package for FreeBSD would be great! And along
the way, update botan's port to 1.8.x as well... :-)

Regards

Markus Wanner


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] heads up on nvm.stripped

2008-11-13 Thread Markus Wanner
Hi,

Jack Lloyd wrote:
 I've attached a patch for sha1.cc demoing the new benchmark code.

Very cool, thank you. FYI, my Core (1) Duo reports:

mtn: Benchmarking botan's SHA-1 core
mtn: SHA-1 provider 'core': 117.172 MiB/s
mtn: SHA-1 provider 'ia32': 135.325 MiB/s

 For
 informative purposes only, since it currently only works on an
 unreleased version (future 1.7.22, nrb head), and API-wise things are
 still in flux in this area.

That's fine.

I fear the #ifdef's are not quite enough. We'd have to check for the
botan version dynamically. So I'd say we better wait a bit until that
API stabilizes.

 In the future it may be useful to extend Monotone to run a quick test
 and then choose the fastest SHA-1 provider to use for the rest of the
 program run. 20 milliseconds of benchmark time at startup could pay
 for itself quickly in many cases.

..or even store the setting in _MTN/options because such a benchmark
might not pay-off every time mtn is invoked. Alternatively have it
stored in monotonerc and set as a system config during installation of
monotone. Storing in _MTN/options sounds easier to automate, so I'm
currently favoring that variant.

Regards

Markus Wanner



___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] heads up on nvm.stripped

2008-11-12 Thread Jack Lloyd
On Wed, Nov 12, 2008 at 07:19:06PM +0100, Markus Wanner wrote:

 It rather looks like botan offers something similar to benchmark
 various sha1 engines. I didn't look into that, though, but don't
 think we need to duplicate that work.

I've attached a patch for sha1.cc demoing the new benchmark code. For
informative purposes only, since it currently only works on an
unreleased version (future 1.7.22, nrb head), and API-wise things are
still in flux in this area.

In the future it may be useful to extend Monotone to run a quick test
and then choose the fastest SHA-1 provider to use for the rest of the
program run. 20 milliseconds of benchmark time at startup could pay
for itself quickly in many cases.

-Jack

$ ./mtn version --full
monotone 0.41 (base revision: c18c4c9d2fbcdaaf08fb448837b778e6f30968a6)
Running on  : Linux 2.6.27-gentoo-3 #5 SMP Thu Oct 16 15:40:05 EDT 2008 
x86_64
C++ compiler: GNU C++ version 4.3.2
C++ standard library: GNU libstdc++ version 20080827
Boost version   : 1_35
SQLite version  : 3.5.9 (compiled against 3.5.9)
Lua version : Lua 5.1
PCRE version: 7.8 2008-09-05 (compiled against 7.8)
Botan version   : 1.7.22 (compiled against 1.7.22)
Changes since base revision:
unknown

$ ./mtn benchmark_sha1
mtn: Benchmarking botan's SHA-1 core
mtn: SHA-1 provider 'amd64': 213.701 MiB/s
mtn: SHA-1 provider 'core': 212.217 MiB/s
mtn: SHA-1 provider 'openssl': 338.027 MiB/s
mtn: SHA-1 provider 'sse2': 297.789 MiB/s
#
# old_revision [c18c4c9d2fbcdaaf08fb448837b778e6f30968a6]
#
# patch sha1.cc
#  from [5b5488b7d19a740f70bae5d82c709c9549c5f38d]
#to [043d71e9c34c20fb8b0a6e901a1cfb779a26656b]
#

--- sha1.cc 5b5488b7d19a740f70bae5d82c709c9549c5f38d
+++ sha1.cc 043d71e9c34c20fb8b0a6e901a1cfb779a26656b
@@ -14,6 +14,29 @@
 #include botan/botan.h
 #include botan/sha160.h
 
+#if BOTAN_VERSION_CODE = BOTAN_VERSION_CODE_FOR(1,7,22)
+  #include botan/libstate.h
+  #include botan/benchmark.h
+
+  // Choose a timer implementation
+  #if defined(BOTAN_HAS_TIMER_POSIX)
+#include botan/tm_posix.h
+typedef Botan::POSIX_Timer benchmark_timer_class;
+  #elif defined(BOTAN_HAS_TIMER_UNIX)
+#include botan/tm_unix.h
+typedef Botan::Unix_Timer benchmark_timer_class;
+  #elif defined(BOTAN_HAS_TIMER_WIN32)
+#include botan/tm_win32.h
+typedef Botan::Win32_Timer benchmark_timer_class;
+  #elif
+/* This uses ANSI clock and gives somewhat bogus results
+   due to the poor resolution
+*/
+typedef Botan::Timer benchmark_timer_class;
+  #endif
+
+#endif
+
 #include sanity.hh
 #include ui.hh
 #include platform.hh
@@ -28,6 +51,25 @@ CMD_HIDDEN(benchmark_sha1, benchmark_sh
options::opts::none)
 {
   P(F(Benchmarking botan's SHA-1 core));
+
+#if BOTAN_VERSION_CODE = BOTAN_VERSION_CODE_FOR(1,7,22)
+  benchmark_timer_class timer;
+  Botan::AutoSeeded_RNG rng;
+  Botan::Algorithm_Factory af =
+Botan::global_state().algorithm_factory();
+
+  const int milliseconds = 5000;
+
+  std::mapstd::string, double results =
+Botan::algorithm_benchmark(SHA-1,  milliseconds, timer, rng, af);
+
+  for(std::mapstd::string, double::const_iterator i = results.begin();
+  i != results.end(); ++i)
+{
+  P(F(SHA-1 provider '%s': %s MiB/s) % i-first % i-second);
+}
+
+#else
   int mebibytes = 100;
   string test_str(mebibytes  20, 'a');
   data test_data(test_str);
@@ -37,6 +79,7 @@ CMD_HIDDEN(benchmark_sha1, benchmark_sh
   double end = cpu_now();
   double mebibytes_per_sec = mebibytes / (end - start);
   P(F(%s MiB/s) % mebibytes_per_sec);
+#endif
 }
 
___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


[Monotone-devel] heads up on nvm.stripped

2008-11-12 Thread Markus Wanner
Hi,

I've upgraded and tested nvm.stripped with the recently announced botan
1.7.21 and SQLite 3.6.5.

The code to switch sha1 engines within monotone caused problems with the
newer botan release. As we do not use that code anywhere except for the
benchmark_sha1 command, I've simply removed it. It rather looks like
botan offers something similar to benchmark various sha1 engines. I
didn't look into that, though, but don't think we need to duplicate that
work.

nvm.stripped now compiles fine and passes all tests again.

Regards

Markus Wanner



monotone 0.41 (base revision: c18c4c9d2fbcdaaf08fb448837b778e6f30968a6)
Running on  : Linux 2.6.24-rc7-cametha #1 SMP Mon Jan 14
15:31:35 CET 2008 i686
C++ compiler: GNU C++ version 4.3.2
C++ standard library: GNU libstdc++ version 20080905
Boost version   : 1_34_1
SQLite version  : 3.6.5 (compiled against 3.6.5)
Lua version : Lua 5.1
PCRE version: 7.6 2008-01-28 (compiled against 7.6)
Botan version   : 1.7.21 (compiled against 1.7.21)


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel