[Fwd: gcc bug...compiling mindseye]

Praedor Tempus praedor@uswest.net
Wed Jun 7 09:04:00 GMT 2000


-------- Original Message --------
Subject: gcc bug...compiling mindseye
Date: Tue, 06 Jun 2000 16:00:23 -0600
From: Praedor Tempus <praedor@uswest.net>
To: gcc-bugs@gcc.gnu.org

Trying to compile mindseye-cvs20000226 acquired from:

https://sourceforge.net/project/?group_id=2220

I got a message about an internal compiler error.  Then
ran "make --debug mindseye" and got this relevant to the
offending code:

... Considering target file `s_nurbscurve.o'.
     File `s_nurbscurve.o' does not exist.
     Looking for an implicit rule for `s_nurbscurve.o'.
     Trying pattern rule with stem `s_nurbscurve'.
     Trying implicit dependency `s_nurbscurve.c'.
     Trying pattern rule with stem `s_nurbscurve'.
     Trying implicit dependency `s_nurbscurve.cc'.
     Trying pattern rule with stem `s_nurbscurve'.
     Trying implicit dependency `s_nurbscurve.C'.
     Trying pattern rule with stem `s_nurbscurve'.
     Trying implicit dependency `s_nurbscurve.cpp'.
     Found an implicit rule for `s_nurbscurve.o'.
      Considering target file `s_nurbscurve.cpp'.
       Looking for an implicit rule for `s_nurbscurve.cpp'.
       Trying pattern rule with stem `s_nurbscurve.cpp'.
       Trying implicit dependency `s_nurbscurve.cpp,v'.
       Trying pattern rule with stem `s_nurbscurve.cpp'.
       Trying implicit dependency `RCS/s_nurbscurve.cpp,v'.
       Trying pattern rule with stem `s_nurbscurve.cpp'.
       Trying implicit dependency `RCS/s_nurbscurve.cpp'.
       Trying pattern rule with stem `s_nurbscurve.cpp'.
       Trying implicit dependency `s.s_nurbscurve.cpp'.
       Trying pattern rule with stem `s_nurbscurve.cpp'.
       Trying implicit dependency `SCCS/s.s_nurbscurve.cpp'.
       No implicit rule found for `s_nurbscurve.cpp'.
       Finished dependencies of target file `s_nurbscurve.cpp'.
      No need to remake target `s_nurbscurve.cpp'.
     Finished dependencies of target file `s_nurbscurve.o'.
    Must remake target `s_nurbscurve.o'.
c++ -c -g -O2 -I../.. -I../../include  -I/usr/X11R6/include
-I/usr/local/include -I/usr/loc
al/include/nurbs++ -I../ -DHAVE_CONFIG_H -fno-implicit-templates
s_nurbscurve.cpp
Live child 0x080727f8 PID 11742
s_nurbscurve.cpp: In method `class G3DNurbsCurve &
G3DNurbsCurve::operator =(const PlNurbsCurvef &)':
s_nurbscurve.cpp:389: Internal compiler error.
s_nurbscurve.cpp:389: Please submit a full bug report.
s_nurbscurve.cpp:389: See
<URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for
instructions.
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x080727f8 PID 11742
make[2]: *** [s_nurbscurve.o] Error 1
Removing child 0x080727f8 PID 11742 from chain.
make[2]: Leaving directory
`/home/patrick/mindseye-cvs20000226/src/3dlib'
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x08070858 PID 11738
make[1]: *** [me_subdirs] Error 2
Removing child 0x08070858 PID 11738 from chain.
make[1]: Leaving directory `/home/patrick/mindseye-cvs20000226/src'
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x0806f058 PID 11734
make: *** [mindseye] Error 2
Removing child 0x0806f058 PID 11734 from chains.

I am using gcc-2.95.2, Mandrake 7.1, no options passed (just "make
mindseye"
after "./configure").

patrick
/*
 * Project : "MindsEye, 3D library"
 * Copyright (c) 1995 - 1997. All Rights Reserved.
 * Author(s): P. Lavoie, M. Kuball
 *
 * $Id: s_nurbscurve.cpp,v 1.4 2000/02/22 21:33:24 ainvar Exp $
 *
 *
 * COPYRIGHT
 * =========
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * OVERVIEW
 * ========
 *
 */
#include <stdio.h>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
// #include <qobject.h> // only for ASSERT ()
#include "s_nurbscurve.h"
#include "s_point.h"
#include "pointstuff.h"
#include "camera.h"


GLUnurbsObj *G3DNurbsCurve::NurbsRenderer_    = 0;
float        G3DNurbsCurve::tesselTolerance_  = .1;
bool         G3DNurbsCurve::_classInitialized = false;

G3DNurbsCpolygon::~G3DNurbsCpolygon() {}


void
G3DNurbsCpolygon::shade () const
{
  glBegin(GL_LINE_STRIP);
  //glColor() ;
  for (int i = 0; i < curve.ctrlPnts().n(); ++i)
    glVertex4fv( curve.ctrlPnts()[i].data );  //TODO glVertex3 sufficient here?
  glEnd();
}


