Dear Steven, all,

I am making an optimization in meep using your nlopt library. I had some 
problems with a big memory leak of about 20 MB per iteration in meep, that was 
causing my machine to run out of memory before converging (as I reported in the 
meep mailing list). That seems to be  solved now. However, there is still a 
smaller leak of about 1 MB per iteration due to guile 1.8.7: if I run code with 
guile 1.6.8, simulating an optimization, there is no memory leak, so I would 
like to use the nlopt library with guile 1.6.8. I have been trying to compile 
the nlopt library for guile 1.6.8, but it was unsuccessful. I tried, as usual, 
the ./configure, make, make install sequence, but when I then started guile and 
gave the command (use-modules (nlopt)) I got the following error message:

ERROR: In procedure dynamic-func:
ERROR: ./.libs/libnlopt.so.0: undefined symbol: scm_init_nlopt_module
ABORT: (misc-error)

For guile 1.8.7 the same commands successfully installed the guile interface to 
the nlopt library and I was able to run the guile example on the nlopt website. 
Further digging showed that the nlopt configure script reported a warning about 
linking to guile. 
The error message as taken from config.log is:

configure:15991: checking if linking to guile works
configure:16011: gcc -std=gnu99 -o conftest -g -O2    conftest.c -lguile 
-lguile-ltdl -Wl,-Bsymbolic-functions -lcrypt -lm -ldl -lm  >&5
configure:16017: WARNING: guile-config is broken

This warning did not occur for 1.8.7. It seems that the conftest.c application 
as used by the configure uses the scm_is_vector() function, which I think is 
not supported by guile 1.6.8. Changing this function to scm_gc() for testing 
purposes made the warning go away. However, then while compiling the swig 
wrappers for nlopt,  the build fails with 

nlopt-guile.cpp: In function ‘scm_unused_struct* 
_wrap_nlopt_opt_set_default_initial_step(scm_unused_struct*, 
scm_unused_struct*)’:
nlopt-guile.cpp:6843:52: error: ‘scm_from_locale_string’ was not declared in 
this scope
nlopt-guile.cpp:6848:52: error: ‘scm_from_locale_string’ was not declared in 
this scope

With the best guess I got from google, I defined 

#define scm_from_locale_string(x) scm_makfrom0str(x)

resulting in the following errrors:


nlopt-guile.cpp:1331:55: error: ‘SCM_SIMPLE_VECTOR_SET’ was not declared in 
this scope
nlopt-guile.cpp:1340:64: error: ‘SCM_SIMPLE_VECTOR_REF’ was not declared in 
this scope
nlopt-guile.cpp:1340:65: error: ‘scm_to_double’ was not declared in this scope
nlopt-guile.cpp:1343:27: error: ‘scm_to_double’ was not declared in this scope

'Fixing' these errors with

#define scm_to_double(x) (scm_num2dbl (x, "scm_to_double"))
#define SCM_SIMPLE_VECTOR_SET(v, idx, val) (SCM_VELTS (v)[(idx)] = (val))
#define SCM_SIMPLE_VECTOR_REF(v, idx)      (SCM_VELTS (v)[(idx)])

I finally got nlopt to compile and install, but the guile example on the nlopt 
web site fails with:

standard input:43:44: In expression (inf):
standard input:43:44: Unbound variable: inf


Moreover, some functions seem to work, like (nlopt-opt-set-xtol-rel opt ..) but 
(nlopt-opt-set-lower-bounds opt ... ) fails. At this point I'm unsure how to 
proceed (given that this was already quite hackery). I would appreciate any 
assistance to get nlopt working with guile 1.6.8.

Thanks in advance,

Lur Eguiluz

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

Reply via email to