help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Help-glpk] Cannot compile glpk.c on Redhat 7.2 but will compileonRe


From: Welson Sun
Subject: RE: [Help-glpk] Cannot compile glpk.c on Redhat 7.2 but will compileonRedhat 9.
Date: Thu, 13 May 2004 00:49:02 -0600

Well, here is the script in configure.in that can check the JDK version:

#--------------------------------------------------------------------
#       Test the JDK version
#--------------------------------------------------------------------
AC_MSG_CHECKING([the Java compiler with a simple compile])
JVERSION=unknown
if "$JAVAC" confTest.java ; then
    AC_MSG_RESULT(ok)

    AC_MSG_CHECKING([the value of the java.version Property ])
    if "$JAVA" confTest > /dev/null; then
       JVERSION=`"$JAVA" confTest`
       AC_MSG_RESULT($JVERSION)
    else        
       AC_MSG_ERROR(['"$JAVA" confTest failed.'])
    fi
else
   AC_MSG_ERROR(['"$JAVAC" confTest.java failed.'])
fi

AC_MSG_CHECKING([the JDK version])
UPGRADE_JVM=no
case "$JVERSION" in
        1.1.*) UPGRADE_JVM=yes;;
        1.2.*) UPGRADE_JVM=yes;;
        1.3.*) UPGRADE_JVM=yes;;
        1.4.*) AC_MSG_RESULT([Your JDK version is OK]);;
        *) AC_MSG_RESULT([ok, you are running $JVERSION]);;
esac

if test "$UPGRADE_JVM" = "yes"; then
    AC_MSG_ERROR([Please upgrade your JDK version])     
fi

And the related java code:
public class confTest {

    public static void main(String args[]) {
        System.out.print(System.getProperty("java.version"));
    }
} 

Anyone knows how to test the gcc version in configure.in?

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Welson
Sun
Sent: Wednesday, May 12, 2004 10:10 PM
To: 'Michael Hennebry'
Cc: address@hidden
Subject: RE: [Help-glpk] Cannot compile glpk.c on Redhat 7.2 but will
compileonRedhat 9.

Does anyone know how I can modify the configure.in or Makefile.in file to
check the version of the gcc and java so that I can issue a warning when the
gcc or java version is not high enough? 

-----Original Message-----
From: Michael Hennebry [mailto:address@hidden
Sent: Wednesday, May 12, 2004 8:29 AM
To: Welson Sun
Cc: address@hidden
Subject: RE: [Help-glpk] Cannot compile glpk.c on Redhat 7.2 but will
compile onRedhat 9.

On Wed, 12 May 2004, Welson Sun wrote:

> Sorry, it is not the GLPK, it is the glpk.c in contrib/jni/c directory.


> Somebody reported this error when compiling glpk.c on Redhat 7.2:
>
> glpk.c: In function `_hook_fn':
> glpk.c:85: parse error before `cls'
> glpk.c:92: parse error before `callbackArg'
> glpk.c:96: parse error before `mID'
> glpk.c:99: `mID' undeclared (first use in this function)
> glpk.c:99: (Each undeclared identifier is reported only once
> glpk.c:99: for each function it appears in.)
> glpk.c:108: `callbackArg' undeclared (first use in this function)
> make: *** [glpk.o] Error 1
>
> I got the same error on Redhat 7.2, but the compilation is successful 
> on a Redhat 9 box. We are using GLPK 4.3, any ideas?

gcc can be set to require that all functions be declared before use.
I think ANSI C requires this.
I don't have glpk.c in front of me,
so I can't be sure that that is the problem.

-- 
Mike   address@hidden
"Nothing says it like words if you know how to use them."
                    --  the Professional Organization of English Majors



_______________________________________________
Help-glpk mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-glpk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]