Re: JPL - Quite lost...

[email protected] (Eric Martel) 10 Jul 2003 12:00:19 -0400
Newsgroups perl.jpl
Message-ID <1057852819.15027.62.camel@poste161-186>
--=-+x/1Xl0xQ9zsL+gAGoax
Content-Type: multipart/mixed; boundary="=-6caXo0P9sXj3+eG5/HVe"


--=-6caXo0P9sXj3+eG5/HVe
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Le mer 09/07/2003 =E0 17:47, [email protected] a =E9crit :
> > Unfortunately, still not working... :(
>=20
> Did the install-test suite fail...?
>=20
> (We have jdk 1.4 here and we got the expected
>  test output) =20
>=20
> --
> Charles DeRykus

If you're referring to either Sample.jpl or Test.jpl, they both fail. If
you're interested, I enclose three files:

- perl_-V.out, which is an output of "perl -V";

- install-jpl.out, which is the complete output of the install-jpl
script (everything seems fine, only the Sample at the end doesn't work);

- Test.out, which is the output of my attempt to compile and run the
Test.jpl file coming with JPL.

If you have any idea about what else I could try, I would be very
grateful.

--=20
Eric Martel
Sainte-Foy (Qc)
Canada
OpenPGP public key: http://vid.ericmartel.net/pubkey.txt

--=-6caXo0P9sXj3+eG5/HVe
Content-Disposition: attachment; filename=Test.out
Content-Type: text/plain; name=Test.out; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

[root@poste161-186 Test]# pwd
/home/emartel/perl-5.8.0/jpl/Test
[root@poste161-186 Test]# eval `../setvars -sh`
[root@poste161-186 Test]# perl Makefile.PL
[root@poste161-186 Test]# ls
Makefile  Makefile.PL  Test.jpl
[root@poste161-186 Test]# perl -MJPL::Compile -e "file('Test.jpl')"
javac Test.java
javah -jni Test
javap -s Test
perl -c Test.pl
Test.pl syntax OK
[root@poste161-186 Test]# ls
Makefile  Makefile.PL  Test.c  Test.class  Test.h  Test.java  Test.jpl  Tes=
t.pl
[root@poste161-186 Test]# make
cc -fpic -rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.8.0/i686-linux/CORE -s=
hared -L/usr/local/lib -Dbool=3Dchar -I/usr/local/lib/perl5/5.8.0/i686-linu=
x/CORE -I/usr/java/j2sdk1.4.1_03/include -I/usr/java/j2sdk1.4.1_03/include/=
linux -I/usr/java/j2sdk1.4.1_03/include/genunix Test.c \
/usr/local/lib/perl5/5.8.0/i686-linux/CORE/libperl.so \
/usr/java/jpl/lib/i686-linux/libPerlInterpreter.so \
-lc -lm -ldl \
-o libTest.so
[root@poste161-186 Test]# ls
libTest.so*  Makefile  Makefile.PL  Test.c  Test.class  Test.h  Test.java  =
Test.jpl  Test.pl
[root@poste161-186 Test]# java Test
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/emartel/pe=
rl-5.8.0/jpl/Test/libTest.so: /usr/local/lib/perl5/5.8.0/i686-linux/CORE/li=
bperl.so: undefined symbol: crypt
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:832)
        at Test.<clinit>(Test.java:114)
[root@poste161-186 Test]#
--=-6caXo0P9sXj3+eG5/HVe
Content-Disposition: attachment; filename=install-jpl.out
Content-Type: text/plain; name=install-jpl.out; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

[root@poste161-186 jpl]# pwd
/home/emartel/perl-5.8.0/jpl
[root@poste161-186 jpl]# perl install-jpl
JPL_SRC =3D /home/emartel/perl-5.8.0/jpl
JAVA_HOME =3D /usr/java/j2sdk1.4.1_03

You need to decide which directory JPL files are to be installed in.
Applications will look in subdirectories of this directory for any JPL
related files.

You may use the current directory (/home/emartel/perl-5.8.0/jpl)
or you may use a directory such as /usr/java/jpl.

Install JPL files where: [/home/emartel/perl-5.8.0/jpl] /usr/java/jpl
JPL_HOME =3D /usr/java/jpl
Writing setvars...


Starting install...
+ cd JPL
+ perl Makefile.PL
Writing Makefile for JPL::Class
+ make clean
rm -rf ./blib Makefile.aperl blib/arch/auto/JPL/Class/extralibs.all perlmai=
n.c tmon.out mon.out so_locations pm_to_blib *.o *.a perl.exe perl perl  Cl=
ass.bso Class.def libClass.def Class.exp Class.x core core.*perl.*.? *perl.=
core
mv Makefile Makefile.old > /dev/null 2>&1
+ perl Makefile.PL
Writing Makefile for JPL::Class
+ make install
cp AutoLoader.pm blib/lib/JPL/AutoLoader.pm
cp Compile.pm blib/lib/JPL/Compile.pm
cp Class.pm blib/lib/JPL/Class.pm
Writing /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/JPL/Class/.pac=
klist
Appending installation info to /usr/local/lib/perl5/5.8.0/i686-linux/perllo=
cal.pod

Installing PerlInterpreter class
+ cd PerlInterpreter
+ perl Makefile.PL
+ make clean
rm -f libPerlInterpreter.so
rm -f PerlInterpreter.class
+ perl Makefile.PL
+ make install
javac PerlInterpreter.java
javah -jni PerlInterpreter
cc -fpic -rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.8.0/i686-linux/CORE -s=
hared -L/usr/local/lib -Dbool=3Dchar -I/usr/local/lib/perl5/5.8.0/i686-linu=
x/CORE -I/usr/java/j2sdk1.4.1_03/include -I/usr/java/j2sdk1.4.1_03/include/=
linux -I/usr/java/j2sdk1.4.1_03/include/genunix PerlInterpreter.c \
/usr/local/lib/perl5/5.8.0/i686-linux/auto/DynaLoader/DynaLoader.a \
-lc -lm -ldl \
-o libPerlInterpreter.so
mkdir -p /usr/java/jpl/lib/i686-linux
cp libPerlInterpreter.so /usr/java/jpl/lib/i686-linux
cp PerlInterpreter.class /usr/java/jpl/lib

Installing JNI module
+ cd JNI
+ perl Makefile.PL -e
Found jni.h in /usr/java/j2sdk1.4.1_03/include/
Found jni_md.h in /usr/java/j2sdk1.4.1_03/include/linux/
Found libjava.so javai.lib jvm.lib as /usr/java/j2sdk1.4.1_03/jre/lib/i386/=
libjava.so

Found libjvm.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/client/libjvm.so

Found libawt.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/libawt.so

Found libhpi.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/native_threads/libh=
pi.so

Looks like native threads...
We're embedding Perl in Java via libPerlInterpreter.so.
Writing Makefile for JNI
+ make clean
rm -rf JNI.c JNI/* JNI ./blib Makefile.aperl blib/arch/auto/JNI/extralibs.a=
ll perlmain.c tmon.out mon.out so_locations pm_to_blib *.o *.a perl.exe per=
l perl JNI.bs JNI.bso JNI.def libJNI.def JNI.exp JNI.x core core.*perl.*.? =
*perl.core
mv Makefile Makefile.old > /dev/null 2>&1
+ perl Makefile.PL -e
Found jni.h in /usr/java/j2sdk1.4.1_03/include/
Found jni_md.h in /usr/java/j2sdk1.4.1_03/include/linux/
Found libjava.so javai.lib jvm.lib as /usr/java/j2sdk1.4.1_03/jre/lib/i386/=
libjava.so

Found libjvm.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/client/libjvm.so

Found libawt.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/libawt.so

Found libhpi.so as /usr/java/j2sdk1.4.1_03/jre/lib/i386/native_threads/libh=
pi.so

Looks like native threads...
We're embedding Perl in Java via libPerlInterpreter.so.
Writing Makefile for JNI
+ make
cp JNI/Config.pm blib/lib/JNI/Config.pm
cp JNI.pm blib/lib/JNI.pm
AutoSplitting blib/lib/JNI.pm (blib/lib/auto/JNI)
/usr/bin/perl ../../lib/ExtUtils/xsubpp  -typemap ../../lib/ExtUtils/typema=
p -typemap typemap  JNI.xs > JNI.xsc && mv JNI.xsc JNI.c
cc -c  -I/usr/java/j2sdk1.4.1_03/include/ -I/usr/java/j2sdk1.4.1_03/include=
/linux/ -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64  =
-D_REENTRANT -DEMBEDDEDPERL -O3   -DVERSION=3D\"0.1\" -DXS_VERSION=3D\"0.1\=
" -fpic "-I../.."   JNI.c
JNI.xs: In function `XS_JNI_GetJavaVM':
JNI.xs:3244: warning: passing arg 2 of `JNI_CreateJavaVM' from incompatible=
 pointer type
Running Mkbootstrap for JNI ()
chmod 644 JNI.bs
rm -f blib/arch/auto/JNI/JNI.so
LD_RUN_PATH=3D"/usr/java/j2sdk1.4.1_03/jre/lib/i386:/usr/java/j2sdk1.4.1_03=
/jre/lib/i386/client:/usr/java/j2sdk1.4.1_03/jre/lib/i386/native_threads:/u=
sr/java/jpl/lib/i686-linux" cc  -shared -L/usr/local/lib JNI.o  -o blib/arc=
h/auto/JNI/JNI.so   -L/usr/local/lib/perl5/5.8.0/i686-linux/CORE -L/usr/jav=
a/j2sdk1.4.1_03/jre/lib/i386/ -L/usr/java/j2sdk1.4.1_03/jre/lib/i386/client=
/ -L/usr/java/j2sdk1.4.1_03/jre/lib/i386/native_threads/ -L/usr/java/j2sdk1=
.4.1_03/jre/lib/i386/ -L/usr/java/jpl/lib/i686-linux -ljava -ljvm -lhpi -la=
wt -lPerlInterpreter
chmod 755 blib/arch/auto/JNI/JNI.so
cp JNI.bs blib/arch/auto/JNI/JNI.bs
chmod 644 blib/arch/auto/JNI/JNI.bs
Manifying blib/man3/JNI.3
+ echo 'Attempting to install JNI as root'
Attempting to install JNI as root
+ su root -c 'make install'
Files found in blib/arch: installing files in blib/lib into architecture de=
pendent library tree
Writing /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/JNI/.packlist
Appending installation info to /usr/local/lib/perl5/5.8.0/i686-linux/perllo=
cal.pod

Installing Sample JPL program
+ cd Sample
+ perl Makefile.PL
+ make clean
rm -f Sample.c Sample.h \
Sample*.class Sample*.pl libSample.so Sample*.java
+ perl Makefile.PL
+ make install
perl5.008 -MJPL::Compile -e "file('Sample.jpl')"
javac Sample.java
javah -jni Sample
javap -s Sample
perl -c Sample.pl
Sample.pl syntax OK
cc -fpic -rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.8.0/i686-linux/CORE -s=
hared -L/usr/local/lib -Dbool=3Dchar -I/usr/local/lib/perl5/5.8.0/i686-linu=
x/CORE -I/usr/java/j2sdk1.4.1_03/include -I/usr/java/j2sdk1.4.1_03/include/=
linux -I/usr/java/j2sdk1.4.1_03/include/genunix Sample.c \
/usr/local/lib/perl5/5.8.0/i686-linux/CORE/libperl.so \
/usr/java/jpl/lib/i686-linux/libPerlInterpreter.so \
-lc -lm -ldl \
-o libSample.so
cp *.class              /usr/java/jpl/lib
cp libSample.so /usr/java/jpl/lib/i686-linux
cp Sample.pl            /usr/java/jpl/perl


Testing Sample...
+ cd Sample
+ JPLDEBUG=3D1
+ export JPLDEBUG
+ java Sample
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/emartel/pe=
rl-5.8.0/jpl/Sample/libSample.so: /usr/local/lib/perl5/5.8.0/i686-linux/COR=
E/libperl.so: undefined symbol: crypt
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:832)
        at Sample.<clinit>(Sample.java:47)
Couldn't run Sample
[root@poste161-186 jpl]#
--=-6caXo0P9sXj3+eG5/HVe
Content-Disposition: attachment; filename=perl_-V.out
Content-Type: text/plain; name=perl_-V.out; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

[root@poste161-186 Test]# perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=3Dlinux, osvers=3D2.4.19-16mdk, archname=3Di686-linux
    uname=3D'linux poste161-186 2.4.19-16mdk #1 fri sep 20 18:15:05 cest 20=
02 i686 unknown unknown gnulinux '
    config_args=3D'-DJPL'
    hint=3Drecommended, useposix=3Dtrue, d_sigaction=3Ddefine
    usethreads=3Dundef use5005threads=3Dundef useithreads=3Dundef usemultip=
licity=3Dundef
    useperlio=3Ddefine d_sfio=3Dundef uselargefiles=3Ddefine usesocks=3Dund=
ef
    use64bitint=3Dundef use64bitall=3Dundef uselongdouble=3Dundef
    usemymalloc=3Dn, bincompat5005=3Dundef
  Compiler:
    cc=3D'cc', ccflags =3D'-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE=
_OFFSET_BITS=3D64',
    optimize=3D'-O3',
    cppflags=3D'-fno-strict-aliasing'
    ccversion=3D'', gccversion=3D'3.2 (Mandrake Linux 9.0 3.2-1mdk)', gccos=
andvers=3D''
    intsize=3D4, longsize=3D4, ptrsize=3D4, doublesize=3D8, byteorder=3D123=
4
    d_longlong=3Ddefine, longlongsize=3D8, d_longdbl=3Ddefine, longdblsize=
=3D12
    ivtype=3D'long', ivsize=3D4, nvtype=3D'double', nvsize=3D8, Off_t=3D'of=
f_t', lseeksize=3D8
    alignbytes=3D4, prototype=3Ddefine
  Linker and Libraries:
    ld=3D'cc', ldflags =3D' -L/usr/local/lib'
    libpth=3D/usr/local/lib /lib /usr/lib
    libs=3D-lnsl -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=3D-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=3D/lib/libc-2.2.5.so, so=3Dso, useshrplib=3Dtrue, libperl=3Dlibper=
l.so
    gnulibc_version=3D'2.2.5'
  Dynamic Linking:
    dlsrc=3Ddl_dlopen.xs, dlext=3Dso, d_dlsymun=3Dundef, ccdlflags=3D'-rdyn=
amic -Wl,-rpath,/usr/local/lib/perl5/5.8.0/i686-linux/CORE'
    cccdlflags=3D'-fpic', lddlflags=3D'-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jul 10 2003 09:48:25
  %ENV:
    PERL5LIB=3D"/usr/java/jpl/perl"
  @INC:
    /usr/java/jpl/perl
    /usr/local/lib/perl5/5.8.0/i686-linux
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    .
[root@poste161-186 Test]#
--=-6caXo0P9sXj3+eG5/HVe--

--=-+x/1Xl0xQ9zsL+gAGoax
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA/DY2T8B7YqO0/GRwRAig1AJ9k2vnW8Xj+4njP5NZnlw2zIwzU4QCeJX1G
hFvf9QYvm8NmlOtfYNz8rXw=
=uToP
-----END PGP SIGNATURE-----

--=-+x/1Xl0xQ9zsL+gAGoax--