compiling on AIX 5.3 with vacpp

P

pruebauno

I am trying to compile Python 2.5 on AIX 5.3. I used

export PATH=/usr/bin:/usr/vacpp/bin

OPT=-O2 ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64"
--disable-ipv6 AR="ar -X64"

make

The following error stops make in its track:

building '_locale' extension
../Modules/ld_so_aix xlc_r -q64 -bI:Modules/python.exp
build/temp.aix-5.3-2.5/home/pxadm/.test/Python-2.5/Modules/_localemodule.o
-L/usr/local/lib -o build/lib.aix-5.3-2.5/_locale.so
ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
ld: 0711-317 ERROR: Undefined symbol: .textdomain
ld: 0711-317 ERROR: Undefined symbol: .dcgettext
ld: 0711-317 ERROR: Undefined symbol: .dgettext
ld: 0711-317 ERROR: Undefined symbol: .gettext
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
*** WARNING: renaming "_locale" since importing it failed:
0509-022 Cannot load module build/lib.aix-5.3-2.5.
0509-026 System error: A file or directory in the path name
does not exist.
error: No such file or directory
make: 1254-004 The error code from the last command is 1.

Stop.

Any help appreciated as to explain what that error could mean and
possible ways of fixing it.
 
N

nnorwitz

I am trying to compile Python 2.5 on AIX 5.3. I used

building '_locale' extension
./Modules/ld_so_aix xlc_r -q64 -bI:Modules/python.exp
build/temp.aix-5.3-2.5/home/pxadm/.test/Python-2.5/Modules/_localemodule.o
-L/usr/local/lib -o build/lib.aix-5.3-2.5/_locale.so
ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
ld: 0711-317 ERROR: Undefined symbol: .textdomain
ld: 0711-317 ERROR: Undefined symbol: .dcgettext
ld: 0711-317 ERROR: Undefined symbol: .dgettext
ld: 0711-317 ERROR: Undefined symbol: .gettext

The problem is that an additional library is needed to link the locale
module. You will first need to determine what library is needed.
Maybe libintl? To find out, you can do a man on any of those symbols,
for example, man textdomain.

That should tell you want library is required. You will then need to
modify setup.py to add the extra library for the locale module.
There's already some support for this in setup.py around line 390:

# access to ISO C locale support
data = open('pyconfig.h').read()
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
if m is not None:
locale_libs = ['intl']
else:
locale_libs = []
if platform == 'darwin':
locale_extra_link_args = ['-framework', 'CoreFoundation']
else:
locale_extra_link_args = []


exts.append( Extension('_locale', ['_localemodule.c'],
libraries=locale_libs,
extra_link_args=locale_extra_link_args)
)

Once you get something working, please post a patch.

n
 
P

pruebauno

I am trying to compile Python 2.5 on AIX 5.3. I used

building '_locale' extension
./Modules/ld_so_aix xlc_r -q64 -bI:Modules/python.exp
build/temp.aix-5.3-2.5/home/pxadm/.test/Python-2.5/Modules/_localemodule.o
-L/usr/local/lib -o build/lib.aix-5.3-2.5/_locale.so
ld: 0711-317 ERROR: Undefined symbol: .bindtextdomain
ld: 0711-317 ERROR: Undefined symbol: .textdomain
ld: 0711-317 ERROR: Undefined symbol: .dcgettext
ld: 0711-317 ERROR: Undefined symbol: .dgettext
ld: 0711-317 ERROR: Undefined symbol: .gettext

The problem is that an additional library is needed to link the locale
module. You will first need to determine what library is needed.
Maybe libintl? To find out, you can do a man on any of those symbols,
for example, man textdomain.

That should tell you want library is required. You will then need to
modify setup.py to add the extra library for the locale module.
There's already some support for this in setup.py around line 390:

# access to ISO C locale support
data = open('pyconfig.h').read()
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
if m is not None:
locale_libs = ['intl']
else:
locale_libs = []
if platform == 'darwin':
locale_extra_link_args = ['-framework', 'CoreFoundation']
else:
locale_extra_link_args = []


exts.append( Extension('_locale', ['_localemodule.c'],
libraries=locale_libs,
extra_link_args=locale_extra_link_args)
)

Once you get something working, please post a patch.

n

Thanks for the info Neil,

sorry for taking long to answer. This is skunkwork, I am working on it
whenever I get some time.

indeed as you say. libintl.h is required so I hard coded it into
setup.py to no effect. At what point does setup.py get called? by make?

my code
# access to ISO C locale support
data = open('pyconfig.h').read()
m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
if m is not None:
locale_libs = ['intl']
else:
locale_libs = []
if platform == 'darwin':
locale_extra_link_args = ['-framework', 'CoreFoundation']
else:
locale_extra_link_args = []

locale_libs=['intl']

exts.append( Extension('_locale', ['_localemodule.c'],
libraries=locale_libs,
extra_link_args=locale_extra_link_args) )
 
N

nnorwitz

indeed as you say. libintl.h is required so I hard coded it into
setup.py to no effect. At what point does setup.py get called? by make?

Yes. When you do make, python itself is built. After that, with the
built python setup.py gets called to build all the modules.

BTW, it's best to copy me on all mails as I read c.l.p only
occassionally.

n
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top