From: Kuzminski, S. R <SKu...@fa...> - 2004-05-07 13:15:24
|
I'm trying to install 0.53.1 on solaris and am getting this compile error. Looks like it needs the file ft2build.h, but I don't see it anywhere.. =20 =20 $ python setup.py build ... In file included from src/_backend_agg.cpp:3: src/ft2font.h:7:22: ft2build.h: No such file or directory <--------missing file error here src/ft2font.h:8:10: #include expects "FILENAME" or <FILENAME> src/ft2font.h:9:10: #include expects "FILENAME" or <FILENAME> src/ft2font.h:10:10: #include expects "FILENAME" or <FILENAME> In file included from src/_backend_agg.cpp:3: src/ft2font.h:29: 'FT_Face' is used as a type, but is not defined as a type. src/ft2font.h:31: 'FT_Matrix' is used as a type, but is not defined as a type. src/ft2font.h:32: 'FT_Vector' is used as a type, but is not defined as a type. src/ft2font.h:33: 'FT_Error' is used as a type, but is not defined as a type. src/ft2font.h:34: parse error before `[' token src/ft2font.h:35: parse error before `[' token error: command 'gcc' failed with exit status 1 bash-2.03$ =20 =20 thanks, Stefan |
From: Kuzminski, S. R <SKu...@fa...> - 2004-05-10 17:56:41
|
small bug.. line 237 in text.py, needs a str() around the 'legal' tuple in the exception. =20 bigger potential bug.. =20 I got it to go on Solaris, but I keep hitting a seg fault on the creation of the FT2Font object around line 261 in backend_agg.py. It ran when I put a print in before the creation of the FT2Font object. That's right. Something spooky like that means to me that there is a bug in ft2font.c where some variable is not initialized correctly and the extra print leaves the right patch of initialized memory so it runs. Only way to really nail something like that is with a Purify or Valgrind like tool.=20 =20 S |
From: John H. <jdh...@ac...> - 2004-05-10 18:52:18
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes: Kuzminski> I got it to go on Solaris, but I keep hitting a seg Kuzminski> fault on the creation of the FT2Font object around Kuzminski> line 261 in backend_agg.py. It ran when I put a print Kuzminski> in before the creation of the FT2Font object. That's Kuzminski> right. Something spooky like that means to me that Kuzminski> there is a bug in ft2font.c where some variable is not Kuzminski> initialized correctly and the extra print leaves the Kuzminski> right patch of initialized memory so it runs. Only Kuzminski> way to really nail something like that is with a Kuzminski> Purify or Valgrind like tool. Thanks for the additional information. This one is a little harder for me to debug since I can't replicate it. I recently rewrote the agg backend using cxx which is really nice, and a hell of a lot easier than doing the extension code by hand. I may do the same for ft2font. In the meantime, if you have some free time to either run a debugger or just insert some sporadic prints in newFT2FontObject that would help narrow where the segfault is occurring. Something like static FT2FontObject * newFT2FontObject(PyObject *args) { int error; char* facefile; printf("initializing\n"); if (! _initLib) { error = FT_Init_FreeType( &_ft2Library ); //initialize library if (error) { PyErr_SetString(PyExc_RuntimeError, "Could not find initialize the freetype2 library"); return NULL; } _initLib = 1; } printf("parsing args\n"); if (!PyArg_ParseTuple(args, "s:FT2Font", &facefile)) return NULL; printf("creating object\n"); FT2FontObject *self; self = PyObject_New(FT2FontObject, &FT2Font_Type); self->image.buffer = NULL; self->text = NULL; self->num_glyphs = 0; FT2Font_clear(self); printf("new face\n"); error = FT_New_Face( _ft2Library, facefile, 0, &self->face ); if (error == FT_Err_Unknown_File_Format ) { set_error(PyExc_RuntimeError, "Could not load facefile %s; Unknown_File_Format", facefile); return NULL; } else if (error == FT_Err_Cannot_Open_Resource) { set_error(PyExc_RuntimeError, "Could not open facefile %s; Cannot_Open_Resource", facefile); return NULL; } else if (error == FT_Err_Invalid_File_Format) { set_error(PyExc_RuntimeError, "Could not open facefile %s; Invalid_File_Format", facefile); return NULL; } else if (error) { set_error(PyExc_RuntimeError, "Could not load face file %s; freetype error code %d", facefile, error); return NULL; } printf("setting size\n"); // set a default fontsize 12 pt at 72dpi error = FT_Set_Char_Size( self->face, 12 * 64, 0, 72, 72 ); if (error) { PyErr_SetString(PyExc_RuntimeError, "Could not set the fontsize"); return NULL; } printf("initing dict\n"); if (self == NULL) return NULL; self->x_attr = NULL; printf("getting ps name\n"); // set some face props as attributes const char* ps_name; ps_name = FT_Get_Postscript_Name( self->face ); if ( ps_name == NULL ) ps_name = "UNAVAILABLE"; printf("setting attributes\n"); SETATTR(self, FT2Font_setattr, "postscript_name", PyString_FromString, ps_name); SETATTR(self, FT2Font_setattr, "num_faces", PyInt_FromLong, self->face->num_faces); SETATTR(self, FT2Font_setattr, "family_name", PyString_FromString, self->face->family_name); SETATTR(self, FT2Font_setattr, "style_name", PyString_FromString, self->face->style_name); SETATTR(self, FT2Font_setattr, "face_flags", PyInt_FromLong, self->face->face_flags); SETATTR(self, FT2Font_setattr, "style_flags", PyInt_FromLong, self->face->style_flags); SETATTR(self, FT2Font_setattr, "num_glyphs", PyInt_FromLong, self->face->num_glyphs); SETATTR(self, FT2Font_setattr, "num_fixed_sizes", PyInt_FromLong, self->face->num_fixed_sizes); SETATTR(self, FT2Font_setattr, "num_charmaps", PyInt_FromLong, self->face->num_charmaps); printf("checking scalable\n"); int scalable; scalable = FT_IS_SCALABLE( self->face ); SETATTR(self, FT2Font_setattr, "scalable", PyInt_FromLong, scalable); if (scalable) { SETATTR(self, FT2Font_setattr, "units_per_EM", PyInt_FromLong, self->face->units_per_EM); printf("building bbox\n"); PyObject *bbox = Py_BuildValue ("(llll)", self->face->bbox.xMin, self->face->bbox.yMin, self->face->bbox.xMax, self->face->bbox.yMax ); SETATTR_PYOBJ(self, FT2Font_setattr, "bbox", bbox); SETATTR(self, FT2Font_setattr, "ascender", PyInt_FromLong, self->face->ascender); SETATTR(self, FT2Font_setattr, "descender", PyInt_FromLong, self->face->descender); SETATTR(self, FT2Font_setattr, "height", PyInt_FromLong, self->face->height); SETATTR(self, FT2Font_setattr, "max_advance_width", PyInt_FromLong, self->face->max_advance_width); SETATTR(self, FT2Font_setattr, "max_advance_height", PyInt_FromLong, self->face->max_advance_height); SETATTR(self, FT2Font_setattr, "underline_position", PyInt_FromLong, self->face->underline_position); SETATTR(self, FT2Font_setattr, "underline_thickness", PyInt_FromLong, self->face->underline_thickness); } printf("made it!\n"); return self; } |
From: John H. <jdh...@ac...> - 2004-05-07 14:04:05
|
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes: Kuzminski> I'm trying to install 0.53.1 on solaris and am getting Kuzminski> this compile error. Looks like it needs the file Kuzminski> ft2build.h, but I don't see it anywhere.. You need to make sure a recent version of freetype (we recommend 2.1.7 or later) is installed on your system (and zlib and png for that matter). If it is installed, you need to make sure you add the base install dir to your basedir list in setupext.py. Eg if it is installed to /some/dir/freetype2 you need to add /some/dir to basedir['sunos5'] in that file; (I'm assuming sys.platform returns 'sunos5'). Where do the GNU tools for solaris go by default; something like /freeware? I'm referring to the collection from http://wwws.sun.com/software/solaris/freeware/download.html. I can't recall but whatever the base install dir is, we should add this dir to the default sunos5 basedir list. Finally, please submit back the required changes you made to seteupext.py (if any) so we can fix this. Hell, you got gdmodule compiled on win32; matplotlib on solaris should be a cake walk :-) Thanks, John Hunter |