This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Java under Cygwin and the installation of CaGe


On Wed, 22 Aug 2007, point wrote:

> Hello,
>
> this is my problem: I used Windows XP and would like to install the
> graph visualization software CaGe, obtainable at
>
> http://www.math.uni-bielefeld.de/~CaGe/
>
> which is built in, and requires Java; the system requirements include
> the following passage:
>
> a Java installation
> (with Java Native Interface [JNI] files -- which means that a Runtime
> Environment [JRE] won't be enough, you need the full Software
> Development Kit [SDK]. Tested with JavaSoft's JDK 1.1.7 and Borland
> JBuilder's 1.3).
>
> However, no Windows version of CaGe exists and thus I have settled for
> Cygwin.
>
> I have little experience with Java and virtually no experience with
> Cygwin, so please view my inability to make sense of the errors which I
> describe below in this light. I am not even able to find out whether I
> have the necessary JNI files (I do not now what this is) or how to
> obtain from SUN's site the files I need. Nor can I read off from the
> error messages below whether the only problem are the missing JNI files
> or whether there are Cygwin related things to do in order to get CaGe
> running.

JNI requires you to dynamically load a library DLL and all of its
prerequisite DLLs from within a Java process.  One of the prerequisite
DLLs for any Cygwin program is (surprise!) cygwin1.dll, which is, given
your (self-admitted) lack of experience with Cygwin, not easy to load
dynamically.  So, I'd recommend instead using the MinGW compiler to build
your JNI DLL.  Depending on how many POSIX features the library uses, this
may or may not be possible (Cygwin's POSIX emulation is much more complete
than MinGW's).

There are some other issues with the Windows versions of the various JDKs
(in particular, different name mangling schemes for the JNI functions in
some corner cases), but it should work for the most part with a DLL built
by the MinGW gcc.  Note that you can, for now, invoke the MinGW tools by
passing the "-mno-cygwin" option to gcc.

> I have done a complete installation of Cygwin and it seems to work fine,
> just as some tutorial expect it to work.
>
> Now I describe the errors that arise during the installation:
>
> When I start the installation of CaGe after downloading and unzipping
> the files by ./INSTALL.sh, then the following things happen: I quote:
>
> "
> * Looking for a C compiler ...
> Ok, using '/usr/bin/gcc'.

There should be a way to override this.  Find out what it is, and use it
to pass "/usr/bin/gcc -mno-cygwin" here.

> * Looking for commands: 'unzip', 'make', 'mkdir', 'chmod', 'find' ...
> All found.
>
> * Looking for a Java installation ...
>
> The following directory seems to be part of a Java installation.
> Choose it (enter 1) or enter the path of another such directory.
> Enter '?' for a full search. '-' to exit.
>
> 1: /cygdrive/c/Programme/Java/jdk1.5.0_09/bin
>
> number or directory:
> "
>
> If I confirm this with 1, the installation continues and fails as follows:
>
> "
> * Making native libraries ...
>
> /usr/bin/gcc -fPIC -c -I/cygdrive/c/Programme/Java/jdk1.5.0_09/include -I/cygdrive/c/Programme/Java/jdk1.5.0_09/include/win32 NativeCaGePipe.c NativeEmbedEmbedder.c NativeEmbeddableGraph.c NativeEdgeIterator.c NativePlanarWriter.c NativeWritegraphWriter.c NativeCMLWriter.c NativePDBWriter.c Pipe.c BufferedFDInputStream.c BufferedFDOutputStream.c get_element.c check_graph.c graph.c read_graphs.c dstring.c cmd_vector.c pipe_tools.c file_tools.c malloc.c jbytes.c j_debug.c j_error_exit.c Systoolbox.c
> NativeCaGePipe.c:1: warning: -fPIC ignored for target (all code is position independent)
> In file included from /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:27,
> from NativeCaGePipe.h:2,
> from NativeCaGePipe.c:21:
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/win32/jni_md.h:16: error: parse error before "jlong"
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/win32/jni_md.h:16: warning: data definition has no type or storage class
> In file included from NativeCaGePipe.h:2,
> from NativeCaGePipe.c:21:
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:108: error: parse error before "jlong"
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:108: warning: no semicolon at end of struct or union
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:112: error: parse error before '}' token
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:112: warning: data definition has no type or storage class
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:255: error: parse error before '*' token
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:270: error: parse error before '*' token
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:277: error: parse error before '*' token
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:284: error: parse error before '*' token
> "
>
> ( It goes on like that for a long time with similar messages
> and ends as follows)
>
> "
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:735: warning: data definition has no type or storage class
> /cygdrive/c/Programme/Java/jdk1.5.0_09/include/jni.h:736: error: parse error before '}' token
> make: *** [CaGe.dll] Error 1
>
> - 'make' failure, aborting.

This is a problem with the JDK headers -- they are not compatible with
Cygwin.  However, if you use the MinGW compiler, this error should not
occur.

> I have searched with Google for quite a long time on the topic of Java
> and Cygwin and CaGe, but have hardly found more than
>
> http://cygwin.com/ml/cygwin/2003-02/msg00477.html
> und
> http://www.inonit.com/cygwin/
>
> and all this does not help me. The hint to get acquainted with the
> cygpath command does not help me either.

Well, the build system for CaGe may invoke Java in ways that would expect
it to understand POSIX paths (which it won't).  For that, you might want
to use the Cygwin Java wrappers (from
<http://cygwin.com/cgi-bin/cvsweb.cgi/wrappers/java/?cvsroot=cygwin-apps>),
which would give you the "java"/"javac", etc, commands that would
understand POSIX paths.

> It seems that until now nobody with my problem (Windows, want to install
> CaGe, total beginner with Cygwin) has left his/her traces on the web.
>
> Can anybody help me? What is the problem? What do I have to do or learn,
> where to look next, in order to get CaGe running? At the moment I do not
> even know to look, especially on SUN's site. Could anyone adept at
> Cygwin just take a moment and install CaGe and describe what one has to
> do?
>
> If you would like me to post this to some other forum, please let me
> know, I am even grateful for help of this kind.

You might also need to annotate the C function prototypes appropriately,
as they may not be compiled with the right decorations otherwise.  But all
in all it should work, unless POSIX support not present in MinGW is used.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Belief can be manipulated.  Only knowledge is dangerous.  -- Frank Herbert

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]