[Zope-Perl] pyperl on True64 Unix 5.1

Roman Bogoyev roman@maths.uwa.edu.au
Wed, 17 Oct 2001 17:07:57 +0800


Hi,

Has anyone successfully built pyperl on a DEC box?
I'm struggling:

So far I have installed 
	perl 5.6.1 (using the native cc compiler, and dec-threads)
	python 2.1.1 (using the native cc compiler, and dec-threads).

Both of these work fine.

[Please don't be put off by the size of this message, most of it
is output included here for completeness; there are about 3 or 4 main
points only]

With pyperl 1.0.1:

-----------------------------------------------------------------------
OSF-madvax root>cd Python-Object/
OSF-madvax root>perl Makefile.PL
Picking up pyton include files from "/usr/local/include/python2.1"
Checking if your kit is complete...
Looks good
Writing Makefile for Python::Object
OSF-madvax root>make install
cp lib/Python.pm blib/lib/Python.pm
cp Object.pm blib/lib/Python/Object.pm
cp lib/Python/Err.pm blib/lib/Python/Err.pm
/bin/perl -I/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi -I/usr/local/lib/perl5/5.6.
1 /usr/local/lib/perl5/5.6.1/ExtUtils/xsubpp  -typemap /usr/local/lib/perl5/5.6.1/ExtUtils/
typemap -typemap typemap Object.xs > Object.xsc && mv Object.xsc Object.c
cc -c -I"/usr/local/include/python2.1" -pthread -std -fprm d -ieee -D_INTRINSICS -I/usr/loc
al/include -DLANGUAGE_C -O4   -DVERSION=\"1.00\" -DXS_VERSION=\"1.00\"  -I/usr/local/lib/pe
rl5/5.6.1/OSF-dec_osf-thread-multi/CORE -DMULTI_PERL Object.c
cc: Warning: /usr/local/include/python2.1/config.h, line 165: The redefinition of the macro
 "_POSIX_THREADS" conflicts with a current definition because the replacement lists differ.
  The redefinition is now in effect. (macroredef)
#define _POSIX_THREADS 1
-----------------------^
Running Mkbootstrap for Python::Object ()
chmod 644 Object.bs
ar cr tmp.a Object.o
: tmp.a
rm -f blib/arch/auto/Python/Object/Object.so
LD_RUN_PATH="" ld  -shared -expect_unresolved "*" -O4 -msym -std -s -L/usr/local/lib -all t
mp.a -none  -o blib/arch/auto/Python/Object/Object.so
chmod 755 blib/arch/auto/Python/Object/Object.so
cp Object.bs blib/arch/auto/Python/Object/Object.bs
chmod 644 blib/arch/auto/Python/Object/Object.bs
Manifying blib/man3/Python.3
Manifying blib/man3/Python::Object.3
Manifying blib/man3/Python::Err.3
Installing /usr/local/lib/perl5/site_perl/5.6.1/OSF-dec_osf-thread-multi/auto/Python/Object
/Object.so
Files found in blib/arch: installing files in blib/lib into architecture dependent library
tree
Installing /usr/local/man/man3/Python.3
Installing /usr/local/man/man3/Python::Object.3
Installing /usr/local/man/man3/Python::Err.3
Writing /usr/local/lib/perl5/site_perl/5.6.1/OSF-dec_osf-thread-multi/auto/Python/Object/.p
acklist
Appending installation info to /usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/perlloca
l.pod 
------------------------------------------------------------------------------------

So far OK!

Next:

-------------------------------------------------------------------------------------

OSF-madvax root>cd ..
OSF-madvax root>python setup.py install

running install
running build
running build_py
creating build
creating build/lib.osf1-V5.1-alpha-2.1
copying dbi.py -> build/lib.osf1-V5.1-alpha-2.1
copying dbi2.py -> build/lib.osf1-V5.1-alpha-2.1
copying perlpickle.py -> build/lib.osf1-V5.1-alpha-2.1
copying perlmod.py -> build/lib.osf1-V5.1-alpha-2.1
running build_ext
building 'perl2' extension
creating build/temp.osf1-V5.1-alpha-2.1
cc -O -Olimit 1500 -I/usr/local/include -I/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE -I/usr/local/include/python2.1 -c p
erlmodule.c -o build/temp.osf1-V5.1-alpha-2.1/perlmodule.o -pthread -std -fprm d -ieee -D_INTRINSICS -DLANGUAGE_C -DDL_HACK -DMULTI_PE
RL
cc: Warning: /usr/local/include/python2.1/config.h, line 165: The redefinition of the macro "_POSIX_THREADS" conflicts with a currentdefinition because the replacement lists differ.  The redefinition is now in effect. (macroredef)
#define _POSIX_THREADS 1
-----------------------^
cc: Warning: perlmodule.c, line 725: In the initializer for PerlMethods[0].ml_meth, the referenced type of the pointer value "call" is
 "function () returning pointer to struct _object", which is not compatible with "function (pointer to struct _object, pointer to stru