//--------------------------------------------------------------

IMPLEMENT_DYN(G3DNurbsCurve, "NURBS_curve")

G3DNurbsCurve::G3DNurbsCurve ( MeFloat ) 
  : PlNurbsCurvef(), G3DNurbs()
{
  if (!_classInitialized) G3DNurbsCurve::initClass ();
  type_ = T_NURBS_CURVE;
  polygon = new G3DNurbsCpolygon (*this);
}

G3DNurbsCurve::G3DNurbsCurve ( const PlNurbsCurvef& nurb ) 
  : PlNurbsCurvef(nurb), G3DNurbs()
{
  if (!_classInitialized) G3DNurbsCurve::initClass ();
  type_ = T_NURBS_CURVE; 
  polygon = new G3DNurbsCpolygon (*this);
  resetBoundingBox ();
}

G3DNurbsCurve::G3DNurbsCurve ( const Vector_HPoint3Df& P1, 
                               const Vector_FLOAT &U1, int degree ) 
  : PlNurbsCurvef(P1,U1,degree), G3DNurbs()
{
  if (!_classInitialized) G3DNurbsCurve::initClass ();
  type_ = T_NURBS_CURVE ;
  polygon = new G3DNurbsCpolygon (*this);
  resetBoundingBox ();
}

G3DNurbsCurve::G3DNurbsCurve ( const G3DNurbsCurve& other ) 
  : PlNurbsCurvef((PlNurbsCurvef)other), G3DNurbs( other )
{
  // ASSERT (_classInitialized);
  polygon = new G3DNurbsCpolygon (*this);
  resetBoundingBox ();
}


void
G3DNurbsCurve::applyTransform ()
{
  if (trafo_)
    {
      cout << "ERROR : G3DNurbsCurve::applyTransform ()" << " not implemented."
           << endl;
      
      /*
        MatrixRT<> T( (const MeFloat*)trafo_ );
        rx *= M_PI/180.0 ;
        ry *= M_PI/180.0 ;
        rz *= M_PI/180.0 ;
        
        MatrixRT<float> T(rx,ry,rz,tx,ty,tz) ;
        MatrixRT<float> Sx ; 
        Sx.scale(sx,sy,sz) ;
        
        transform(T*Sx) ;
        
        tx = ty = tz = rx = ry = rz = 0 ;
        sx = sy = sz = 1 ;
        resetBoundingBox() ;
      */
    }
}


void
G3DNurbsCurve::doAction ( ActionData &action )
{
  switch( action.type )
    {
    case A_SELECT:
      resetKnots(); break;
    }

  G3DNurbs::doAction (action);
}

Field G3DNurbsCurve::FieldList_[4] =
{ {"degree", s_number}, {"knot_vec", m_flt}, {"knot_num", s_number},
  {"cpt_vec", m_vctrlPt}
};

const Field*
G3DNurbsCurve::getFieldList () const
{
  return FieldList_;
}

uint
G3DNurbsCurve::getParameter ( Param *list )
{
  if (list)
    {
      list->number  = deg_ ;
      list++;
      list->fltList = U.memory();
      list++;
      list->number  = U.size();
      list++;
      list->vCtrlPt = &P;
    }
  return 4;
}

G3DObject*
G3DNurbsCurve::getSelectionHandle_ ()
{
  return (new G3DCPoint(P[selectionIndex_], this));
}

int
G3DNurbsCurve::initClass ()
{
  tesselTolerance_ = 0.1;
  NurbsRenderer_ = gluNewNurbsRenderer ();
  if (NurbsRenderer_)
    {
      gluNurbsProperty (NurbsRenderer_, (GLenum)GLU_SAMPLING_TOLERANCE, 40.);
      _classInitialized = true;
      return 1;
    }
  else
    return 0;
}

void
G3DNurbsCurve::modifyPoint( MeFloat u, MeFloat, MeFloat dx, MeFloat dy,
			    MeFloat dz )
{
  Point3Df delta( dx, dy, dz );
  if (u < knot()[0])
    u = knot()[0];
  if (u > knot()[knot().n()-1])
    u = knot()[knot().n()-1];
  movePoint (u, delta);
}

void
G3DNurbsCurve::point ( MeFloat &u, MeFloat&, int pSize, const G3DColor& colorP,
                       int ) const
{
  if( u < U[0] )
    u = U[0] ;
  if( u > U[U.n()-1] )
    u = U[U.n()-1] ;

  glPointSize(pSize) ;
  float color[4];
  color[0] = color[1] = color[2] =  0.0 ;
  color[3] = 1.0 ;
  glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, color );
  //TODO
  //glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, (const float*)colorP );

  glBegin(GL_POINTS);
  glVertex4fv( pointAt(u).data );
  glEnd() ;
}

