Hi
I've looked into the problem with the source util/qsort_r.c.
stdlib.h has this prototype for Linux:
#ifdef __USE_GNU
extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
__compar_d_fn_t __compar, void *__arg)
__nonnull ((1, 4));
#endif
i.e. in gnu libc the args are the other way arround in BSD so the code in
~/nlopt-1.2blah/utils/qsort_r.c should read
#ifdef HAVE_QSORT_R
#ifdef BSD /*there must be some sort of switch for BSD/GNU libc*/
qsort_r(base_, nmemb, size, thunk, compar);
#else /*its not BSD it must be GLIBC*/
qsort_r(base_, nmemb, size, compar, thunk); //these args are the other
way around
#endif /*BSD*/
#else
.......
I'm not quite sure what the BSD switch should be. If I patch qsort_r.c as
above, the subplex algorithm seems to work initially (where before it got
the seg fault immediately), and then at an n'th iteration it gives a
segmentation fault. Any ideas on how to fix this properly?
Thanks
Wendy
2009/9/26 philippe preux <[email protected]>
> Hi,
> I had systematic crashes that I fixed by patching the source util/qsort_r.c
> saying #undef HAVE_QSORT_R
> Hope that helps,
> Ph.
>
>
> Wendy Leigh Vandoolaeghe wrote:
>
>> Hello
>>
>> is anyone else having issues with the NLOPT_LN_SBPLX algorithm?
>> I've tried using it with nlopt_minimize() and I always get a segmentation
>> fault (whether I have a simple function I minimise or a more complicated
>> one).
>>
>> I can call the other derivative-free algorithms without any problem, using
>> the same parameter values and objective function. However, I prefer to use a
>> simplex type minimization routine (the Nelder Mead one doesn't always work).
>>
>> Help will be appreciated.
>>
>>
>>
>> --
>> __________\\/.|_.\/.__________
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> NLopt-discuss mailing list
>> [email protected]
>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
>>
>
>
--
__________\\/.|_.\/.__________
@mail = [email protected]
! mob = 078 131 77 039
* home = 020 783 44 523
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss