compiling with "unsupported" compilers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

compiling with "unsupported" compilers

Shawn D. Pautz
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.  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?

--
Shawn D. Pautz
Radiation Transport Department, MS 1179
Sandia National Laboratories
P.O. Box 5800
Albuquerque, NM 87185
Phone: 505-284-4291
Fax: 505-844-0092
E-Mail: [hidden email]


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Reply | Threaded
Open this post in threaded view
|

Re: compiling with "unsupported" compilers

Gunter Winkler
On Monday 20 March 2006 21:56, Shawn D. Pautz wrote:
> 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.  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?

If you are able to run all ublas tests. Some one should add your compiler to
config.hpp. There are a lot of #ifdefs checking for unsupportet compilers.
Can you figure out what define boost uses?
(similar to BOOST_MSVC, BOOST_INTEL, ...)

Is one of these macros defined?

// 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

mfg
Gunter
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Reply | Threaded
Open this post in threaded view
|

Re: compiling with "unsupported" compilers

Michael Stevens-5
In reply to this post by Shawn D. Pautz
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
___________________________________
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas