Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread David Rush
Alright, since jni_md.h was referenced from jni.h, I tried copying jni_md.h
into the same directory as jni.h, which seems to have helped.  Or at least
got to the next error:

gnm_wrap.cpp:471:21: warning: unused function 'SWIG_JavaArrayOutDouble'
[-Wunused-function]
static jdoubleArray SWIG_JavaArrayOutDouble (JNIEnv *jenv, double *result,
jsize sz);
^
94 warnings generated.
/bin/sh /Users/david/w/gdal/gdal-3.0.4/libtool --mode=link --silent g++
-std=c++11 -dynamiclib -single_module -flat_namespace -undefined suppress
gdalconst_wrap.lo gdal_wrap.lo osr_wrap.lo ogr_wrap.lo gnm_wrap.lo
 /Users/david/w/gdal/gdal-3.0.4/libgdal.la -o libgdalalljni.la -rpath
/usr/local/lib -no-undefined -version-info 26:4:0
libtool:   error: cannot find the library '/Users/david/w/gdal/gdal-3.0.4/
libgdal.la' or unhandled argument '/Users/david/w/gdal/gdal-3.0.4/libgdal.la
'
make: *** [libgdalalljni.la] Error 1

Indeed gdal-3.0.4/libgdal.la isn't there.  How do I get it?

David

On Mon, Apr 27, 2020 at 1:26 PM David Rush  wrote:

> Andrew:
>
> That's what I thought.  I do have the JDK (OpenJDK 11.0.2).
>
> Ah, found it.  I think I may have both a JRE and JVM confusing things
> (confusing me, at least).  Both appear to be the same version, at least.
>
> I've changed my JAVA_HOME in java.opt to reflect where my JDK is
> installed.  Also had to change the JAVA_INCLUDE in java.opt because jni.h
> is under $JAVA_HOME/include rather than $JAVA_HOME/Headers.
>
> Then it couldn't find "jni_md.h" (machine dependent things, apparently).
> I found it in my JDK installation, and copied it to the current directory
> (gdal/swig/java), but it still can't seem to find it:
>
> In file included from gdalconst_wrap.c:154:
> /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/include/jni.h:45:10:
> fatal error: 'jni_md.h' file not found
> #include "jni_md.h"
>
> Since the include is in quotes, it should be looking in the current
> directory for it, right?  The gdalconst_wrap.c file is in the current
> directory, so I'm in the right place.
>
> Suggestions?
>
> David
>
> On Mon, Apr 27, 2020 at 11:52 AM Andrew C Aitchison <
> and...@aitchison.me.uk> wrote:
>
>> On Mon, 27 Apr 2020, David Rush wrote:
>>
>> > Ivan:
>> >
>> > Thanks!  That worked.  On to the next error (with make in
>> gdal/swig/java)
>> > ...
>> >
>> > gdalconst_wrap.c:154:10: fatal error: 'jni.h' file not found
>> > #include 
>> > ^~~
>> > 1 error generated.
>> > make: *** [gdalconst_wrap.lo] Error 1
>> >
>> > Where *should* jni.h come from?  I can't find it anywhere in my Java
>> > installation.
>>
>> I believe it should be in the JDK (Java Development Kit)
>> - do you just have the JRE or Java Runtime Environment ?
>>
>> --
>> Andrew C. Aitchison Kendal, UK
>> and...@aitchison.me.uk
>>
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread David Rush
Andrew:

That's what I thought.  I do have the JDK (OpenJDK 11.0.2).

Ah, found it.  I think I may have both a JRE and JVM confusing things
(confusing me, at least).  Both appear to be the same version, at least.

I've changed my JAVA_HOME in java.opt to reflect where my JDK is
installed.  Also had to change the JAVA_INCLUDE in java.opt because jni.h
is under $JAVA_HOME/include rather than $JAVA_HOME/Headers.

Then it couldn't find "jni_md.h" (machine dependent things, apparently).  I
found it in my JDK installation, and copied it to the current directory
(gdal/swig/java), but it still can't seem to find it:

In file included from gdalconst_wrap.c:154:
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/include/jni.h:45:10:
fatal error: 'jni_md.h' file not found
#include "jni_md.h"

Since the include is in quotes, it should be looking in the current
directory for it, right?  The gdalconst_wrap.c file is in the current
directory, so I'm in the right place.

Suggestions?

David

On Mon, Apr 27, 2020 at 11:52 AM Andrew C Aitchison 
wrote:

