[Gvsig_english] JNI bindings and system binaries

Rafa Gaitán gvsig3d at ai2.upv.es
Mon Jan 25 10:24:21 CET 2010


Hi Ben,

I only compiled potrace for windows 7 and macosx, and I didn't have the 
problems you commented. Trying to do the same on linux I get the same 
errors, so If you find a proper solution please tell me and I will 
upload it on the 3D branch. Currently I don't have time to take a deep 
look of the problem, anyway the linux libraries were running ok.

For CMake, I usually use "out-of-source" builds, ant files there maybe 
are out-of-date. Here a few instructions:

Inside the libjni-potrace dir:
mkdir build
cd build
cmake ../
(if all is ok and no errors or warnings).
make

now you should have inside build/lib directory the compiled library.

Rafa.

Benjamin Ducke wrote:
> OK, partly in answer to my own question:
> I understand now that "POTRACE" and "VERSION" are symbols
> defined in CMakeLists.txt. What I don't understand is why 
> they do not get resolved properly by cmake.
> I have tried kicking of the build using Ant and the build.xml
> file. It starts cmake and properly generates all Makefiles,
> but leaves the quoted symbols in the C sources.
> Did I overlook something?
>
> Ben
>
> ----- Original Message -----
> From: "Benjamin Ducke" <benjamin.ducke en oxfordarch.co.uk>
> To: "Users and Developers mailing list" <gvsig_internacional en listserv.gva.es>
> Sent: Thursday, January 21, 2010 11:57:28 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
> Subject: Re: [Gvsig_english] JNI bindings and system binaries
>
> Hi Rafa,
>
> it looks like the PROJ.4 code is an old snapshot (ca. 2006 or 2007).
> I have updated the code and compiled it. I noticed that there
> is no build.xml file and no Java code at all in libjni-proj.
> It seems to generate only a C binary file. Is that because the
> Java interface code is in some other project? Perhaps libJCRS?
>
> Also, trying to compile libjni-potrace, I got a whole lot of error
> messages like this one:
>
> .../src/main/native/jpotrace/potrace_raster.c:572: error: stray ‘\’ in program
>
> They all come from strange C string definitions with additional quotes ("), that
> should really not be there, e.g. line 552:
>
>   fprintf(stderr, ""POTRACE": %s\n", strerror(errno));
>
> Should be:
>
>   fprintf(stderr, "POTRACE: %s\n", strerror(errno));
>
> I have no clue why these wrong quotes would be in there.
> Did you notice the same thing?
>
> Also, I am not quite sure why the readme.txt file for libjni-potrace
> states that the potrace library needs to be available at compilation time.
> It seems to me that all potrace source code is included in the libjni-potrace
> project and gets compiled in there ???
>
> Thanks for all your help,
>
> Ben
>
> ----- Original Message -----
> From: "Rafael Gaitán" <gvsig3d en ai2.upv.es>
> To: "Users and Developers mailing list" <gvsig_internacional en listserv.gva.es>
> Sent: Wednesday, January 20, 2010 11:39:34 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
> Subject: Re: [Gvsig_english] JNI bindings and system binaries
>
> Hi Ben,
>
> El 20/01/10 11:27, Benjamin Ducke escribió:
>   
>> Hi Rafa,
>>
>> I have a question regarding the libjni-proj4 project.
>> The src folder does not only have the JNI bindings but
>> actually the entire PROJ.4 library source code. Why?
>> And where does this code come from? I downloaded the
>> latest PROJ.4 release 4.7.0 and the code differs.
>>
>> E.g., in libjni-proj4, geocent.c, I find this comment:
>>
>> * $Log: geocent.c,v $
>>   * Revision 1.5  2004/10/25 15:34:36  fwarmerdam
>>   * make names of geodetic funcs from geotrans unique
>>
>> ... which does not exist in the same file of PROJ.4 4.7.0.
>>
>> So where does the C code in libjni-proj4 come from?
>>    
>>     
> I think is an old version of proj4, which was embedded inside source 
> tree to avoid many third party dependencies. I don't know which version 
> is, I just took it an compiled it for windows 7 using cmake. Original 
> developers of that library could help you better in that.
>
> Rafa.
>
>   
>> Thanks,
>>
>> Ben
>>
>> ----- Original Message -----
>> From: "Rafael Gaitán"<gvsig3d en ai2.upv.es>
>> To: "gvsig internacional"<gvsig_internacional en listserv.gva.es>
>> Sent: Monday, January 18, 2010 8:45:54 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
>> Subject: Re: [Gvsig_english] JNI bindings and system binaries
>>
>> El 18/01/10 20:05, Benjamin Ducke escribió:
>>    
>>     
>>> Hi Rafa,
>>>
>>> Thanks for your clarifications. I think I have a good
>>> idea of what I need to do now. I am hesitating to use
>>> Visual C because I don't want to sacrifice gigabytes
>>> of disk space just to get some C code compiled and I
>>> absolutely loath the semantics of cmd.exe and all those
>>> MS development tools. So I might adapt those CMake files
>>> to run MingW/GCC instead.
>>>
>>>      
>>>       
>> CMake is a very useful tool. It can generate Unix/Mac/Mingw Makefiles
>> and Visual Studio Project files, so I think mingw generation will be
>> quite straighforward.
>>    
>>     
>>> Some build notes would be helpful, though.
>>>
>>> I will let you know if I run into another problem or
>>> in the unlikely case that I figure something out which
>>> you didn't know before!
>>>
>>>      
>>>       
>> It's ok! :)
>>
>> Greets,
>> Rafa.
>>
>>    
>>     
>>> Best,
>>>
>>> Ben
>>>
>>> ----- Original Message -----
>>> From: "Rafael Gaitán"<gvsig3d en ai2.upv.es>
>>> To: "gvsig internacional"<gvsig_internacional en listserv.gva.es>
>>> Sent: Monday, January 18, 2010 6:58:52 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
>>> Subject: Re: [Gvsig_english] JNI bindings and system binaries
>>>
>>> Hi Ben,
>>>
>>> I'm Rafa again! :)
>>>
>>> El 18/01/10 16:20, Benjamin Ducke escribió:
>>>
>>>      
>>>       
>>>> Dear all,
>>>>
>>>> I am currently looking into how to compile binaries and JNI
>>>> wrappers for platform-dependent binaries (GDAL,PROJ.4, etc.).
>>>> I have some questions:
>>>>
>>>> 1. I am a bit unsure whether to use the JNI bindings from
>>>> trunk or the 3D extension' versions. Are those version
>>>> going to be merged into trunk again sometime soon?
>>>> Does the current trunk version already support GDAL 1.6.3?
>>>>
>>>>
>>>>        
>>>>         
>>> I don't know if will be merged, but probably will, because I fixed some
>>> JNI errors that doesn't affect to functionality.
>>>
>>> If you want compile jni bindings by yourself, I recommend you use the
>>> fixed versions (3D branch) but by now they are not oficial!.
>>>
>>> Trunk version I'm sure is not compiled against GDAL 1.6.3. Binaries from
>>> 3D branch are built against that version using Visual Studio 2008 SP1.
>>>
>>>      
>>>       
>>>> 2. What's in the "libjni-addo" project? The same bindings
>>>> also seem to be in "libjni-gdal/main/java/org/addo"?
>>>>
>>>> 2. If I look into ""libjni-gdal/main/java/org/gvsig/jogr", I see
>>>> OGR vector data driver functions in there. Is this what
>>>> gvSIG currently uses to manage shapefiles? Or is this just
>>>> some experimental code?
>>>>
>>>> 3. The compilation instructions for jgdal, jmrsid etc.state
>>>> that Visual C is needed on Linux.
>>>> Is that because the native libraries  were also compiled
>>>> using Visual C? Or is there another reason?
>>>> I am asking because I'd like to compile everything with MinGW.
>>>> If I have to use Visual C: which version and is there a free
>>>> version available?
>>>>
>>>>
>>>>        
>>>>         
>>> If you want compile on windows I think you can download a free version
>>> of the visual studio from microsoft web page, but make sure that *all
>>> your native libraries* are built with the same compiler. If you mix
>>> visual studio versions probably will give you crashes, because of mixing
>>> c++ runtime versions. JNI world is not as funny as Java! hehe.
>>>
>>>      
>>>       
>>>> 4. Regarding Mac OS X, I noticed that there are some Mac specific
>>>> projects in trunk: libjni-gdal-macosx, libjni-mrsid-macosx, ...
>>>> Are those still needed on the Mac?
>>>>
>>>>
>>>>        
>>>>         
>>> If you use the 3D branch, they are not needed. Currently we are using
>>> CMake for multiplatform building. So only some basic knowledge of CMake
>>> is needed.
>>>
>>> We probably upload a BUILD_NOTES.txt to each jni project on the branch
>>> with a simple guide.
>>>
>>> Another problem that Agustin said is that I was not able to generate
>>> correctly ecw and mrsid libraries for MacOSX.
>>>
>>> ECW compiles and should work... but once you try to load a file it gives
>>> an exception and aborts the process :(. MRSID doesn't compile at all, I
>>> have the requested SDK but the build process gives some linkage
>>> problems. If you find a solution to the problem I will very pleasead to
>>> upload the changes to the 3D branch.
>>>
>>> Rafa.
>>>
>>>      
>>>       
>>>> Any help will be much appreciated!
>>>>
>>>> Best regards,
>>>>
>>>> Ben
>>>>
>>>>
>>>> ------
>>>> Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
>>>>
>>>> _______________________________________________
>>>> Gvsig_internacional mailing list
>>>> Gvsig_internacional en listserv.gva.es
>>>> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>>>>
>>>>
>>>>        
>>>>         
>>> _______________________________________________
>>> Gvsig_internacional mailing list
>>> Gvsig_internacional en listserv.gva.es
>>> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>>>
>>>
>>>
>>> ------
>>> Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
>>>
>>> _______________________________________________
>>> Gvsig_internacional mailing list
>>> Gvsig_internacional en listserv.gva.es
>>> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>>>
>>>      
>>>       
>> _______________________________________________
>> Gvsig_internacional mailing list
>> Gvsig_internacional en listserv.gva.es
>> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>>
>>
>> ------
>> Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
>>
>> _______________________________________________
>> Gvsig_internacional mailing list
>> Gvsig_internacional en listserv.gva.es
>> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>>    
>>     
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional en listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
> ------
> Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional en listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
> ------
> Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional en listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>   



More information about the Gvsig_internacional mailing list