Boost Bindings is a bindings library (not just) for Boost.Ublas. It offers an easy way of calling BLAS, LAPACK, UMFPACK, MUMPS and many other mature legacy numerical codes from within C++.
This library was mainly written by Kresimir Fresl and others a few years back, and has since languished in dark corners of version control systems. Many people (including myself) posted improvements, some got integrated, others got silently dropped on the floor.
This here is my contribution to keeping the bindings alive: I try to collect contributions and roll them into downloadable releases, in the hope of making the library more accessible to potential users. Previously, all I did was make snapshot releases of the current state of CVS; this has changed. The most recent release includes significant updates scavenged from the Boost.Ublas mailing list, see the version control browser below for details.
(Disclaimer: Though I have contributed to the library, it is mostly other people’s work that I rerelease here.)
Download ready-made releases. Check out of version control:
git clone http://git.tiker.net/trees/boost-numeric-bindings.git
Browse the current git tree.
Download the archive, then type the following commands into your shell:
$ tar xvfz /where/to/you/downloaded/it/boost-numeric-bindings-NNNNNNNN-.tar.gz
$ cd boost-numeric-bindings
$ ./configure --prefix=/where/you/want/to/install/it
$ make install
Then, when compiling your boost-numeric-bindings-dependent software, do that with
$ c++ -I/where/you/want/to/install/it/include/boost-numeric-bindings
or, for, previous versions:
$ c++ -I/where/you/want/to/install/it/include/boost-bindings
Is there a binding for Intel MKL or am I just missing something? Quite strange how such well-known math library isnt one of them?
That said, if you’re feeling a pressing need for something in the MKL, I’m sure your contribution would be more than welcome.
Andreas
Hi,
I’m using gels, gelss and gelsd of bindings-20080816 to solve least squares problems and I noticed typename is missing.
boost/numeric/bindings/lapack/gels.hpp
Line 151
+ typename MatrA::value_type work;
Line 180
+ traits::detail::array<typename MatrA::value_type> work(work_size);
Line 197
+ traits::detail::array<typename MatrA::value_type> work(minmn + std::max(1, maxdim));
boost/numeric/bindings/lapack/gelss.hpp
Line 81, 123, 191, 246, 266
+ typedef typename traits::type_traits<val_t>::real_type real_t;
boost/numeric/bindings/lapack/gelsd.hpp
Line 86, 136, 217, 282, 310, 405
+ typedef typename traits::type_traits<val_t>::real_type real_t;
Cheers,
Naoki
Applied, thanks!
Andreas
Hi I seem to be doing something wrong here. Here is the code I’m trying to run:
I try to compile with the following command:
and I get the following error message:
I see that a previous posts had a similar problem with seems related to clapack but I’m using regular lapack Any thoughts?
Thanks K
[Edited for markup and brevity —Andreas]
You need to link with lapack,
-llapack, plus any flags libraries that your lapack requires. Likely, that’ll be-lf77blas -latlasor some such.I guess it’s time for a dumb question. I’m really green on the subject so please forgive me, but is there any information on how to install the library? K
I’ve written something in the main page text.
Hope that helps, Andreas
Hello,
I’m using the Bindings library in a large project to bind standard BLAS implementations to our own data types. We’re using traits definitions for this and I just noticed that there are some checks missing for the BOOST_NUMERIC_POOR_MANS_TRAITS define in blas/blas1.hpp for the functions dotu and dotc.
Here’s a quick svn diff for my fix to this.
Cheers Roel
===================================================================
—- blas/blas1.hpp (revision 47501)
+++ blas/blas1.hpp (working copy)
@@ -130,7 +130,13 @@
#endif
assert( traits::vector_size( x ) == traits::vector_size( y ) ) ;
- typedef typename vector_type_x::value_type value_type ;
+ typedef
+#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
+ typename traits::vector_traits< vector_type_x >::value_type
+#else
+ typename vector_type_x::value_type
+#endif
+ value_type ;
const int n = traits::vector_size( x ) ;
const int stride_x = traits::vector_stride( x ) ;
@@ -159,7 +165,13 @@
#endif
assert( traits::vector_size( x ) == traits::vector_size( y ) ) ;
- typedef typename vector_type_x::value_type value_type ;
+ typedef
+#ifndef BOOST_NUMERIC_BINDINGS_POOR_MANS_TRAITS
+ typename traits::vector_traits< vector_type_x >::value_type
+#else
+ typename vector_type_x::value_type
+#endif
+ value_type ;
const int n = traits::vector_size( x ) ;
const int stride_x = traits::vector_stride( x ) ;
Thanks for making this available, I’ve been using it for some time, appreciate it. Just wanted to point out that the Makefile included in your latest download does not install the .h header files (e.g. boost/numeric/bindings/lapack/lapack.h), only the .hpp files. So it’s still necessary to copy the files over manually to install.
Cheers.
www.indii.org
Fixed a while ago—thanks for reporthing this.
hi, thanks to the person who put these bindings together. you say that this will not work with boost_1_34 and older. i google searched for boost 1.35 and did not find it. could someone pls help?
ps: here’s the problem i have:
installed atlas version 3.6.0-20.6. /usr/lib/atlas3-test runs just fine. header cblas.h and clapack.h are in /usr/include/ which is by default in my include path. i therefore changed and to and in cblas_inc.hpp and clapack_inc.hpp, respectively.
i’m trying to run the program:
i get the error
edited for formatting —Andreas
CLAPACK is different from regular LAPACK. If you want it, you need a CLAPACK implementation, regular -llapack will not do the trick.
I’d advise you to stick with regular (Fortran) lapack, though.
Hello there,
I am planning to use that binding libraries for uBLAS for a project of mine. I am setting up an automatic configuration, and I find it easier to get the files from the CVS for I can then easily request specific versions or dates and stay on the top of it. So I would like to know the status of the boost sandbox cvs compared to the archive linked from your blog? Are they going to be kept in synch? If not, have you already incorporated changes in that archive compared to the code on the CVS? If I may voice my opinion, it seems to me it would be better to keep the CVS up-to-date…
That binding looks really mature indeed and I am looking forward to be using it. How would I cite your and your fellow collaborators work by the by? My project is an academic project, you see…
Thank you very much,
Best wishes,
Luc
These bindings are strictly CVS snapshots, there is no “magical sauce” added. I intend to keep them in sync if major things happen in the bindings. My main purpose in pushing out these snapshots is to facilitate the use of PyLinear.
The main work on this was definitely done by Kresimir Fresl, but you should be able to extract all credits by looking at each file’s copyright notice.
Best, Andreas
This is not 100% true any more, see page text.
Post new comment