[omniORB] FreeBSD and omniORBpy

Brad Chapman chapmanb@arches.uga.edu
Fri, 10 Dec 1999 16:39:43 -0500


--============_-1267260500==_============
Content-Type: text/plain; charset="us-ascii"

Hello all! I have been attempting to get omniORB working on FreeBSD 3.3 so
that I can work with the python bindings (thanks much for them!).
Unfortunately, I have only had partial success doing this, likely due to my
inexperience in this area. I have managed to, I think, get omniORB itself
compiled, but cannot get the test examples to compile (so I can't check how
well my compilation went!). In addition, I am having problems trying to get
the python bindings to compile. So, some solutions, but lots of problems.
	I have included as a text file attachment a description of what I
have done/tried to do, and my results. If anyone would be willing to take a
look at it and give my some pointers, etc. I would be extremely
appreciative!

Brad
chapmanb@arches.uga.edu

--============_-1267260500==_============
Content-Type: text/plain; name="ooprob.txt"; charset="us-ascii"
Content-Disposition: attachment; filename="ooprob.txt"

Thank you very much if you took the time to take a look at this. I'm

pretty new at this, but I have tried to detail as much relevant info as I

could below. If you need anything else at all I will, of course, be happy
to 
provide it!

First off, this is the info about what I'm using:

FreeBSD
3.3-release
gmake 3.77
gcc/g++ 2.95.2


BUILD PROBLEMS
--------------
In
order to build omniORB, I followed the omniORB 2.7.1 and FreeBSD 3.2

directions with the following changes to x86_freebsd_3.2.mk:

1. I
uncommented the relevant parts at the end to get static linking (I 
didn't
want to do this, but I couldn't get it to build otherwise).
2. I changed
the c and c++ compilers from the made up egcs and egcs++ compilers to

gcc295 and g++295, the most recent versions of these I could get my hands

on.

When I compiled, it went fine for a while until I got
here:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

gcc295 -c -O2  -DHOSTS_ACCESS -DLIBC_CALLS_STRTOK -DBROKEN_FGETS

-DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"

-DRFC931_TIMEOUT=10 -DSOLARIS_24_GETHOSTBYNAME_BUG -DGETPEERNAME_BUG

-D_REENTRANT -I.  -I../..  -I../../..  -I.  -I../../../../../../include

-D__x86__ -D__freebsd__ -D__OSVERSION__=3 -o percent_m.o
percent_m.c
percent_m.c:18: conflicting types for
`sys_errlist'
/usr/include/stdio.h:225: previous declaration of
`sys_errlist'
gmake[5]: *** [percent_m.o] Error 1
gmake[5]: Leaving
directory

`/usr/local/omniORB/src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper'
%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Not
wanting to mess around with stdio, I looked at the offending file in

"src/lib/omniORB2/orbcore/gatekeepers/tcpwrapper/percent_m.c" where I

found the following:

extern int errno;
#if !(defined(__GLIBC__) &&
__GLIBC__ >=2)
#if !defined(SYS_ERRLIST_DEFINED) ||
!defined(__freebsd__)
extern char *sys_errlist[];
extern int
sys_nerr;
#endif
#endif

To me, this read that it should not be executing
"extern char 
*sys_errlist[];" on FreeBSD so I decided to comment it out
and force it not to 
execute (hopefully my interpretation of the code was
not too wrong!).

After doing this everything else compiled without a
problem and I was able 
to go through and do everything with omniName
without any problems. Then I 
proceeded to try to compile the
examples:

EXAMPLE PROBLEMS
----------------
When I tried to build the
examples to test everything, I did the following:

1. Manually built the
.hh files by running omniidl2 in each directory
2. Tried "gmake all" in the
main examples directory. 

Nearly immediately I got the following
compilation errors in the echo test

directory:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
+ g++295 -pthread -s -o eg1 -O2 -Wall -Wno-unused
-L../../../lib/x86_freebsd_3.2 
eg1.o -Wl,-Bstatic -lomniORB2
-lomniDynamic2 -ltcpwrapGK -lomnithread -Wl,-Bdynam
ic
eg1.o: In function
`hello(CORBA::Object *)':
eg1.o(.text+0x23): undefined reference to
`Echo::_narrow(CORBA::Object *)'
eg1.o(.text+0x91): undefined reference to
`Echo_Helper::release(Echo *)'
eg1.o(.text+0x1cc): undefined reference to
`Echo_Helper::release(Echo *)'
eg1.o(.text+0x207): undefined reference to
`Echo_Helper::release(Echo *)'
eg1.o: In function
`main':
eg1.o(.text+0x29e): undefined reference to `Echo::omniObject
virtual table'
eg1.o(.text+0x2a7): undefined reference to
`Echo::CORBA::Object virtual table'
eg1.o(.text+0x2ae): undefined reference
to `Echo virtual table'
eg1.o(.text+0x2fe): undefined reference to
`_sk_Echo::omniObject virtual table'
eg1.o(.text+0x309): undefined
reference to `_sk_Echo::CORBA::Object virtual table
'
eg1.o(.text+0x312):
undefined reference to `_sk_Echo::Echo virtual table'
eg1.o(.text+0x3c6):
undefined reference to `Echo::_duplicate(Echo *)'
eg1.o: In function
`Echo_i::Echo_i(int)':
eg1.o(.text+0x517): undefined reference to
`Echo::omniObject virtual table'
eg1.o(.text+0x520): undefined reference to
`Echo::CORBA::Object virtual table'
eg1.o(.text+0x527): undefined reference
to `Echo virtual table'
eg1.o(.text+0x57e): undefined reference to
`_sk_Echo::omniObject virtual table'
eg1.o(.text+0x589): undefined
reference to `_sk_Echo::CORBA::Object virtual table
'
eg1.o(.text+0x592):
undefined reference to `_sk_Echo::Echo virtual table'
eg1.o: In function
`Echo_i::~Echo_i(void)':
eg1.o(.text+0x664): undefined reference to
`_sk_Echo::~_sk_Echo(void)'
eg1.o(.text+0x672): undefined reference to
`Echo::~Echo(void)'
eg1.o(.rodata+0x1e4): undefined reference to `_sk_Echo
type_info node'
eg1.o: In function `virtual function thunk (delta:0) for
_sk_Echo::76_dispatch(GI
OP_S &, char const *,
bool)':
eg1.o(.gnu.linkonce.t.__thunk_n76_dispatch__8_sk_EchoR6GIOP_SPCcb+0x6):
undefined
 reference to `_sk_Echo::dispatch(GIOP_S &, char const *,
bool)'
eg1.o: In function
`__thunk_n76__widenFromTheMostDerivedIntf__8_sk_EchoPCcb':
eg1.o(.gnu.linkonce.t
.__thunk_n76__widenFromTheMostDerivedIntf__8_sk_EchoPCcb+0x6
): undefined
reference to `_sk_Echo::_widenFromTheMostDerivedIntf(char const *,
b
ool)'
eg1.o: In function `Echo_i type_info
function':
eg1.o(.gnu.linkonce.t.__tf6Echo_i+0x16): undefined reference to
`_sk_Echo type_in
fo function'
collect2: ld returned 1 exit
status
gmake[1]: *** [eg1] Error
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

As
suggested in the README.FreeBSD, I tried to use -lpthread, but this gave

the error: "/usr/libexec/elf/ld: cannot open -lpthread: No such file or

directory" and after searching through FreeBSD archives, it turns out
that, 
for some reasons I don't understand, the -pthread is FreeBSD
specific for 
gcc/g++ and -lpthread isn't supported.

omniORBpy
PROBLEMS
-------------------

Running gmake export on the omniORBpy
distribution (just cvsed today) gave 
the
following:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
gcc295 -c -O2  -DHAVE_CONFIG_H -I. -I.  -I../../../../../../include
-D__x86__ 
-D__freebsd__ -D__OSVERSION__=3 -o cexp.o cexp.c
cexp.y: In
function `yylex':
cexp.y:688: `SIZEOF_UNSIGNED_CHAR' undeclared (first use
in this function)
cexp.y:688: (Each undeclared identifier is reported only
once
cexp.y:688: for each function it appears in.)
cexp.y:694: `SIZEOF_INT'
undeclared (first use in this function)
cexp.y: In function
`left_shift':
cexp.y:1023: `SIZEOF_INT' undeclared (first use in this
function)
cexp.y: In function `right_shift':
cexp.y:1034: `SIZEOF_INT'
undeclared (first use in this function)
gmake[3]: *** [cexp.o] Error
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I'm
not sure how I should proceed to fix this at all. The real reason I am

trying all of this is to use the python bindings, so I'm very interested

in anything I can do to fix this problem!
	Well, if you made it all of
the way here I would like to offer my 
sincerest thanks. If you need any
other info at all, please don't hesitate 
to ask. Any advice anyone can
offer would be greatly appreciated! Thanks
again.

Brad
chapmanb@arches.uga.edu



--============_-1267260500==_============--