Hello,

I am trying to use nlopt 2.4.2 with the Scheme/Guile interface.
I have Guile 1.8.8, and nlopt is installed in /opt/nlopt.

I modified the example in the tutorial slightly, to set LD_LIBRARY_PATH:

(setenv "LD_LIBRARY_PATH" "/opt/nlopt/lib")
(use-modules (nlopt))

(define (fx x grad)
  (if grad
      (begin
        (vector-set! grad 0 0.0)
        (vector-set! grad 1 (/ 0.5 (sqrt (vector-ref x 1))))))
  (sqrt (vector-ref x 1)))

...

I also have to start guile with "guile -L /opt/nlopt/share/guile/site"
so that it can find the nlopt.scm file.

After I do all this, the result is an error:

guile> 
Backtrace:
In unknown file:
   ?: 0* [primitive-load "/usr/home/ko/projects/nlopt/ex.scm"]
In /usr/home/ko/projects/nlopt/ex.scm:
  31: 1* (define opt (new-nlopt-opt NLOPT-LD-MMA 2))
  31: 2* (new-nlopt-opt NLOPT-LD-MMA 2)

/usr/home/ko/projects/nlopt/ex.scm:31:13: In expression (new-nlopt-opt
NLOPT-LD-MMA 2):
/usr/home/ko/projects/nlopt/ex.scm:31:13: Unbound variable: new-nlopt-opt
ABORT: (unbound-variable)
guile> 

Any help would be appreciated.

Kostas






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

Reply via email to