octave-maintainers
[Top][All Lists]
Advanced

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

glpk.h


From: John W. Eaton
Subject: glpk.h
Date: Thu, 26 Jul 2007 14:35:22 -0400

On 26-Jul-2007, Donald Parsons wrote:

| On a totally unrelated topic, when I first tried compiling
| octave I couldn't get glpk to be found because ./configure
| looked for /usr/include/glpk.h  but it is in glpk sub-
| directory.  Rather than edit code, I just put a link in
| /usr/include to fix problem as below.  Should auto test
| code be "fixed" so link is not needed? 
| 
|   GLPK libraries:       -lglpk
| 
| find /usr/include/ -name glpk.h -ls
| lrwx 1 0    11 Jun 28 21:13 /usr/include/glpk.h -> glpk/glpk.h
| -rw- 1 0 24463 Apr  7 16:33 /usr/include/glpk/glpk.h

Please try the following patch.

BTW, instead of the link, I think it would have worked to set
CPPFLAGS=-I/usr/include/glpk before running configure.

jwe


ChangeLog:

2007-07-26  John W. Eaton  <address@hidden>

        * configure.in: Also look for glpk/glpk.h.


src/ChangeLog:

2007-07-26  John W. Eaton  <address@hidden>

        * DLD-FUNCTIONS/__glpk__.cc: Include glpk/glpk.h if
        HAVE_GLPK_GLPK_H is defined.


Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.568
diff -u -u -r1.568 configure.in
--- configure.in        24 Jul 2007 22:53:53 -0000      1.568
+++ configure.in        26 Jul 2007 18:32:39 -0000
@@ -597,7 +597,7 @@
     AC_DEFINE(GLPK_PRE_4_14, 1, [Define if GLPK version is less than 4.14.])], 
[
     AC_CHECK_LIB($glpk_lib, _glp_lpx_simplex, [GLPK_LIBS="-l$glpk_lib"], [])])
   if test -n "$GLPK_LIBS"; then
-    AC_CHECK_HEADERS(glpk.h, [
+    AC_CHECK_HEADERS(glpk/glpk.h glpk.h, [
       GLPK_LIBS="-l$glpk_lib"
       AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])], [
         GLPK_LIBS=
Index: src/DLD-FUNCTIONS/__glpk__.cc
===================================================================
RCS file: /cvs/octave/src/DLD-FUNCTIONS/__glpk__.cc,v
retrieving revision 1.22
diff -u -u -r1.22 __glpk__.cc
--- src/DLD-FUNCTIONS/__glpk__.cc       4 Apr 2007 03:22:17 -0000       1.22
+++ src/DLD-FUNCTIONS/__glpk__.cc       26 Jul 2007 18:32:44 -0000
@@ -40,7 +40,11 @@
 
 extern "C"
 {
+#if defined (HAVE_GLPK_GLPK_H)
+#include <glpk/glpk.h>
+#else
 #include <glpk.h>
+#endif
 
 #ifdef GLPK_PRE_4_14
 

reply via email to

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