> On Mon, 27 Apr 2020, David Rush wrote:
>
> > Ivan:
> >
> > Thanks!  That worked.  On to the next error (with make in gdal/swig/java)
> > ...
> >
> > gdalconst_wrap.c:154:10: fatal error: 'jni.h' file not found
> > #include 
> > ^~~
> > 1 error generated.
> > make: *** [gdalconst_wrap.lo] Error 1
> >
> > Where *should* jni.h come from?  I can't find it anywhere in my Java
> > installation.
>
> I believe it should be in the JDK (Java Development Kit)
> - do you just have the JRE or Java Runtime Environment ?
>
> --
> Andrew C. Aitchison Kendal, UK
> and...@aitchison.me.uk
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread Andrew C Aitchison

On Mon, 27 Apr 2020, David Rush wrote:


Ivan:

Thanks!  That worked.  On to the next error (with make in gdal/swig/java)
...

gdalconst_wrap.c:154:10: fatal error: 'jni.h' file not found
#include 
^~~
1 error generated.
make: *** [gdalconst_wrap.lo] Error 1

Where *should* jni.h come from?  I can't find it anywhere in my Java
installation.


I believe it should be in the JDK (Java Development Kit)
- do you just have the JRE or Java Runtime Environment ?

--
Andrew C. Aitchison Kendal, UK
and...@aitchison.me.uk
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread David Rush
Ivan:

Thanks!  That worked.  On to the next error (with make in gdal/swig/java)
...

gdalconst_wrap.c:154:10: fatal error: 'jni.h' file not found
#include 
 ^~~
1 error generated.
make: *** [gdalconst_wrap.lo] Error 1

Where *should* jni.h come from?  I can't find it anywhere in my Java
installation.

David

On Mon, Apr 27, 2020 at 8:18 AM Ivan Lucena  wrote:

> Hi David,
>
> I am in the process of refreshing my GDAL building process in a Mac, so I
> might be able to help with that question.
>
> You need to install SWIG in your machine. And one way to do that is using
> the HomeBrewer [brew.sh] another is Anaconda [anaconda.com]
>
> $ brew install swig
>
> or
>
> $ conda install swig
>
> Homebrew mess with you OS and Apple updates might mess with your brew
> installed software. Anaconda keeps it all in a user sub-folder. It is up
> to you.
>
> I am not interested in building the Java binding, only Python, but once
> upon a time I remember I could get all you need "just" by installing uDig [
> udig.refractions.net]. I mean, the GDAL Java binding was included and
> ready to use.
>
> Regards,
>
> Ivan
>
>
>
> --
> *From:* gdal-dev  on behalf of David
> Rush 
> *Sent:* Monday, April 27, 2020 10:02 AM
> *To:* gdal-dev@lists.osgeo.org 
> *Subject:* Re: [gdal-dev] Building for Java on MacOS
>
> Thank you, Evan.  That got me to the next error:
>
> /bin/sh: swig: command not found
> make: *** [gdal_wrap.cpp] Error 127
>
> Where/how does the "swig" script or binary come from?
>
> David
>
> On Mon, Apr 27, 2020 at 7:11 AM Even Rouault 
> wrote:
>
> On lundi 27 avril 2020 07:03:28 CEST David Rush wrote:
>
> > All:
>
> >
>
> > I think I finally found some instructions for building the Java stuff I
>
> > need:
>
> >
>
> > https://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix
>
> >
>
> > That includes some notes for MacOS. Yay.
>
> >
>
> > I've set up my java.opt per this link referenced in the above link:
>
> >
>
> > https://trac.osgeo.org/gdal/ticket/2401
>
> >
>
> > But when I run "make" from the swig/java directory, I get this error:
>
> >
>
> > GNUmakefile:1: ../../GDALmake.opt: No such file or directory
>
> > make: *** No rule to make target `../../GDALmake.opt'. Stop.
>
> >
>
> > I did a search with "find" but I don't seem to have that file.
>
>
>
> You need to run ./configure to generate it. And it is strongly advise that
> you run the Java bindings against the same version of the native library
> for which they have been generated.
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>
>
>
> E-Mail to and from me, in connection with the transaction
> of public business, is subject to the Wyoming Public Records
> Act and may be disclosed to third parties.
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread Ivan Lucena
Hi David,

I am in the process of refreshing my GDAL building process in a Mac, so I might 
be able to help with that question.

You need to install SWIG in your machine. And one way to do that is using the 
HomeBrewer [brew.sh] another is Anaconda [anaconda.com]

$ brew install swig

or

$ conda install swig

Homebrew mess with you OS and Apple updates might mess with your brew installed 
software. Anaconda keeps it all in a user sub-folder. It is up to you.

I am not interested in building the Java binding, only Python, but once upon a 
time I remember I could get all you need "just" by installing uDig 
[udig.refractions.net]. I mean, the GDAL Java binding was included and ready to 
use.

Regards,

Ivan




From: gdal-dev  on behalf of David Rush 

Sent: Monday, April 27, 2020 10:02 AM
To: gdal-dev@lists.osgeo.org 
Subject: Re: [gdal-dev] Building for Java on MacOS

Thank you, Evan.  That got me to the next error:

/bin/sh: swig: command not found
make: *** [gdal_wrap.cpp] Error 127

Where/how does the "swig" script or binary come from?

David

On Mon, Apr 27, 2020 at 7:11 AM Even Rouault 
mailto:even.roua...@spatialys.com>> wrote:

On lundi 27 avril 2020 07:03:28 CEST David Rush wrote:

> All:

>

> I think I finally found some instructions for building the Java stuff I

> need:

>

> https://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix

>

> That includes some notes for MacOS. Yay.

>

> I've set up my java.opt per this link referenced in the above link:

>

> https://trac.osgeo.org/gdal/ticket/2401

>

> But when I run "make" from the swig/java directory, I get this error:

>

> GNUmakefile:1: ../../GDALmake.opt: No such file or directory

> make: *** No rule to make target `../../GDALmake.opt'. Stop.

