Boost logo

Boost :

Subject: Re: [boost] mkl+boost problems
From: Andrey Asadchev (asadchev_at_[hidden])
Date: 2010-11-09 11:14:53


On Tue, Nov 9, 2010 at 5:20 AM, Thomas Klimpel
<Thomas.Klimpel_at_[hidden]> wrote:
> Andrey Asadchev wrote:
>> This P4 variable creates havoc of MPL templates which have P4 template
>> parameters names.
>>
>> What to do?
>
> I think mkl-10.0.3 was the last version that had this problem. The later versions mkl-10.0.4, mkl-10.1.x and mkl-10.2.x no longer define these constants. So there is no need to fill an additional bug report to Intel.
>
> Because the "numeric_bindings" use MPL, and you proposed extensions <http://lists.boost.org/MailArchives/ublas/2010/07/4480.php> to them some time ago, I have the impression that you might be using the "numeric_bindings"" interface to cblas. Even so the "numeric_bindings" are also tested with mkl, I have to admit that I tested the cblas interface only with atlas, not with mkl. So I didn't notice that you are forced to include both the headers from the "numeric_bindings" and "mkl_cblas.h" in the same source file. However, fixing this is not high on my priority list.
>
> Regards,
> Thomas
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

Hi Tomas

My fix is:

#ifndef BOOST_NUMERIC_BINDINGS_CBLAS_INC_H
#define BOOST_NUMERIC_BINDINGS_CBLAS_INC_H

extern "C" {

#ifdef BOOST_NUMERIC_BINDINGS_MKL
#include <mkl_cblas.h>
#include <mkl_service.h>
#undef P4 // mkl_types.h defines P4 macro which breaks MPL
#else
#include <cblas.h>
#endif

}

#endif


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk