Hi all!
I am just discovering NLOPT which seems to be a great library.
However, I have a very weird problem: I config/make/insall the library, and when I run my program, I either get an "illegal instruction" message and the program exits, or I get a "segmentation violation" message.... So, I've installed yesterday nlopt-1.0.1, on my laptop (thinkpad X61s) running debian Sid, compiling it all with gcc version 4.3. I really wonder: how can the most recent version of gcc possibly generate illegal instructions.
I have never had this kind of message before with gcc...
So, if you have encountered the same kind of problem, I'd be happy to hear from you.
Best,
Philippe

PS1: a few examples of what's happening: (messages are in french but I think may be understood by anyone)
I also show the gdb output after a program crash below.
PS2: I have tried both static and shared library, with exactly the same result.

$ ./testopt -a 0 -o 6
-----------------------------------------------------------
Optimizing Shekel m=5 function (4 dims) using DIRECT (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 3.82704 3.80758 4.56184 5.32821]
Starting function value = -0.625514
Erreur de segmentation



$ ./testopt -a 0 -o 7
-----------------------------------------------------------
Optimizing Shekel m=7 function (4 dims) using DIRECT (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 6.94939 4.5285 7.19177 3.38894]
Starting function value = -0.249557
Instruction non permise



$ ./testopt -a 1 -o 6
-----------------------------------------------------------
Optimizing Shekel m=5 function (4 dims) using DIRECT-L (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.84771 4.00636 4.50266 5.18081]
Starting function value = -0.616367
Erreur de segmentation



$ gdb ./testopt
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run -a 1 -o 6
Starting program: /home/ppreux/usr/nlopt/nlopt-1.0.1/test/testopt -a 1 -o 6
-----------------------------------------------------------
Optimizing Shekel m=5 function (4 dims) using DIRECT-L (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 7.03969 5.64985 4.5627 6.59936]
Starting function value = -0.406514

Program received signal SIGSEGV, Segmentation fault.
0x093ca13e in ?? ()
(gdb) where
#0  0x093ca13e in ?? ()
#1  0xb7cdcc87 in ?? () from /lib/i686/cmov/libc.so.6
#2  0xb7cdcc34 in ?? () from /lib/i686/cmov/libc.so.6
#3  0xb7cdd1b9 in qsort_r () from /lib/i686/cmov/libc.so.6
#4 0x0804cb07 in divide_rect (rdiv=0x93ca3a0, p=0xbfd743ec) at cdirect.c:134 #5 0x0804cf96 in cdirect_unscaled (n=4, f=0x804c5a0 <cdirect_uf>, f_data=0xbfd744c4, lb=0x93ca0d0, ub=0x93ca0f0, x=0x93ca008, minf=0xbfd747c8, stop=0xbfd745c0, magic_eps=0, which_alg=13) at cdirect.c:529 #6 0x0804d913 in cdirect (n=4, f=0x8049e50 <bounds_wrap_func>, f_data=0xbfd747b8, lb=0x93ca068, ub=0x93ca088, x=0x93ca008, minf=0xbfd747c8, stop=0xbfd745c0, magic_eps=0, which_alg=13) at cdirect.c:594 #7 0x0804bb09 in nlopt_minimize_ (algorithm=NLOPT_GN_DIRECT_L, n=4, f=0x8049e50 <bounds_wrap_func>, f_data=0xbfd747b8, m=0, fc=0, fc_data=0x0, fc_datum_size=0, lb=0x93ca068, ub=0x93ca088, x=0x93ca008, minf=0xbfd747c8, minf_max=-inf, ftol_rel=0, ftol_abs=0, xtol_rel=0, xtol_abs=0x93ca048, maxeval=1000,
    maxtime=0) at nlopt.c:323
#8 0x0804be93 in nlopt_minimize (algorithm=NLOPT_GN_DIRECT_L, n=4, f=0x8049e50 <bounds_wrap_func>, f_data=0xbfd747b8, lb=0x93ca068, ub=0x93ca088, x=0x93ca008, minf=0xbfd747c8, minf_max=-inf, ftol_rel=0, ftol_abs=0, xtol_rel=0, xtol_abs=0x93ca048, maxeval=1000, maxtime=0) at nlopt.c:566
#9  0x0804a8b7 in main (argc=5, argv=0xbfd74884) at testopt.cpp:169

_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to