void
G3DNurbsCurve::resetBoundingBox ()
{
  G3DPoint3d min, max;

  min[0] = extremum (1, coordX);
  min[1] = extremum (1, coordY);
  min[2] = extremum (1, coordZ);
  max[0] = extremum (0, coordX);
  max[1] = extremum (0, coordY);
  max[2] = extremum (0, coordZ);

  bbox_.setTo (min, max);
  if (parent_)
    ((G3DShape*)parent_)->resetBoundingBox ();
}

/*
void G3DNurbsCurve::resetCPoints()
{
  G3DCPoint *tempCP ;

  //TODO set a color attribute to the cpoints group
  cpoints.reset();
  
  if( P.n > 10 )
    cpoints.setJumpSize(int(P.n/10.0)) ;
  else
    cpoints.setJumpSize(int(float(P.n)/2.001 + 1)) ;
    

  for( int i = 0; i < P.n; ++i )
    {
      tempCP = new G3DCPoint( P[i] );
      //tempCP->setObjectColor( cpointColorDefault );
      //tempCP->setCurrentColor(cpointActiveColorDefault) ;
      //if( i == 0 )
      //tempCP->setObjectColor(cpoint0ColorDefault) ;
      cpoints.addShape( tempCP );
    }
}
*/

void G3DNurbsCurve::resetKnots ()
{
  G3DKnot *tempCP ;

  //TODO set a color attribute to the knots group
  knots_.reInitialize();
  /*
  if(P.n()>10)
    knots.setJumpSize(int(P.n/10.0)) ;
  else
    knots.setJumpSize(2) ;
    */

  for (int i = 0; i < U.n(); ++i)
    {
      //calcualte the point on the curve corresponding to knot i
      Point3Df p = pointAt( U[i] );
      // we must represent multiple knots by only 1 point
      // but with a bigger radius (increase radius by 1)
      tempCP = new G3DKnot( p, i, -1 );
      //tempCP->setObjectColor( knots.objectColor );
      //tempCP->setCurrentColor( knots.currentColor );
      //if( i == 0 )
      //tempCP->setObjectColor( cpoint0ColorDefault );
      int psize = 4;
      int j = i;
      while( j < (U.n() - 1) )
	{
	  if( U[j+1] <= U[j] )
	    {
	      ++psize ; ++j ;
	    }
	  else
	    j = U.n() ;
	}
      tempCP->setPsize (psize);
      knots_.push_back (tempCP);
    }
}

MeFloat
G3DNurbsCurve::selectDetails ( const G3DCamera &cam, const G3DRay &ray )
{
  MeFloat rad = 6;
  G3DMatrix mw;
  getWorldTrafo (mw);
  
  selectionIndex_ = findNearestCPointV (cam, ray, mw, P, rad);
  return selectionIndex_ >= 0 ? rad : G3D_INFINITY;
}

void
G3DNurbsCurve::setParameter ( const Param *plist )
{
  if( plist )
    {
      deg_ = plist->number;             ++plist;
      MeFloat *knots = plist->fltList;  ++plist;
      Vector_FLOAT u( knots, plist->number );
      ++plist;
      U  = u;
      delete[] knots;
      
      P   = *plist->vCtrlPt;
      delete plist->vCtrlPt;
      
      resetBoundingBox();
    }
}

void
G3DNurbsCurve::shade ( int ) const
{
  if( NurbsRenderer_ )
    {
      glLineWidth( 2.0 ); 
      GLenum t = GL_MAP1_VERTEX_4;
      gluBeginCurve( NurbsRenderer_ );
      gluNurbsCurve( NurbsRenderer_, U.n(), U.memory(), 4, P.memory()->data,
		     deg_+1, t );
      gluEndCurve( NurbsRenderer_ );

    /*
      // This code tests the tesselation code for a Nurbs Curve
    BasicList<Point3Df> list ;
    list = tesselate(0.01) ;
    BasicNode<Point3Df>* node = (BasicNode<Point3Df>*)list.first ;
    glBegin(GL_LINE_STRIP) ;
    glColor() ;
    while(node){
      glVertex3fv(node->data->data) ;
      node = node->next ;
    }    
    glEnd() ;
    */
    }
}

void
G3DNurbsCurve::shadeDetails () const
{
  glPointSize( 3 );
  glColor3f(0.2, 0.2, 0.9);
  glBegin( GL_POINTS );
  for( int i = 0; i < P.n(); ++i )
    {
      glVertex3xv( P[i].data );  //TODO 3 or 4?
    }
  glEnd();
  ((G3DNurbsCpolygon*)polygon)->shade( );
}

/*TODO
G3DNurbsCurve&
G3DNurbsCurve::operator=(const G3DNurbsCurve &a)
{
  this->NurbsCurve::operator=( a );
  this->G3DNurbs::operator=( a );
  return *this;
}
*/

G3DNurbsCurve&
G3DNurbsCurve::operator= ( const PlNurbsCurvef & rhs )
{
  this->NurbsCurve::operator= (rhs);
  return *this;
}


//===================================END===================================


More information about the Gcc-bugs mailing list