Bug 243 - Inventor on Redhat 9
: Inventor on Redhat 9
Status: REOPENED
Product: inventor
Classification: Unclassified
Component: build
: other
: All Linux
: P1 normal
: ---
Assigned To: jlim
:
:
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-23 07:57 CDT by Boris Mayer-St-Onge
Modified: 2007-03-07 06:23 CST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Mayer-St-Onge 2003-04-23 07:57:14 CDT
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
Comment 1 graeme.hanson 2003-04-27 21:18:31 CDT
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!
Comment 2 graeme.hanson 2003-04-28 01:11:09 CDT
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??
Comment 3 graeme.hanson 2003-04-29 01:19:43 CDT
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 );
Comment 4 Jonathan Lim 2003-04-29 10:58:15 CDT
I will upgrade to gcc 3.x sometime this week and see what needs to be fixed.

Jonathan
Comment 5 Jonathan Lim 2003-06-17 21:26:40 CDT
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
Comment 6 Manuel Pastor 2003-08-21 01:24:10 CDT
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? 
Comment 7 LamCo 2006-12-13 01:14:54 CST
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
Comment 8 Grigory 2007-03-07 04:23:50 CST
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