>

> I did a search with "find" but I don't seem to have that file.



You need to run ./configure to generate it. And it is strongly advise that you 
run the Java bindings against the same version of the native library for which 
they have been generated.



--

Spatialys - Geospatial professional services

http://www.spatialys.com


E-Mail to and from me, in connection with the transaction
of public business, is subject to the Wyoming Public Records
Act and may be disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread David Rush
Thank you, Evan.  That got me to the next error:

/bin/sh: swig: command not found
make: *** [gdal_wrap.cpp] Error 127

Where/how does the "swig" script or binary come from?

David

On Mon, Apr 27, 2020 at 7:11 AM Even Rouault 
wrote:

> On lundi 27 avril 2020 07:03:28 CEST David Rush wrote:
>
> > All:
>
> >
>
> > I think I finally found some instructions for building the Java stuff I
>
> > need:
>
> >
>
> > https://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix
>
> >
>
> > That includes some notes for MacOS. Yay.
>
> >
>
> > I've set up my java.opt per this link referenced in the above link:
>
> >
>
> > https://trac.osgeo.org/gdal/ticket/2401
>
> >
>
> > But when I run "make" from the swig/java directory, I get this error:
>
> >
>
> > GNUmakefile:1: ../../GDALmake.opt: No such file or directory
>
> > make: *** No rule to make target `../../GDALmake.opt'. Stop.
>
> >
>
> > I did a search with "find" but I don't seem to have that file.
>
>
>
> You need to run ./configure to generate it. And it is strongly advise that
> you run the Java bindings against the same version of the native library
> for which they have been generated.
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread Even Rouault
On lundi 27 avril 2020 07:03:28 CEST David Rush wrote:
> All:
> 
> I think I finally found some instructions for building the Java stuff I
> need:
> 
> https://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix
> 
> That includes some notes for MacOS.  Yay.
> 
> I've set up my java.opt per this link referenced in the above link:
> 
> https://trac.osgeo.org/gdal/ticket/2401
> 
> But when I run "make" from the swig/java directory, I get this error:
> 
> GNUmakefile:1: ../../GDALmake.opt: No such file or directory
> make: *** No rule to make target `../../GDALmake.opt'.  Stop.
> 
> I did a search with "find" but I don't seem to have that file.

You need to run ./configure to generate it. And it is strongly advise that you 
run the Java 
bindings against the same version of the native library for which they have 
been generated.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-27 Thread David Rush
All:

I think I finally found some instructions for building the Java stuff I
need:

https://trac.osgeo.org/gdal/wiki/GdalOgrInJavaBuildInstructionsUnix

That includes some notes for MacOS.  Yay.

I've set up my java.opt per this link referenced in the above link:

