[overture] Compilation error for CG

  • From: "Ghosh, Debojyoti" <ghosh@xxxxxxx>
  • To: "overture@xxxxxxxxxxxxx" <overture@xxxxxxxxxxxxx>
  • Date: Fri, 14 Feb 2014 19:53:56 +0000

Hi,

I built Overture successfully, but while compiling CG, I get errors.

Error:
g++ -fPIC -g -w -I/home/ghosh/Software/overture/serial/cg.v25/common/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/shared 
-I/home/ghosh/Software/overture/serial/cg.v25/common/moving/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/multiComponent/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/chemistry 
-I/home/ghosh/Software/overture/serial/cg.v25/common/dataBase 
-I/home/ghosh/Software/overture/serial/cg.v25/src 
-I/home/ghosh/Software/overture/serial/Overture.v25/include 
-I/home/ghosh/Software/A++P++-0.8.0/A++/install/include  
-I/home/ghosh/Software/hdf5-1.8.8_serial/include  -I/usr/include   -o 
/home/ghosh/Software/overture/serial/Overture.v25/cg.v25/common/obj/errors.o -c 
src/errors.C
src/errors.C: In member function ‘virtual void 
DomainSolver::determineErrors(realCompositeGridFunction&, 
realMappedGridFunction**, const real&, int, RealArray&, const aString&)’:
src/errors.C:132:15: error: redeclaration of ‘aString norm’
       aString norm;
               ^
src/errors.C:116:14: error: ‘int norm’ previously declared here
     for( int norm=0; norm<numberOfNormsToPrint; norm++ )

I changed variable “norm” of type aString in line 132 of common/src/errors.C to 
“normstring” (and in the lines just after, where this variable is being used) 
to fix this. I know that some compilers restrict the declaration of a loop 
counter variable to within that loop (ie. for (int i=0;… ) { do this } to 
within the “do this” loop), so am I missing some flag here? Or does the latest 
g++ compilers not allow this anymore?


Error:
g++ -fPIC -g -w -I/home/ghosh/Software/overture/serial/cg.v25/common/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/shared 
-I/home/ghosh/Software/overture/serial/cg.v25/common/moving/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/multiComponent/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/chemistry 
-I/home/ghosh/Software/overture/serial/cg.v25/common/dataBase 
-I/home/ghosh/Software/overture/serial/cg.v25/src 
-I/home/ghosh/Software/overture/serial/Overture.v25/include 
-I/home/ghosh/Software/A++P++-0.8.0/A++/install/include  
-I/home/ghosh/Software/hdf5-1.8.8_serial/include  -I/usr/include   -o 
/home/ghosh/Software/overture/serial/Overture.v25/cg.v25/common/obj/userDefinedKnownSolution.o
 -c src/userDefinedKnownSolution.C
src/userDefinedKnownSolution.C: In member function ‘virtual int 
Parameters::getUserDefinedKnownSolution(real, CompositeGrid&, int, realArray&, 
const Index&, const Index&, const Index&)’:
src/userDefinedKnownSolution.C:509:24: error: cannot pass objects of 
non-trivially-copyable type ‘const class aString’ through ‘...’
       userKnownSolution);
                        ^
make[1]: *** 
[/home/ghosh/Software/overture/serial/Overture.v25/cg.v25/common/obj/userDefinedKnownSolution.o]
 Error 1

Replacing userKnownSolution by userDefinedKnownSolution seems to fix this 
error, but I get a similar error later on:

g++ -fPIC -g -w -I./src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/shared 
-I/home/ghosh/Software/overture/serial/cg.v25/common/moving/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/multiComponent/src 
-I/home/ghosh/Software/overture/serial/cg.v25/common/chemistry 
-I/home/ghosh/Software/overture/serial/cg.v25/common/dataBase 
-I/home/ghosh/Software/overture/serial/cg.v25/src 
-I/home/ghosh/Software/overture/serial/Overture.v25/include 
-I/home/ghosh/Software/A++P++-0.8.0/A++/install/include  
-I/home/ghosh/Software/hdf5-1.8.8_serial/include  -I/usr/include   -o 
/home/ghosh/Software/overture/serial/Overture.v25/cg.v25/asf/obj/asfp.o -c 
src/asfp.C
src/asfp.C: In member function ‘virtual void 
Cgasf::solveForAllSpeedPressure(real, real, const real&)’:
src/asfp.C:851:76: error: cannot pass objects of non-trivially-copyable type 
‘std::map<int, aString>::mapped_type {aka class aString}’ through ‘...’
                 parameters.bcNames[cg[grid].boundaryCondition()(side,axis)]);
                                                                            ^
src/asfp.C: In member function ‘virtual void 
Cgasf::solveForTimeIndependentVariables(GridFunction&, bool)’:
src/asfp.C:1337:80: error: cannot pass objects of non-trivially-copyable type 
‘std::map<int, aString>::mapped_type {aka class aString}’ through ‘...’
                     
parameters.bcNames[cg[grid].boundaryCondition()(side,axis)]);
                                                                                
^
src/asfp.C:1517:80: error: cannot pass objects of non-trivially-copyable type 
‘std::map<int, aString>::mapped_type {aka class aString}’ through ‘...’
                     
parameters.bcNames[cg[grid].boundaryCondition()(side,axis)]);
                                                                                
^
make[1]: *** 
[/home/ghosh/Software/overture/serial/Overture.v25/cg.v25/asf/obj/asfp.o] Error 
1

How can I fix this?

Thanks,
Debo

--
Debojyoti Ghosh
ghosh@xxxxxxxxxxx<mailto:ghosh@xxxxxxxxxxx>
http://www.mcs.anl.gov/~ghosh



Other related posts: