Philip,

Thanks for the help.  Mac's don't typically use or have defined JAVA_HOME, etc, 
though you can set them for installers that require them.  The configure script 
for this package checks if you are on a Mac and tries to deal with that, but I 
don't think it is doing so correctly on at least 2 counts.

I can't use your "get it running on one machine and then manually move it to 
another similar machine" approach because I have not been able to get this to 
run on any of the Macs I have access to at this time (unfortunately, they are 
all configured the same (Mac OS X 10.6, Java 1.6.0_20, etc) so no surprise 
there).

Anyway, here is more info on my more recent attempts:

I have tried repackaging the archive file using tar and gzip at the MacOS X 
Unix command line.  That didn't change anything.  I looked at the line in the 
configure file given by the 1st log and this is where it is trying to determine 
what version of Java I have installed (and yes, I have the development tools 
installed).  I added some echo statements to try and figure out what is going 
on and it seems to be having trouble extracting the right version codes.  So, I 
hard-coded in the version I have and repackaged it into a new archive file and 
tried that.  This got me past that warning message, but it still failed.  See 
the following log:

Attempt #2 with Java version hard coded into configure script:
----------------
octave:1> pkg -verbose install java_new.tar.gz 
mkoctfile: unrecognized argument 
/System/Library/Frameworks/JavaVM.framework/Home\"
make: *** [__java__.oct] Error 1
mkdir (/var/tmp/oct-BWHT6d)
untar (java_new.tar.gz, /var/tmp/oct-BWHT6d)
checking for gcc... /opt/local/bin/gcc-mp-4.4
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc-mp-4.4 accepts -g... yes
checking for /opt/local/bin/gcc-mp-4.4 option to accept ISO C89... none needed
checking for mkoctfile... mkoctfile
retrieving compile and link flags from mkoctfile
checking for F77_FUNC... yes
checking for octave... octave
checking for OCTAVE_VERSION in Octave... 3.2.4
checking for octave_config_info('canonical_host_type') in Octave... 
i386-apple-darwin10.4.0
checking for octave_config_info('SHLEXT') in Octave... dylib
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for strip... strip
checking for java... java
checking for javac... javac
checking for jar... jar
checking for Java version... 1.6.0_20
java_major=-n 1.6.0_20
java_minor=-n 1.6.0_20
configure: creating ./config.status
config.status: creating Makeconf
 
  "$prefix" is /Users/huwaldtj/octave/java-1.2.7
  "$exec_prefix" is ${prefix}

octave commands will install into the following directories:
   m-files:   /opt/local/share/octave/3.2.4/site/m/octave-forge
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/oct/i386-apple-darwin10.4.0/octave-forge
   binaries:  /opt/local/libexec/octave/3.2.4/site/exec/i386-apple-darwin10.4.0
alternatives:
   m-files:   /opt/local/share/octave/3.2.4/site/octave-forge-alternatives/m
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/octave-forge-alternatives/oct/i386-apple-darwin10.4.0

shell commands will install into the following directories:
   binaries:  ${exec_prefix}/bin
   man pages: ${datarootdir}/man
   libraries: ${exec_prefix}/lib
   headers:   ${prefix}/include

octave-forge is configured with
   octave:      octave (version 3.2.4)
   mkoctfile:   mkoctfile for Octave 4
   java:        yes

find . -name NOINSTALL -print    # shows which toolboxes won't be installed

'make' returned the following error: if [ 
"X/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm_compat.dylibX" = 
"XX" ]; then \
                mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD 
-I/System/Library/Frameworks/JavaVM.framework/Home/include -o __java__.oct 
__java__.cc ; \
        else \
                mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD 
-DJAVA_ARCH=\\\"/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm_compat.dylib\\\"
 -DJAVA_HOME=\\\"-n /System/Library/Frameworks/JavaVM.framework/Home\\\" 
-I/System/Library/Frameworks/JavaVM.framework/Home/include -o __java__.oct 
__java__.cc ; \
        fi
error: called from `pkg>configure_make' in file 
/opt/local/share/octave/3.2.4/m/pkg/pkg.m near line 1253, column 2
error: called from:
error:   /opt/local/share/octave/3.2.4/m/pkg/pkg.m at line 714, column 5
error:   /opt/local/share/octave/3.2.4/m/pkg/pkg.m at line 287, column 7
----------------

You can see above where I echoed out what it was extracting for major and minor 
java version:
java_major=-n 1.6.0_20
java_minor=-n 1.6.0_20

It obviously wasn't parsing the Java version string properly.  Anyway, I 
hard-coded those  as 1 and 6 respectively and it continued on giving this error:
mkoctfile: unrecognized argument 
/System/Library/Frameworks/JavaVM.framework/Home\"

JAVA_HOME on any Mac is "/System/Library/Frameworks/JavaVM.framework/Home".

Somewhere it seems to have stuck a Windows style file separator, "\", on the 
end rather than a unix one, "/".  Not sure if that's the problem or not.

The above 2 attempts were without me explicitly setting the JAVA_HOME, etc.  So 
now, let me do that for the variables that the configure script is trying to 
set up:

At the unix command line:
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
export 
JAVA_ARCH="/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib"
export JAVA_INCS="-I${JAVA_HOME}/include"


Attempt #3 with Java version hard coded in configure and JAVA_HOME, JAVA_ARCH 
and JAVA_INCS set at unix command line:
----------------
octave:1> getenv ("JAVA_HOME")
ans = /System/Library/Frameworks/JavaVM.framework/Home
octave:3> getenv("JAVA_ARCH") 
ans = /System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib
octave:4> pkg -verbose install java_new.tar.gz 
mkdir (/var/tmp/oct-yrW92s)
untar (java_new.tar.gz, /var/tmp/oct-yrW92s)
checking for gcc... /opt/local/bin/gcc-mp-4.4
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc-mp-4.4 accepts -g... yes
checking for /opt/local/bin/gcc-mp-4.4 option to accept ISO C89... none needed
checking for mkoctfile... mkoctfile
retrieving compile and link flags from mkoctfile
checking for F77_FUNC... yes
checking for octave... octave
checking for OCTAVE_VERSION in Octave... 3.2.4
checking for octave_config_info('canonical_host_type') in Octave... 
i386-apple-darwin10.4.0
checking for octave_config_info('SHLEXT') in Octave... dylib
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for strip... strip
checking for java... /System/Library/Frameworks/JavaVM.framework/Home/bin/java
checking for javac... /System/Library/Frameworks/JavaVM.framework/Home/bin/javac
checking for jar... /System/Library/Frameworks/JavaVM.framework/Home/bin/jar
checking for Java version... 1.6.0_20
java_major=-n 1.6.0_20
java_minor=-n 1.6.0_20
configure: creating ./config.status
config.status: creating Makeconf
 
  "$prefix" is /Users/huwaldtj/octave/java-1.2.7
  "$exec_prefix" is ${prefix}

octave commands will install into the following directories:
   m-files:   /opt/local/share/octave/3.2.4/site/m/octave-forge
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/oct/i386-apple-darwin10.4.0/octave-forge
   binaries:  /opt/local/libexec/octave/3.2.4/site/exec/i386-apple-darwin10.4.0
alternatives:
   m-files:   /opt/local/share/octave/3.2.4/site/octave-forge-alternatives/m
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/octave-forge-alternatives/oct/i386-apple-darwin10.4.0

shell commands will install into the following directories:
   binaries:  ${exec_prefix}/bin
   man pages: ${datarootdir}/man
   libraries: ${exec_prefix}/lib
   headers:   ${prefix}/include

octave-forge is configured with
   octave:      octave (version 3.2.4)
   mkoctfile:   mkoctfile for Octave 4
   java:        Java Development Kit not found

find . -name NOINSTALL -print    # shows which toolboxes won't be installed

Java support not compiled
----------------

Still no dice. This got rid of the error message in attempt #2 (so, even if 
configure picked up the right Java version it still wasn't formatting the 
JAVA_HOME correctly.  But it still seems to believe that there is no JDK.  
Looking at configure, it appears that if you define both JAVA_HOME and 
JAVA_ARCH, then the flag it uses to indicate it has found the JDK, "HAVE_JAVA", 
is never set.  Let's fix that so that if you have JAVA_HOME and JAVA_ARCH 
defined set HAVE_JAVA to yes, and try again:


Attempt #4 with "HAVE_JAVA" being set properly if JAVA_HOME and JAVA_ARCH are 
set before calling configure:
----------------
octave:1> pkg -verbose install java_new.tar.gz 
mkoctfile: unrecognized argument 
/System/Library/Frameworks/JavaVM.framework/Home\"
make: *** [__java__.oct] Error 1
mkdir (/var/tmp/oct-FNcYTk)
untar (java_new.tar.gz, /var/tmp/oct-FNcYTk)
checking for gcc... /opt/local/bin/gcc-mp-4.4
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc-mp-4.4 accepts -g... yes
checking for /opt/local/bin/gcc-mp-4.4 option to accept ISO C89... none needed
checking for mkoctfile... mkoctfile
retrieving compile and link flags from mkoctfile
checking for F77_FUNC... yes
checking for octave... octave
checking for OCTAVE_VERSION in Octave... 3.2.4
checking for octave_config_info('canonical_host_type') in Octave... 
i386-apple-darwin10.4.0
checking for octave_config_info('SHLEXT') in Octave... dylib
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for strip... strip
checking for java... /System/Library/Frameworks/JavaVM.framework/Home/bin/java
checking for javac... /System/Library/Frameworks/JavaVM.framework/Home/bin/javac
checking for jar... /System/Library/Frameworks/JavaVM.framework/Home/bin/jar
checking for Java version... 1.6.0_20
java_major=-n 1.6.0_20
java_minor=-n 1.6.0_20
configure: creating ./config.status
config.status: creating Makeconf
 
  "$prefix" is /Users/huwaldtj/octave/java-1.2.7
  "$exec_prefix" is ${prefix}

octave commands will install into the following directories:
   m-files:   /opt/local/share/octave/3.2.4/site/m/octave-forge
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/oct/i386-apple-darwin10.4.0/octave-forge
   binaries:  /opt/local/libexec/octave/3.2.4/site/exec/i386-apple-darwin10.4.0
alternatives:
   m-files:   /opt/local/share/octave/3.2.4/site/octave-forge-alternatives/m
   oct-files: 
/opt/local/libexec/octave/3.2.4/site/octave-forge-alternatives/oct/i386-apple-darwin10.4.0

shell commands will install into the following directories:
   binaries:  ${exec_prefix}/bin
   man pages: ${datarootdir}/man
   libraries: ${exec_prefix}/lib
   headers:   ${prefix}/include

octave-forge is configured with
   octave:      octave (version 3.2.4)
   mkoctfile:   mkoctfile for Octave 4
   java:        yes

find . -name NOINSTALL -print    # shows which toolboxes won't be installed

'make' returned the following error: if [ 
"X/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylibX" = "XX" 
]; then \
                mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD 
-I/System/Library/Frameworks/JavaVM.framework/Home/include -o __java__.oct 
__java__.cc ; \
        else \
                mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD 
-DJAVA_ARCH=\\\"/System/Library/Frameworks/JavaVM.framework/Libraries/libjvm.dylib\\\"
 -DJAVA_HOME=\\\"-n /System/Library/Frameworks/JavaVM.framework/Home\\\" 
-I/System/Library/Frameworks/JavaVM.framework/Home/include -o __java__.oct 
__java__.cc ; \
        fi
error: called from `pkg>configure_make' in file 
/opt/local/share/octave/3.2.4/m/pkg/pkg.m near line 1253, column 2
error: called from:
error:   /opt/local/share/octave/3.2.4/m/pkg/pkg.m at line 714, column 5
error:   /opt/local/share/octave/3.2.4/m/pkg/pkg.m at line 287, column 7
----------------

