Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2006-04-02 09:16:00


Hi Shawn,

On Monday, 20. March 2006 21:56, Shawn D. Pautz wrote:
> I asked this question on a previous occasion and got no response. How
> does one compile against ublas with an "unsupported" compiler, assuming
> that the compiler has no problems with the source code itself? In
> ublas/detail/config.hpp are the following lines:
>
> // Cannot continue with an unsupported compiler
> #ifdef BOOST_UBLAS_UNSUPPORTED_COMPILER
> #error Your compiler is unsupported by this verions of uBLAS. Boost
> 1.32.0 includes uBLAS with support for many old compilers.
> #endif
>
> I'm trying to compile with the PGI compiler, and the above lines halt
> the compilation. If I disable them by commenting them out I am able to
> compile normally and produce a valid executable; my compiler works.

This is odd. The full test in config.hpp is:

// Detect other compilers with serious defects
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STDC_NAMESPACE)
#define BOOST_UBLAS_UNSUPPORTED_COMPILER
#endif

// Cannot continue with an unsupported compiler
#ifdef BOOST_UBLAS_UNSUPPORTED_COMPILER
#error Your compiler is unsupported by this verions of uBLAS. Boost 1.32.0 includes uBLAS with support for many old compilers.
#endif

In your case BOOST_UBLAS_UNSUPPORTED_COMPILER should only be defined because one of the other serious defect macros has been defined. These get defined by the appropriate Boost/Config compiler headers. Have a look in "boost/config/compiler". It could be that the header is incorrectly flagging your compiler as buggy because an older version had such a bug.

The best fix would be to find out which defect macro is being set and if this bug still applies to your compiler. If not the Boost /Config could be fixed.

> Is
> there a preprocessor definition I can use on my compile line to disable
> the above lines so that I don't have to modify ublas source code?

I can't think of a way to do this with the current logic. The following would be a general fix:

// Detect other compilers with serious defects - override by defineing BOOST_UBLAS_UNSUPPORTED_COMPILER=0
#ifndef BOOST_UBLAS_UNSUPPORTED_COMPILER
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STDC_NAMESPACE)
#define BOOST_UBLAS_UNSUPPORTED_COMPILER
#endif
#endif

// Cannot continue with an unsupported compiler
#if defined(BOOST_UBLAS_UNSUPPORTED_COMPILER) && (BOOST_UBLAS_UNSUPPORTED_COMPILER != 0)
#error Your compiler is unsupported by this verions of uBLAS. Boost 1.32.0 includes uBLAS with support for many old compilers.
#endif

What do you think?

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________