Tcl Blend & Linux - Almost Works

Tcl Blend & Linux - Almost Works

Post by Clif Flyn » Sun, 03 Jan 1999 04:00:00



I'm trying to get Tcl Blend installed on a RedHat 5.2 Linux system,
and it almost works.  This note is partly to let other folks who
may be interested in Tcl Blend and Linux know what I've done that
worked, and partly to see if anyone has suggestions for where to
go from here.

  There were several preliminary steps to getting to TclBlend.  First
off, the Java supplied with RedHat 5.2 doesn't seem to include
libraries.  I found a java rpm, but that required a Motif library.
So, first LessTif, then Java, then Tcl, then Tcl Blend...

  Here's the steps I've gone through:

1) Install LessTif.  
   I downloaded 'lesstif-current.tar.gz', configured, made, and it
   created libXm.so.1.2.

   I then made a symbolic link from the libXm.so.1.2 to
   /usr/lib/libXm.so.2.

   The jdk rpm file I downloaded required libXm.so.2.

2) Install the jdk kit.  The java supplied with RedHat 5.2 didn't
   seem to have the libraries.  Perhaps I missed something.

   I got jdk-1.1.7.1a-2glibc.i386.rpm and installed it with:
   rpm -iv --test --nodeps jdk-1.1.7.1a-2glibc.i386.rpm

   This installed under /usr/local/jdk1.1.7

3) Download and install Tcl8.0.4
   I downloaded the tcl8.0.4.tar.gz and tk8.0.4.tar.gz from Scriptics,
   configure --enable-shared
   make

4) Download and compile TclBlend
   I downloaded tclBlendSrc1.1a1.tar.gz from Scriptics
   Used symbolic links to make a directory tree that resembled:

   tclBlend1.1a1  tk8.0  tcl8.0

   Made two symbolic links in the java distribution to pass the
   sanity checks in configure:

   ln -s /usr/local/jdk1.1.7/lib/i686 /usr/local/jdk1.1.7/lib/linux
   ln -s /usr/local/jdk1.1.7/include/genunix \
         /usr/local/jdk1.1.7/include/linux

   set the JAVA_HOME environment variable to /usr/local/jdk1.1.7

   configure \    
      --with-javaarchlib=/usr/local/jdk1.1.7/lib/i686/native_threads

   Modify Makefile:
   I added the java library to the libtclblend.so link line.  Without
   this, I got an undefined/unfound library when I tried to load
   libtclblend.so
....
# Build the shared library
libtclblend$(SHLIB_SUFFIX): $(OBJS)
        rm -f libtclblend$(SHLIB_SUFFIX)
        $(SHLIB_LD) $(OBJS) \
        -L/usr/local/jdk1.1.7/lib/i686/native_threads -ljava \
        -o libtclblend$(SHLIB_SUFFIX)
....
   make

  This procedure got me a libtclblend.so that can be loaded into wish,
almost.

  The Java Virtual Machine fails to find classes.zip.

$> wish
% load "./libtclblend.so"
Unable to initialize threads: cannot find class java/lang/Thread
JNI_CreateJavaVM() failed.
Perhaps your CLASSPATH includes a classes.zip file for a version other
the one Tcl Blend was compiled with?
Currently, the CLASSPATH environment variable is set to:
/usr/local/jdk1.1.7/lib:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
The JVM currently is using the following
classpath:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
% set env(CLASSPATH)
/usr/local/jdk1.1.7/lib
% set env(JAVA_HOME)
/usr/local/jdk1.1.7

  I don't have source to the java kit, so I'm at a bit of a loss for
what's happening in the java engine.  Running strings on the libjava.so
indicates that the JVM classpath is initialized as
"%s/../../../classes...", but I couldn't figure out what variable was
being used for the %s.  The obvious choices of JAVA_HOME, CLASSPATH,
and JAVA_CLASSPATH had no effect.

  So, being rude&crude, I copied classes.zip from /local/jdk/lib to /.
This improved matters a little.  The load process takes much longer
before failing.

$> wish8.0
% load "./libtclblend.so"
Can't find class java.lang.System
JNI_CreateJavaVM() failed.
Perhaps your CLASSPATH includes a classes.zip file for a version other
the one Tcl Blend was compiled with?
Currently, the CLASSPATH environment variable is set to:
/usr/local/jdk1.1.7/lib:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
The JVM currently is using the following
classpath:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar

The missing class *seems* to be in classes.zip:

$> unzip -t classes.zip | grep System
    testing: java/lang/System.class   OK
    ...

  If anyone has gotten further than this, I'll be pleased to
hear how far you got and how you got there.

        Clif

------------------------------ Clif Flynt -----------------------
--- Tcl/Tk for Real Programmers - Academic Press Professional ---
----------------   Release Date:  December 1998 -----------------

- In theory there is no difference between theory and practice  -
------------------------ In practice, there is. -----------------

 
 
 

Tcl Blend & Linux - Almost Works

Post by mo » Wed, 06 Jan 1999 04:00:00



> I'm trying to get Tcl Blend installed on a RedHat 5.2 Linux system,
> and it almost works.  This note is partly to let other folks who
> may be interested in Tcl Blend and Linux know what I've done that
> worked, and partly to see if anyone has suggestions for where to
> go from here.

>   There were several preliminary steps to getting to TclBlend.  First
> off, the Java supplied with RedHat 5.2 doesn't seem to include
> libraries.  I found a java rpm, but that required a Motif library.
> So, first LessTif, then Java, then Tcl, then Tcl Blend...

>   Here's the steps I've gone through:

