Bugzilla – Bug 243
Inventor on Redhat 9
Last modified: 2007-03-07 06:23:50 CST
We have just set a new computer with Redhat 9 and I'm trying to recompile my applications. Unfortunately, I'm not able to compile the SGI Open-Inventor library (http://oss.sgi.com/projects/inventor/). I suspect the interaction of Inventor with the new version of g++ but since I'm not an expert, I need some help. While the Inventor library was made succesfully on Redhat 7.1 (gcc 2.96), I'm having these error on Redhat 9 (gcc 3.2.2): /usr/bin/g++ -L/tmp/logiciels/inventor/usr/lib -L/usr/X11R6/lib Main.o ClassDef.o Man.o Reader.o Writer.o BuildIssues.o -lInventor -o ivman /tmp/logiciels/inventor///usr/lib/libInventor.so: undefined reference to `__ctype_b' Thanks for any clue/help. Boris
I have built openinventor 2.1.5-9 from source and see this problem as well. I have upgraded glibc to 2.3.2-27.9, but this has no effect. The problem may in part arise from libFL.a >nm -s libFL_i386.a | grep ctype U __ctype_b U __ctype_b U __ctype_b U __ctype_b U __ctype_b which cannot be found. I am looking for it on the Redhat 8.0 system to see which additional library I need. Any thoughts/ideas most welcome!
After digging (search google for __ctype_b redhat) a little more I found what appears to be the problem. In redhat 9 libc has changed its use of LC_TYPE locale format and __ctype_b should have been added to ensure backwards compatability. If you look at libc.so.6 -> libc-2.3.2.so $ nm -s /lib/libc.so.6 | grep __ctype_b 00120538 D __ctype_b@GLIBC_2.0 0002101c T __ctype_b_loc and it appears that it has, but g++ cannot find it! RedHat 8.0 was missing this link and there was a patch (86465) to fix it. Maybe we need to lodge a bug with redhat concerning this?? Though maybe the solution is just to recompile libFL.a on redhat 9.0 box. As this library is dependent on __ctype_b. I would be willing to give this a go if you havent got a redhat 9.0 box. Any thoughts??
The saga continues. If you use true type fonts and recompile libFL.a you can then get things to work after patching (patch is below) some SceneView files (thanks to Harold Borkin for this info). I can also repeat this, at least for shared object binaries linked against the shared object libraries. Clearly we need a new version of libFL.a for type 1 fonts. Can SGI please recompile libFL.a under Red Hat 9.0 (gcc 3.2.2) for us. I am still having a problem creating a static version of ivview with freetype fonts as __ctype_b is not located in /usr/lib/libc.a A bug for RedHat! I will report this. Probably OpenInventor needs to update its use of locale to the new model which will prevent this problem. Another point is that you will need to install true typefonts to get the fonts displayed in ivview and other scene graphs and create the links (see inventor/libFL/ang/README). Patch provided by Harold Borkin is: Index: apps/demos/SceneViewer/SoSceneMenu.h =================================================================== RCS file: /home/steve/lib/cvs/debian/inventor/apps/demos/SceneViewer/SoSceneMenu.h,v retrieving revision 1.1.1.1 diff -u -b -B -r1.1.1.1 SoSceneMenu.h --- apps/demos/SceneViewer/SoSceneMenu.h 29 Oct 2000 15:04:15 -0000 1.1.1.1 +++ apps/demos/SceneViewer/SoSceneMenu.h 1 Feb 2003 04:48:23 -0000 @@ -469,19 +469,19 @@ (Cardinal) SV_OFFSET(&lightData[4].name, &lightData[0]), XtRString, (XtPointer) "Ambient Lighting...",}, { "headlight", NULL, XtRString, sizeof(XtRString), - (Cardinal) SV_OFFSET(&Light.headlight, &lightData[0]), + 0, //(Cardinal) SV_OFFSET(&Light.headlight, &lightData[0]), XtRString, (XtPointer) "Headlight ",}, { "editlight", NULL, XtRString, sizeof(XtRString), - (Cardinal) SV_OFFSET(&Light.editlight, &lightData[0]), + 0, //(Cardinal) SV_OFFSET(&Light.editlight, &lightData[0]), XtRString, (XtPointer) "Edit",}, { "directionallight", NULL, XtRString, sizeof(XtRString), - (Cardinal) SV_OFFSET(&Light.directionallight, &lightData[0]), + 0, //(Cardinal) SV_OFFSET(&Light.directionallight, &lightData[0]), XtRString, (XtPointer) "Directional ",}, { "spotlight", NULL, XtRString, sizeof(XtRString), - (Cardinal) SV_OFFSET(&Light.spotlight, &lightData[0]), + 0, //(Cardinal) SV_OFFSET(&Light.spotlight, &lightData[0]), XtRString, (XtPointer) "Spot ",}, { "pointlight", NULL, XtRString, sizeof(XtRString), - (Cardinal) SV_OFFSET(&Light.pointlight, &lightData[0]), + 0, //(Cardinal) SV_OFFSET(&Light.pointlight, &lightData[0]), XtRString, (XtPointer) "Point ",}, }; int intl_num_light_resources = XtNumber( intl_light_resources ); Index: apps/demos/SceneViewer/SoSceneViewer.c++ =================================================================== RCS file: /home/steve/lib/cvs/debian/inventor/apps/demos/SceneViewer/SoSceneViewer.c++,v retrieving revision 1.1.1.3 diff -u -b -B -r1.1.1.3 SoSceneViewer.c++ --- apps/demos/SceneViewer/SoSceneViewer.c++ 1 Jun 2002 02:22:20 -0000 1.1.1.3 +++ apps/demos/SceneViewer/SoSceneViewer.c++ 1 Feb 2003 04:51:50 -0000 @@ -353,6 +353,18 @@ XtGetSubresources( getParentWidget(), &editorData[0], "intl", "Intl", intl_editor_resources, intl_num_editor_resources, NULL, 0 ); + + // Fix up intl_light_resources offsets ... + intl_light_resources[1].resource_offset + = (Cardinal) SV_OFFSET(&Light.headlight, &lightData[0]); + intl_light_resources[2].resource_offset + = (Cardinal) SV_OFFSET(&Light.editlight, &lightData[0]); + intl_light_resources[3].resource_offset + = (Cardinal) SV_OFFSET(&Light.directionallight, &lightData[0]); + intl_light_resources[4].resource_offset + = (Cardinal) SV_OFFSET(&Light.spotlight, &lightData[0]); + intl_light_resources[5].resource_offset + = (Cardinal) SV_OFFSET(&Light.pointlight, &lightData[0]); XtGetSubresources( getParentWidget(), &lightData[0], "intl", "Intl", intl_light_resources, intl_num_light_resources, NULL, 0 );
I will upgrade to gcc 3.x sometime this week and see what needs to be fixed. Jonathan
The __ctype_b problem is not specific to Inventor. On my system running Red Hat 7.2, the problem is not observed with the following installed: binutils-2.13.90.0.18-9 cpp-3.2.2-5 elfutils-libelf-0.76-3 gcc-3.2.2-5 gcc-c++-3.2.2-5 glibc-2.3.2-11.9 glibc-common-2.3.2-11.9 glibc-devel-2.3.2-11.9 libgcc-3.2.2-5 libstdc++-3.2.2-5 libstdc++-devel-3.2.2-5 Jonathan
I have also observed this problem in my RH 9 box. If I try to compile with the precompiled libFL.a it give me the __ctype_b error while if I use the truetype wrapper version of libFL.a it works fine. The problem is that I need the old version! Please, could somebody recompile the "classic" libFL.a under RH 9 and let it accesible somewhere?
dear experts, I compiled inventor2.1.5-10 with Scientific Linux 4.4 (built on RedHat Enterprise architecture) and I received the same compilation error about __ctype /inventor///usr/lib/libInventor.so: undefined reference to `__ctype_b' May I know where can I get the fixed libFL.a? many thanks, LamCo lamco333@yahoo.com
I find the solution form Michael Logan <mlogan@mail.arc.nasa.gov> (http://oss.sgi.com/archives/info-inventor-dev/2004-02/msg00004.html) but it isn't work for me... I modification this solution and OpenInventor works fine! Solution this problem: 1. create file ctype_b.c++ : #include <ctype.h> extern "C" { __const unsigned short int **__wrap___ctype_b (void) { return __ctype_b_loc(); } __const unsigned short int**__ctype_b (void) { return __ctype_b_loc(); } } 2. compile this file: g++ -c -O -DNDEBUG ctype_b.c++ 3. add ctype_b.o in each makefile if is needed (where ctype_b is needed) in string LLDLIBS= and copy ctype_b.o in each directory where contains makefile 4. run make 5. enjoy