[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: glpk.h
From: |
John W. Eaton |
Subject: |
Re: glpk.h |
Date: |
Fri, 27 Jul 2007 01:18:18 -0400 |
On 26-Jul-2007, Donald Parsons wrote:
| On Thu, 2007-07-26 at 14:35 -0400, John W. Eaton wrote:
| > On 26-Jul-2007, Donald Parsons wrote:
| >
| > | 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.
|
| Yes, CPPFLAGS=-I/usr/include/glpk does work.
|
| I tried the patch by checking out cvs. Unfortunately it still
| fails. It finds the header but I still get:
|
| FFTW libraries: -lfftw3
| GLPK libraries:
| UMFPACK libraries: -lumfpack
|
| configure: WARNING: GLPK library not found. The glpk function for
| solving linear programs will be disabled.
| configure:
|
| NOTE: libraries may be skipped if a library is not found...
|
|
| I tried but failed to solve. I thought this patch would do it,
| but still failed:
|
| =======
| diff -u src/DLD-FUNCTIONS/__glpk__.cc.~1.23.~
| src/DLD-FUNCTIONS/__glpk__.cc
| --- src/DLD-FUNCTIONS/__glpk__.cc.~1.23.~ 2007-07-26
| 15:41:51.000000000 -0400
| +++ src/DLD-FUNCTIONS/__glpk__.cc 2007-07-26 20:01:15.000000000
| -0400
| @@ -36,7 +36,7 @@
| #include "oct-obj.h"
| #include "pager.h"
|
| -#if defined (HAVE_GLPK)
| +#if defined (HAVE_GLPK) || defined (HAVE_GLPK_GLPK_H)
|
| extern "C"
| {
| =======
|
| I see ./configure finding gplk lib and then glpk/glpk.h and
| then failing to find glpk.h
There were two small problems with the patch I sent. Try the change
below for configure.in instead of the patch I sent earlier. You will
still need the change for __glpk__.cc.
| Is it then undefining HAVE_GLPK erroneously?
I don't know. Did you look in the generated config.h file?
jwe
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.568
retrieving revision 1.569
diff -u -u -r1.568 -r1.569
--- configure.in 24 Jul 2007 22:53:53 -0000 1.568
+++ configure.in 26 Jul 2007 18:44:06 -0000 1.569
@@ -582,6 +582,7 @@
with_glpk=$withval, with_glpk=yes)
glpk_lib=
+glpk_missing=no
if test "$with_glpk" = yes; then
glpk_lib="glpk"
elif test "$with_glpk" != no; then
@@ -597,7 +598,8 @@
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_missing=no
GLPK_LIBS="-l$glpk_lib"
AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])], [
GLPK_LIBS=
- Re: rat and rats ported from octave-forge, (continued)
glpk.h, John W. Eaton, 2007/07/26