https://trac.osgeo.org/gdal/ticket/2401

But when I run "make" from the swig/java directory, I get this error:

GNUmakefile:1: ../../GDALmake.opt: No such file or directory
make: *** No rule to make target `../../GDALmake.opt'.  Stop.

I did a search with "find" but I don't seem to have that file.

What now?

David

On Sun, Apr 26, 2020 at 6:10 PM William Kyngesburye 
wrote:

> I don't package GDAL java with my framework, and have no interest in java.
>   Sorry.
>
> I don't know about Homebrew.
>
> -
> William Kyngesburye
> 
> 
>
> Don't Panic
>
> On Apr 24, 2020, at 5:36 PM, David Rush  wrote:
>
> 
> Hi.  I'm trying to get to the point where I can use GDAL with Java (on a
> Mac now, Linux server box in the future).
>
> Current box is MacOS 10.15.4.
>
> I've D/L the binaries for 2.4 from
> https://www.kyngchaos.com/software/frameworks/, and installed, which
> appears to have put things
> in /Library/Frameworks/GDAL.framework/Versions/2.4
>
> but I didn't find the gdal-*.jar file anywhere in there.  I searched and
> found gdal-2.4.0.jar at some heavily-advertising driven web site.
>
> When I try to use GDAL, I get:
>
> java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path
>
> I cannot find a file called "gdalalljin" anywhere.  I forced my
> java.library.path to be /Library/Frameworks/GDAL.framework/unix/lib, but
> got the same error.
>
> I see that I have /Library/Frameworks/GDAL.framework/unix/lib/libgdal.dylib
>
> I then followed the directions here
> https://trac.osgeo.org/gdal/wiki/BuildingOnMac and used Homebrew to build
> GDAL, which appears to have installed it in /usr/local, and appears to be
> version 2.4.4 (per ogr2ogr --version).
>
> I reset my java.library.path to /usr/local/lib, but I still get the same
> error:
>
> java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path:
> [/usr/local/lib]
>
> I see that I have /usr/local/lib/libgdal.dylib
>
> So where, exactly, can I get the Java native library that I need, and what
> is the canonical source for a gdal-x.y.z.jar file, or instructions to build
> one myself?
>
> David
>
>
> E-Mail to and from me, in connection with the transaction
> of public business, is subject to the Wyoming Public Records
> Act and may be disclosed to third parties.
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Building for Java on MacOS

2020-04-26 Thread William Kyngesburye
I don't package GDAL java with my framework, and have no interest in java.   
Sorry. 

I don't know about Homebrew.

-
William Kyngesburye



Don't Panic

> On Apr 24, 2020, at 5:36 PM, David Rush  wrote:
> 
> 
> Hi.  I'm trying to get to the point where I can use GDAL with Java (on a Mac 
> now, Linux server box in the future).
> 
> Current box is MacOS 10.15.4.
> 
> I've D/L the binaries for 2.4 from 
> https://www.kyngchaos.com/software/frameworks/, and installed, which appears 
> to have put things in /Library/Frameworks/GDAL.framework/Versions/2.4
> 
> but I didn't find the gdal-*.jar file anywhere in there.  I searched and 
> found gdal-2.4.0.jar at some heavily-advertising driven web site.
> 
> When I try to use GDAL, I get: 
> 
> java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path
> 
> I cannot find a file called "gdalalljin" anywhere.  I forced my 
> java.library.path to be /Library/Frameworks/GDAL.framework/unix/lib, but got 
> the same error.
> 
> I see that I have /Library/Frameworks/GDAL.framework/unix/lib/libgdal.dylib
> 
> I then followed the directions here 
> https://trac.osgeo.org/gdal/wiki/BuildingOnMac and used Homebrew to build 
> GDAL, which appears to have installed it in /usr/local, and appears to be 
> version 2.4.4 (per ogr2ogr --version).
> 
> I reset my java.library.path to /usr/local/lib, but I still get the same 
> error:
> 
> java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path: 
> [/usr/local/lib]
> 
> I see that I have /usr/local/lib/libgdal.dylib
> 
> So where, exactly, can I get the Java native library that I need, and what is 
> the canonical source for a gdal-x.y.z.jar file, or instructions to build one 
> myself?
> 
> David
> 
> 
> E-Mail to and from me, in connection with the transaction 
> of public business, is subject to the Wyoming Public Records 
> Act and may be disclosed to third parties.
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev