help-octave
[Top][All Lists]
Advanced

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

Re: sqp and glpk


From: Sepp Käsbauer
Subject: Re: sqp and glpk
Date: Thu, 12 Jul 2007 21:29:05 +0200
User-agent: KMail/1.9.7

Am Dienstag, 10. Juli 2007 schrieb Henry Bock:
> Hi,

Hi Henry,

>
> I'm trying to minimize a nonlinear function with an inequality
> constraint:
>
> #! /usr/local/bin/octave -qf
>
> function obj = phi (x)
>         obj = x**4-x**2;
> endfunction
>
> function u = h (x)
>          u = -((x-1)**2-1);
> endfunction
>          
> x0 = [1.7];
>          
> [x, obj, info, iter, nf, lambda] = sqp (x0, @phi,[],@h)
>

on my system i get: 
octave:13> function obj = phi (x)
>         obj = x**4-x**2;
> endfunction
octave:14>
octave:14> function u = h (x)
>          u = -((x-1)**2-1);
> endfunction
octave:15>
octave:15> x0 = [1.7];
octave:16>
octave:16> [x, obj, info, iter, nf, lambda] = sqp (x0, @phi,[],@h)
dmp_create_pool: warning: debug mode enabled
dmp_create_pool: warning: debug mode enabled
dmp_create_pool: warning: debug mode enabled
dmp_create_pool: warning: debug mode enabled
dmp_create_pool: warning: debug mode enabled
x =  0.70711
obj = -0.25000
info = 0
iter =  9
nf =  13
lambda = 0

Your Octave tries to find a shared object file called libglpk.so.0 an did not 
find it. So you have to test if it is installed.
in a shell type: 
 $ locate libglpk.so
/home/kas/src/glpk-4.17/src/.libs/libglpk.so
/home/kas/src/glpk-4.17/src/.libs/libglpk.so.0
/home/kas/src/glpk-4.17/src/.libs/libglpk.so.0.2.0
/usr/local/lib/libglpk.so
/usr/local/lib/libglpk.so.0
/usr/local/lib/libglpk.so.0.2.0

or if you dont have locate installed try:
# find / -name "libglpk.so*"

the file is located in /usr/local/lib/

$ ls -l /usr/local/lib/libglpk.so*

$ ldconfig -p | grep glpk
libglpk.so.0 (libc6,x86-64) => /usr/local/lib/libglpk.so.0
libglpk.so (libc6,x86-64) => /usr/local/lib/libglpk.so

here we test if the file is being known by the dynamic linker.
If your file is there but not known by the linker you have to register it to 
the dynamic linker with:

check the file /etc/ld.so.conf that it contains the path to your file e.g.
...
/usr/local/lib
...
 
then run (as root) 
# ldconfig
and retest if the file is being found
# ldconfig -p | grep glpk

What system do you use? debian, ubuntu, suse? 

If it is rpm-based try:

$ rpm -qi glpk
$ rpm -ql glpk | grep libglpk.so

If the package dont include libglpk.so then we have to build it from source.
 
If you need more assistance let me know. I try to guide you through the work 
of building your packages from source. 

cu Sepp

> Unfortunately I'm getting the following error:
> error: libglpk.so.0: cannot open shared object file: No such file or
> directory
> error: `__glpk__' undefined near line 524 column 5
> error: called from `glpk' in file
> `/usr/local/share/octave/2.9.12/m/optimization/glpk.m'
> error: evaluating if command near line 224, column 4
> error: evaluating if command near line 209, column 2
> error: evaluating if command near line 207, column 7
> error: evaluating if command near line 192, column 5
> error: evaluating if command near line 79, column 3
> error: called from `qp' in file
> `/usr/local/share/octave/2.9.12/m/optimization/qp.m'
> error: evaluating while command near line 284, column 5
> error: evaluating if command near line 175, column 3
> error: called from `sqp' in file
> `/usr/local/share/octave/2.9.12/m/optimization/sqp.m'
> error: near line 15 of file `./test2'
>
> I have installed (I think) glpk 4.19 and I also reinstalled octave but
> the error message doesn't seem to change.
>
> I would appreciate any help very much!
>
> Thanks,
> Henry





reply via email to

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