[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: Add nlopt.
From: |
Ludovic Courtès |
Subject: |
01/01: gnu: Add nlopt. |
Date: |
Tue, 03 May 2016 19:58:26 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 1b39a196f82a4ce2d2e93b244c278e55650f65c5
Author: Roel Janssen <address@hidden>
Date: Tue May 3 14:30:25 2016 +0200
gnu: Add nlopt.
* gnu/packages/maths.scm (nlopt): New variable.
Co-authored-by: Ludovic Courtès <address@hidden>
---
gnu/packages/maths.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index d37897d..9ba7138 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -59,6 +59,7 @@
#:use-module (gnu packages less)
#:use-module (gnu packages lisp)
#:use-module (gnu packages gnome)
+ #:use-module (gnu packages guile)
#:use-module (gnu packages xorg)
#:use-module (gnu packages gl)
#:use-module (gnu packages m4)
@@ -430,6 +431,44 @@ extremely large and complex data collections.")
(license (license:x11-style
"http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
+(define-public nlopt
+ (package
+ (name "nlopt")
+ (version "2.4.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
+ version ".tar.gz"))
+ (sha256
+ (base32
"12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(;; Shared libraries are not built by default. They are required to
+ ;; build the Guile, Octave, and Python bindings.
+ #:configure-flags '("--enable-shared")
+
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'set-libnlopt-file-name
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Make sure the Scheme module refers to the library by its
+ ;; absolute file name (we cannot do that from a snippet
+ ;; because the expansion of @libdir@ contains
+ ;; ${exec_prefix}.)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* "swig/nlopt.scm.in"
+ (("libnlopt")
+ (string-append out "/lib/libnlopt")))
+ #t))))))
+ (inputs `(("guile" ,guile-2.0)))
+ (native-inputs `(("pkg-config" ,pkg-config)))
+ (home-page "http://ab-initio.mit.edu/wiki/")
+ (synopsis "Library for nonlinear optimization")
+ (description "NLopt is a library for nonlinear optimization, providing a
+common interface for a number of different free optimization routines available
+online as well as original implementations of various other algorithms.")
+ (license license:lgpl2.1+)))
+
;; For a fully featured Octave, users are strongly recommended also to install
;; the following packages: texinfo, less, ghostscript, gnuplot.