ct _object) returning pointer to struct _object". (ptrmismatch)
    { "call",        call,        METH_VARARGS|METH_KEYWORDS},
---------------------^

LOTS OF THESE

....
....
....
....


------------------------------------------^
ld -shared -expect_unresolved * build/temp.osf1-V5.1-alpha-2.1/perlmodule.o build/temp.osf1-V5.1-alpha-2.1/lang_lock.o build/temp.osf1-V5.1-alpha-2.1/lang_map.o build/temp.osf1-V5.1-alpha-2.1/svrv_object.o build/temp.osf1-V5.1-alpha-2.1/pyo.o build/temp.osf1-V5.1-alpha-2.1/try_perlapi.o build/temp.osf1-V5.1-alpha-2.1/perlxsi.o build/temp.osf1-V5.1-alpha-2.1/thrd_ctx.o /usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/local/lib -L/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE -lperl -lm -liconv -lutil -lpthread -lexc -o build/lib.osf1-V5.1-alpha-2.1/perl2.so -Wl,-rpath,/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE
ld:
Invalid flag usage: Wl,-rpath,/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE, -Wx,-option must appear after -_SYSTYPE_SVR4
ld: Usage: ld [options] file [...]
error: command 'ld' failed with exit status 1 

-----------------------------------------------------------------------------------------

It seems the cc flags were passed straight to ld, so I hacked opts.pl to strip the 
'Wl,' and the comma after -rpath in ldopts() resulting in:

--------------------------------------------------------------------------------------------
 OSF-madvax root>python setup.py install
running install
running build
running build_py
not copying dbi.py (output up-to-date)
not copying dbi2.py (output up-to-date)
not copying perlpickle.py (output up-to-date)
not copying perlmod.py (output up-to-date)
running build_ext
building 'perl2' extension
skipping perlmodule.c (build/temp.osf1-V5.1-alpha-2.1/perlmodule.o up-to-date)
skipping lang_lock.c (build/temp.osf1-V5.1-alpha-2.1/lang_lock.o up-to-date)
skipping lang_map.c (build/temp.osf1-V5.1-alpha-2.1/lang_map.o up-to-date)
skipping svrv_object.c (build/temp.osf1-V5.1-alpha-2.1/svrv_object.o up-to-date)
skipping pyo.c (build/temp.osf1-V5.1-alpha-2.1/pyo.o up-to-date)
skipping try_perlapi.c (build/temp.osf1-V5.1-alpha-2.1/try_perlapi.o up-to-date)
skipping perlxsi.c (build/temp.osf1-V5.1-alpha-2.1/perlxsi.o up-to-date)
skipping thrd_ctx.c (build/temp.osf1-V5.1-alpha-2.1/thrd_ctx.o up-to-date)
ld -shared -expect_unresolved * build/temp.osf1-V5.1-alpha-2.1/perlmodule.o build/temp.osf1-V5.1-alpha-2.1/lang_lock.o build/temp.osf1-V5.1-alpha-2.1/lang_map.o build/temp.osf1-V5.1-alpha-2.1/svrv_object.o build/temp.osf1-V5.1-alpha-2.1/pyo.o build/temp.osf1-V5.1-alpha-2.1/try_perlapi.o build/temp.osf1-V5.1-alpha-2.1/perlxsi.o build/temp.osf1-V5.1-alpha-2.1/thrd_ctx.o /usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/local/lib -L/usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE -lperl -lm -liconv -lutil -lpthread -lexc -o build/lib.osf1-V5.1-alpha-2.1/perl2.so -rpath /usr/local/lib/perl5/5.6.1/OSF-dec_osf-thread-multi/CORE
building 'perl' extension
cc -O -Olimit 1500 -I/usr/local/include/python2.1 -c dlhack.c -o build/temp.osf1-V5.1-alpha-2.1/dlhack.o
cc: Warning: dlhack.c, line 39: In the initializer for f, the referenced type of the pointer value "dlsym(...)" is "void", which is not compatible with "function () returning void". (ptrmismatch)
            void (*f)() = dlsym(handle, "initperl2");