Now we are back to the same error messages as attempt #2.  So the problem must 
be downstream from where configure is setting up JAVA_HOME, JAVA_ARCH and 
HAVE_JAVA.


Any other ideas?

Thanks.

Joe Huwaldt



-----Original Message-----
From: Philip Nienhuis [mailto:pr.nienh...@hccnet.nl]
Sent: Thu 9/2/2010 7:48 AM
To: Huwaldt, Joseph A.; octave-dev@lists.sourceforge.net
Subject: Re: [OctDev] Unable to install java-1.2.7 package on MacOS X...
 
Hi Joseph:

Joseph A. Huwaldt wrote:
> Trying to install java-1.2.7 package on MacOS X 10.6 with:
>
> ver
> ----------------------------------------------------------------------
> GNU Octave Version 3.2.4
> GNU Octave License: GNU General Public License
> Operating System: Darwin 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23
> 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
> ----------------------------------------------------------------------
> Package Name   | Version | Installation directory
> ---------------+---------+-----------------------
>             io *|  1.0.13 | /Users/huwaldtj/octave/io-1.0.13
> miscellaneous *|   1.0.9 | /Users/huwaldtj/octave/miscellaneous-1.0.9
>          nurbs *|   1.3.0 | /Users/huwaldtj/octave/nurbs-1.3.0
>     statistics *|   1.0.7 | /Users/huwaldtj/octave/statistics-1.0.7
>
>
> I get the following:
>
> pkg -verbose install java-1.2.7.tar.gz
> ./configure: line 3257: test: too many arguments
> configure: WARNING: this package requires at least Java-1.5

^^^^
These two lines make me think of .tar.gz. format issues, see below.

> mkdir (/var/tmp/oct-PjTt25)
> untar (java-1.2.7.tar.gz, /var/tmp/oct-PjTt25)
> checking for gcc... /opt/local/bin/gcc-mp-4.4
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether /opt/local/bin/gcc-mp-4.4 accepts -g... yes
> checking for /opt/local/bin/gcc-mp-4.4 option to accept ISO C89... none
> needed
> checking for mkoctfile... mkoctfile
> retrieving compile and link flags from mkoctfile
> checking for F77_FUNC... yes
> checking for octave... octave
> checking for OCTAVE_VERSION in Octave... 3.2.4
> checking for octave_config_info('canonical_host_type') in Octave...
> i386-apple-darwin10.4.0
> checking for octave_config_info('SHLEXT') in Octave... dylib
> checking whether ln -s works... yes
> checking for ranlib... ranlib
> checking for strip... strip
> checking for java... java
> checking for javac... javac
> checking for jar... jar
> checking for Java version... 1.6.0_20
> configure: creating ./config.status
> config.status: creating Makeconf
>
>    "$prefix" is /Users/huwaldtj/octave/java-1.2.7
>    "$exec_prefix" is ${prefix}
>
> octave commands will install into the following directories:
>     m-files:   /opt/local/share/octave/3.2.4/site/m/octave-forge
>     oct-files:
> /opt/local/libexec/octave/3.2.4/site/oct/i386-apple-darwin10.4.0/octave-forg
> e
>     binaries:
> /opt/local/libexec/octave/3.2.4/site/exec/i386-apple-darwin10.4.0
> alternatives:
>     m-files:   /opt/local/share/octave/3.2.4/site/octave-forge-alternatives/m
>     oct-files:
> /opt/local/libexec/octave/3.2.4/site/octave-forge-alternatives/oct/i386-appl
> e-darwin10.4.0
>
> shell commands will install into the following directories:
>     binaries:  ${exec_prefix}/bin
>     man pages: ${datarootdir}/man
>     libraries: ${exec_prefix}/lib
>     headers:   ${prefix}/include
>
> octave-forge is configured with
>     octave:      octave (version 3.2.4)
>     mkoctfile:   mkoctfile for Octave 4
>     java:        Java Development Kit not found
>
> find . -name NOINSTALL -print    # shows which toolboxes won't be installed
>
> Java support not compiled
>
>
> I have Java 1.6.0 (as it shows above) and all the java development tools on
> are on my path.  I have made many several attempts at this by setting
> $JAVA_HOME, $JAVA_ARCH, putting $JAVA_HOME on my PATH, putting
> $JAVA_HOME/bin on my path.  No luck.  Can anyone help with this?

(Please report back to the list on whether the hints below help you out.)

You have java-1.6, OK, but is it the runtime (jre) or the development 
kit (jdk - that's the one that is needed)?
(I suppose the latter as the java archiver is found, TTBOMK jar is not 
in the jre, so you should be OK then).

In octave, do
   getenv ("JAVA_HOME")
and see if it echoes the /full/path/to/the/jdk directory.
If not, do
   setenv ("JAVA_HOME", "/full/path/to/jdk/directory")
(forward slashes, e.g. /usr/lib/jvm/.../jdk_1.6.0_20)
and check again with getenv()

BTW I found that the java package can sometimes be hard to install for 
no apparent reason. On one of my Windows boxes it simply refuses to get 
installed although that box has the exact same setup as my other boxes; 
I worked around that by copying the octave/java packages directories 
(<>/share/octave/packages  and  <>/lib[exec]/octave/packages) from 
another Windows box with proper octave/java installation to that box and do
   pkg rebuild -auto java
to get it, uhm, "installed". It worked OK then. Perhaps a similar trick 
works on OSX too.

A not quite impossible gotcha is .tar.gz format problems. Several times 
I've repacked a stubborn java package using 7zip (by inserting a random 
small text file into it and have 7zip update the package on disk), after 
that it did install OK. (Now, 7zip is what I used on Windows, on OSX 
there may be similar tools.)
In such occasions I often saw similar configure messages as in your log 
above.

Good luck,

Philip
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to