Hello,

I have NLopt 2.4.2, and I'm trying to run the example in the tutorial
under Guile 1.8.8.

First, I had to modify the example slightly, to deal with 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)))

....

Second, I invoke guile as  "guile -L /opt/nlopt/share/guile/site" so it
can find nlopt.scm.

But the result is the following 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>



                            Kostas


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

Reply via email to