--------------------------^
ld -shared -expect_unresolved * build/temp.osf1-V5.1-alpha-2.1/dlhack.o -ldl -o build/lib.osf1-V5.1-alpha-2.1/perl.so
ld:
Can't locate file for: -ldl
error: command 'ld' failed with exit status 1

---------------------------------------------------------------------------------------

Next hack: in setup.py 

	libraries = ["dl"],
changed to 
	libraries = [], 
as dec unix has dlopen et al in libc

resulting in:

-----------------------------------------------------------------------------------------
OSF-madvax root>python setup.py install
running install
running build
running build_py
not copying dbi.py (output up-to-date)
not copying dbi2.py (output up-to-date)
not copying perlpickle.py (output up-to-date)
not copying perlmod.py (output up-to-date)
running build_ext
skipping 'perl2' extension (up-to-date)
building 'perl' extension
skipping dlhack.c (build/temp.osf1-V5.1-alpha-2.1/dlhack.o up-to-date)
ld -shared -expect_unresolved * build/temp.osf1-V5.1-alpha-2.1/dlhack.o -o build/lib.osf1-V5.1-alpha-2.1/perl.so
running install_lib
not copying build/lib.osf1-V5.1-alpha-2.1/dbi.py (output up-to-date)
not copying build/lib.osf1-V5.1-alpha-2.1/dbi2.py (output up-to-date)
not copying build/lib.osf1-V5.1-alpha-2.1/perlpickle.py (output up-to-date)
not copying build/lib.osf1-V5.1-alpha-2.1/perlmod.py (output up-to-date)
copying build/lib.osf1-V5.1-alpha-2.1/perl2.so -> /usr/local/lib/python2.1/site-packages
copying build/lib.osf1-V5.1-alpha-2.1/perl.so -> /usr/local/lib/python2.1/site-packages
skipping byte-compilation of /usr/local/lib/python2.1/site-packages/dbi.py to dbi.pyc
skipping byte-compilation of /usr/local/lib/python2.1/site-packages/dbi2.py to dbi2.pyc
skipping byte-compilation of /usr/local/lib/python2.1/site-packages/perlpickle.py to perlpickle.pyc
skipping byte-compilation of /usr/local/lib/python2.1/site-packages/perlmod.py to perlmod.pyc
-----------------------------------------------------

seems OK!! But checking:

---------------------------------------------------------------------

OSF-madvax root>python test.py
apply.py Traceback (most recent call last):
  File "apply.py", line 1, in ?
    import perl
ImportError: perl2.so not found
............Traceback (most recent call last):
  File "test.py", line 58, in ?
  File "test.py", line 43, in test_ok
UnboundLocalError: local variable 'expect_next' referenced before assignment

-------------------------------------------------------------------------

Where is it expecting perl2.so????  

------------------------------------------------------------------------
OSF-madvax root>ls -al /usr/local/lib/python2.1/site-packages/per*
-rw-r--r--   1 root     system     19360 Oct 17 17:00 /usr/local/lib/python2.1/site-packages/perl.so
-rw-r--r--   1 root     system     98976 Oct 17 17:00 /usr/local/lib/python2.1/site-packages/perl2.so
-rw-r--r--   1 root     system      3566 Mar  7  2001 /usr/local/lib/python2.1/site-packages/perlmod.py
-rw-r--r--   1 root     system      5290 Oct 15 16:17 /usr/local/lib/python2.1/site-packages/perlmod.pyc
-rw-r--r--   1 root     system      5062 Oct 17 12:48 /usr/local/lib/python2.1/site-packages/perlmod.pyo
-rw-r--r--   1 root     system      1310 Mar  7  2001 /usr/local/lib/python2.1/site-packages/perlpickle.py
-rw-r--r--   1 root     system      1636 Oct 15 16:17 /usr/local/lib/python2.1/site-packages/perlpickle.pyc
-rw-r--r--   1 root     system      1570 Oct 17 12:48 /usr/local/lib/python2.1/site-packages/perlpickle.pyo


Installing pyperl on Linux works fine.  If anyone can help with the dec
build, I'd be most grateful.

Thanks,
Roman.                          





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roman Bogoyev, Computer Systems Manager,      email: roman@maths.uwa.edu.au
UWA Maths, 35 Stirling Hwy, Crawley,          phone: +61 8 9380 3379
Western Australia 6009                        fax: +61 8 9380 1028