> 1) Install LessTif.
>    I downloaded 'lesstif-current.tar.gz', configured, made, and it
>    created libXm.so.1.2.

>    I then made a symbolic link from the libXm.so.1.2 to
>    /usr/lib/libXm.so.2.

>    The jdk rpm file I downloaded required libXm.so.2.

> 2) Install the jdk kit.  The java supplied with RedHat 5.2 didn't
>    seem to have the libraries.  Perhaps I missed something.

>    I got jdk-1.1.7.1a-2glibc.i386.rpm and installed it with:
>    rpm -iv --test --nodeps jdk-1.1.7.1a-2glibc.i386.rpm

>    This installed under /usr/local/jdk1.1.7

> 3) Download and install Tcl8.0.4
>    I downloaded the tcl8.0.4.tar.gz and tk8.0.4.tar.gz from Scriptics,
>    configure --enable-shared
>    make

> 4) Download and compile TclBlend
>    I downloaded tclBlendSrc1.1a1.tar.gz from Scriptics
>    Used symbolic links to make a directory tree that resembled:

>    tclBlend1.1a1  tk8.0  tcl8.0

>    Made two symbolic links in the java distribution to pass the
>    sanity checks in configure:

>    ln -s /usr/local/jdk1.1.7/lib/i686 /usr/local/jdk1.1.7/lib/linux
>    ln -s /usr/local/jdk1.1.7/include/genunix \
>          /usr/local/jdk1.1.7/include/linux

>    set the JAVA_HOME environment variable to /usr/local/jdk1.1.7

>    configure \
>       --with-javaarchlib=/usr/local/jdk1.1.7/lib/i686/native_threads

>    Modify Makefile:
>    I added the java library to the libtclblend.so link line.  Without
>    this, I got an undefined/unfound library when I tried to load
>    libtclblend.so
> ....
> # Build the shared library
> libtclblend$(SHLIB_SUFFIX): $(OBJS)
>         rm -f libtclblend$(SHLIB_SUFFIX)
>         $(SHLIB_LD) $(OBJS) \
>         -L/usr/local/jdk1.1.7/lib/i686/native_threads -ljava \
>         -o libtclblend$(SHLIB_SUFFIX)
> ....
>    make

>   This procedure got me a libtclblend.so that can be loaded into wish,
> almost.

>   The Java Virtual Machine fails to find classes.zip.

> $> wish
> % load "./libtclblend.so"
> Unable to initialize threads: cannot find class java/lang/Thread
> JNI_CreateJavaVM() failed.
> Perhaps your CLASSPATH includes a classes.zip file for a version other
> the one Tcl Blend was compiled with?
> Currently, the CLASSPATH environment variable is set to:
> /usr/local/jdk1.1.7/lib:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
> The JVM currently is using the following
> classpath:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
> % set env(CLASSPATH)
> /usr/local/jdk1.1.7/lib
> % set env(JAVA_HOME)
> /usr/local/jdk1.1.7

>   I don't have source to the java kit, so I'm at a bit of a loss for
> what's happening in the java engine.  Running strings on the libjava.so
> indicates that the JVM classpath is initialized as
> "%s/../../../classes...", but I couldn't figure out what variable was
> being used for the %s.  The obvious choices of JAVA_HOME, CLASSPATH,
> and JAVA_CLASSPATH had no effect.

>   So, being rude&crude, I copied classes.zip from /local/jdk/lib to /.
> This improved matters a little.  The load process takes much longer
> before failing.

> $> wish8.0
> % load "./libtclblend.so"
> Can't find class java.lang.System
> JNI_CreateJavaVM() failed.
> Perhaps your CLASSPATH includes a classes.zip file for a version other
> the one Tcl Blend was compiled with?
> Currently, the CLASSPATH environment variable is set to:
> /usr/local/jdk1.1.7/lib:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar
> The JVM currently is using the following
> classpath:/../../../classes:/../../classes.zip:/../../classes.jar:/../../rt.jar:/../../i18n.jar

> The missing class *seems* to be in classes.zip:

> $> unzip -t classes.zip | grep System
>     testing: java/lang/System.class   OK
>     ...

>   If anyone has gotten further than this, I'll be pleased to
> hear how far you got and how you got there.

>         Clif

> ------------------------------ Clif Flynt -----------------------
> --- Tcl/Tk for Real Programmers - Academic Press Professional ---
> ----------------   Release Date:  December 1998 -----------------

> - In theory there is no difference between theory and practice  -
> ------------------------ In practice, there is. -----------------

Hi Clif.

I have been working on getting TclBlend running with the linux release
of 1.1.7v1a from blackdown for some time now. Currently, it does not
work
because of problems in the implementation of the native threads port
of the linux jdk. I was running on a RedHat 5.2 system just like you are
and I can tell you that the fault was not yours. I have posted a bug
report about this problem in the blackdown jitterbug database but I have
yet to hear from anyone on the JDK porting team about a fix for this
problem. The JNI_CreateJavaVM function is getting called correctly but
if fails for some reason. If you are looking for a way to "speed things
up"
I think the best thing to do would be to create a really small example
of
the problem that TclBlend is running into and then post it to the
java-linux
mainling list (you can find info on that at www.blackdown.org). Having
to
compile and install Tcl and TclBlend just to see the bug is too much
work.
I was planning on doing this when I had some free time but I have not
got around to it as yet. I can also get you some patches that fix the
configure
problems you are having with TclBlend on linux (for linux-intel and
linux-ppc). Send me an email if you want any of this stuff.

I hope that helps
mo dejong
dejong at cs.umn.edu