Hi Wolfgang and Khalid

Wolfgang, you were correct. The problem lies in the latest gcc 4.5 version 
(4.5.0 20100107 (experimental) (GCC))  released by  
http://sourceforge.net/projects/hpc/. I took the code snippet you sent me and 
ran it on the numerous gcc compilers one seems to accumulate when one uses a 
mac. The results are shown below. To summarise: 
The following gcc versions work fine for compiling the code snippet:
        gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)
        gcc version 4.3.3 (GCC) 
        gcc version 4.5.0 20090910 (experimental) (GCC).
But the latest 4.5 version from hpc fails, i.e.
        gcc version 4.5.0 20100107 (experimental) (GCC)
fails.

Now, gcc version 4.2.1 (Apple Inc. build 5646) (dot 1) and  gcc version 4.3.3 
(GCC) are no help as they will produce the cast errors that arose previously. 
The gcc version 4.5.0 20090910 (experimental) (GCC) works fine. I've just 
compiled deal.II  without problems and step-6 runs as it should.

This mac related compiler issue is quite frustrating. I'm looking into using 
gcc from Macports to see if this is not truer to the linux version (it should 
be). I will let you know what comes from this. Perhaps, there are some other 
mac users that use macports that can help with this? It would be good to use a 
stable release of gcc like 4.4 rather than the experimental 4.5. (have a look 
at http://www.macports.org/ports.php?by=name&substr=gcc for all the supported 
gcc releases on macports).

Khalid, I think you should lodge a bug report with the developers of the hpc 
gcc (or maybe it's simply a gcc 4.5.latest problem?). If the macports version 
of gcc works fine then use this, otherwise I'm not sure what to suggest as a 
short term solution. You probably can't get hold of gcc version 4.5.0 20090910 
(experimental) (GCC) any more.

Regards
Andrew
        

%%% output of compiling code snippet using various compiler
ibz2-02:Documents andrewmcbride$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1~2/src/configure --disable-checking 
--enable-werror --prefix=/usr --mandir=/share/man 
--enable-languages=c,objc,c++,obj-c++ 
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib 
--build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 
--program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 
--target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)
ibz2-02:Documents andrewmcbride$ g++ deal_test.cc 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.5/usr/local/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/Users/andrewmcbride/lib/gcc-4.5/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/Users/andrewmcbride/lib/gcc-4.5/usr/local/bin/../libexec/gcc/x86_64-apple-darwin10/4.5.0/lto-wrapper
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.5-20100107/configure --enable-languages=fortran 
--host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 : (reconfigured) 
../gcc-4.5-20100107/configure --enable-languages=fortran,c++ 
--host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10
Thread model: posix
gcc version 4.5.0 20100107 (experimental) (GCC) 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.5/usr/local/bin/g++ deal_test.cc 
deal_test.cc: In member function ‘void dealii::X<dim, spacedim>::f() [with int 
dim = 2, int spacedim = 2]’:
deal_test.cc:20:18:   instantiated from here
deal_test.cc:16:4: error: no type named ‘ScalarView’ in ‘struct 
dealii::FEValuesViews::Scalar<2, 2>’
deal_test.cc:16:4: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.
gcc-4.3.3/ gcc-4.5/   
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.3.3/
bin/     include/ info/    lib/     libexec/ man/     share/   
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.3.3/bin/
c++                           gcc                           gfortran            
          i686-apple-darwin9-gcc
cpp                           gccbug                        
i686-apple-darwin9-c++        i686-apple-darwin9-gcc-4.3.3
g++                           gcov                          
i686-apple-darwin9-g++        i686-apple-darwin9-gfortran
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.3.3/bin/g++ -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: ../gcc-4.3.3/configure --prefix=/opt/gcc-4.3.3 
--build=i686-apple-darwin9
Thread model: posix
gcc version 4.3.3 (GCC) 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc-4.3.3/bin/g++ deal_test.cc 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc_snwleo/usr/local/bin/g++ -v
Using built-in specs.
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.5-20090910/configure --enable-languages=fortran,c++ 
--host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10
Thread model: posix
gcc version 4.5.0 20090910 (experimental) (GCC) 
ibz2-02:Documents andrewmcbride$ ~/lib/gcc_snwleo/usr/local/bin/g++ 
deal_test.cc 

Am 05 Apr 2010 um 5:45 AM schrieb khalid ashraf:

> I also got the same error message as Andrew did when I tried to compile with 
> gcc4.5 
> referred by Luca. I think Andrew is facing the same problem now as I did. 
> Please 
> let us know if you find a solution.
> 
> Thanks.
> 
> Khalid
> 
> From: Andrew McBride <[email protected]>
> To: Wolfgang Bangerth <[email protected]>
> Cc: khalid ashraf <[email protected]>; [email protected]
> Sent: Sun, April 4, 2010 9:32:19 AM
> Subject: Re: [deal.II] Exception on processing: std::bad_cast
> 
> Hi all,
> 
> Yes it looks like a similar problem to what was discussed previously and that 
> was settled with changing the compiler to the 4.5 experimental as suggested 
> by Luca. 
> 
> In an attempt to see if I could help, I updated my version of deal.II to the 
> latest and downloaded the latest version of the hpc compiler that Luca 
> suggested previously (and that was working fine) from 
> http://sourceforge.net/projects/hpc/ (i see that gcc was updated on Jan 15 
> 2010) 
> When I try and compile deal.II now I get the following error:
> 
> =====deal.II====1d====debug======MT== fe/fe_values.cc
> source/fe/fe_values.cc: In constructor 
> ‘dealii::internal::FEValuesViews::Cache<dim, spacedim>::Cache(const 
> dealii::FEValuesBase<dim, spacedim>&) [with int dim = 1, int spacedim = 1]’:
> source/fe/fe_values.cc:1486:31:  instantiated from ‘dealii::FEValuesBase<dim, 
> spacedim>::FEValuesBase(unsigned int, unsigned int, dealii::UpdateFlags, 
> const dealii::Mapping<dim, spacedim>&, const dealii::FiniteElement<dim, 
> spacedim>&) [with int dim = 1, int spacedim = 1]’
> source/fe/fe_values.cc:3941:16:  instantiated from here
> source/fe/fe_values.cc:1057:4: error: no type named ‘ScalarView’ in ‘class 
> dealii::FEValuesViews::Scalar<1>’
> source/fe/fe_values.cc:1057:4: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> 
> I know this is not the problem Khalid is referring to, but it is related to 
> mac compiling issues. I will have a look at Khalid's problem as soon as I 
> have a working deal.II again :)
> 
> Kind regards
> Andrew
> 
> Am 04 Apr 2010 um 5:14 PM schrieb Wolfgang Bangerth:
> 
> > 
> >> my compiler version is gcc 4.2.1
> >> sofar tredd the following things
> >> 1. tried the 4.5 version referred in previous mail, but it seems to
> >> cause other compilation errors. 2. Changed dynamic_cast to static_cast
> >> in fe_system.cc but still get the same exception. I wonder why it
> >> doesn't give a reference to the file or line number from where the
> >> exception is being thrown.
> > 
> > To me this all sounds like an installation problem with the compiler. 
> > Nobody seems to have had this problem before.
> > 
> > Maybe one of our Mac people can help, who knows.
> > 
> > W>
> > 
> > -- 
> > -------------------------------------------------------------------------
> > Wolfgang Bangerth                email:            [email protected]
> >                                www: http://www.math.tamu.edu/~bangerth/
> > 
> > _______________________________________________
> > dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
> 
> 
> 

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to