[omniORB] omniORB(py) on AIX

Gary D. Duzan gdd0@gte.com
Mon, 09 Jul 2001 15:29:41 -0400


   As promised, I have a fairly straightforward workaround to get
Python to work with xlC-compiled C++ extensions on AIX. You will
need to change two files, run autoconf, reconfigure, and rebuild
Python. The same procedure works for both Python 2.0 and 2.1, and
most likely 1.5.2, and the result should work with any xlC compiler
from 3.1.4 to 3.6.6, plus VACPP 5.0. In fact, all you really need
is libC.a in /usr/lib; xlC itself is never actually used.
   Here are the patches to 2.0. It is almost as easy to do by hand
if there is any problem applying them.

===========================================================================
#!/bin/patch -p1
diff -rc Python-2.0-dist/configure.in Python-2.0/configure.in
*** Python-2.0-dist/configure.in	Mon Oct 16 17:50:06 2000
--- Python-2.0/configure.in	Mon Jul  9 13:30:50 2001
***************
*** 683,693 ****
  # checks for system dependent C++ extensions support
  case "$ac_sys_system" in
  	AIX*)	AC_MSG_CHECKING(for genuine AIX C++ extensions support)
! 		AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
  			    [loadAndInit("", 0, "")],
  			    [AC_DEFINE(AIX_GENUINE_CPLUSPLUS)
  			     AC_MSG_RESULT(yes)],
! 			    [AC_MSG_RESULT(no)]);;
  	*) ;;
  esac
  
--- 683,696 ----
  # checks for system dependent C++ extensions support
  case "$ac_sys_system" in
  	AIX*)	AC_MSG_CHECKING(for genuine AIX C++ extensions support)
! 		LIBS_SAVE=$LIBS
! 		LIBS="$LIBS -lC"
! 		AC_TRY_LINK([int (*loadAndInit(char *name, int flags, char *path))();],
  			    [loadAndInit("", 0, "")],
  			    [AC_DEFINE(AIX_GENUINE_CPLUSPLUS)
  			     AC_MSG_RESULT(yes)],
! 			    [LIBS=$LIBS_SAVE
! 			     AC_MSG_RESULT(no)]);;
  	*) ;;
  esac
  
diff -rc Python-2.0-dist/Python/dynload_aix.c Python-2.0/Python/dynload_aix.c
*** Python-2.0-dist/Python/dynload_aix.c	Mon Oct 16 17:49:29 2000
--- Python-2.0/Python/dynload_aix.c	Mon Jul  9 13:36:07 2001
***************
*** 12,18 ****
  
  
  #ifdef AIX_GENUINE_CPLUSPLUS
! #include "/usr/lpp/xlC/include/load.h"
  #define aix_load loadAndInit
  #else
  #define aix_load load
--- 12,18 ----
  
  
  #ifdef AIX_GENUINE_CPLUSPLUS
! int (*loadAndInit(char *name, int flags, char *path))();
  #define aix_load loadAndInit
  #else
  #define aix_load load
===========================================================================

After making the changes, run autoconf, then:

	./configure  --with-threads --with-gcc=xlc_r

You should see a test for "genuine AIX C++ extensions support"
which should return "yes". Run "make" and you'll be ready to go.
   We have a rather more complicated solution that also allows
gcc-compiled C++ modules to be used, but I haven't cleaned it
up and tested it, and gcc has problems on AIX which need to
be patched separately, anyway. If there is a significant demand
for it, I'll see if I can put something together.

					Gary Duzan
					Verizon IT



In Message <20010709185929.E32278@jsievers> ,
   Jan Sievers <jan.sievers@portal.com> wrote:

=>
=>Hi,
=>
=>is anyone out there who has successfully built and used
=>omniORB3.x/omniORBpy1.x on AIX4.3 with xlC 5.0x and python2.0?
=>If so, are there any patches, that have to be applied to
=>the omniORB (or python) sources?
=>Python and omniORB seem to work fine, but whenever we try
=>to use omniORBpy, we end up in core dumps that result from
=>calls to pthread_mutex_lock. Can anyone give us a hint?
=>
=>Thanx
=>Jan
=>