Hello,
I've managed to install nlopt-2.1.2 with Python bindings
However, there have been some issues.
I'm using Linux (Ubuntu), Python 2.6

The shell command I ran successfully is:
b45...@shlp:/tmp/nlopt-2.1.2$ ./configure
--prefix=/home/b45ch1/workspace/tmp/nlopt-2.1.2 --enable-shared
Python=python && make && sudo make install

1) for some reason I needed root access:
if I run simply

$ make install

I get the error:
...
test -z "/home/b45ch1/workspace/tmp/nlopt-lala/lib" || /bin/mkdir -p
"/home/b45ch1/workspace/tmp/nlopt-lala/lib"
 /bin/bash ./libtool   --mode=install /usr/bin/install -c
libnlopt.la '/home/b45ch1/workspace/tmp/nlopt-lala/lib'
libtool: install: /usr/bin/install -c .libs/libnlopt.so.0.4.2
/home/b45ch1/workspace/tmp/nlopt-lala/lib/libnlopt.so.0.4.2
libtool: install: (cd /home/b45ch1/workspace/tmp/nlopt-lala/lib && {
ln -s -f libnlopt.so.0.4.2 libnlopt.so.0 || { rm -f libnlopt.so.0 &&
ln -s libnlopt.so.0.4.2 libnlopt.so.0; }; })
libtool: install: (cd /home/b45ch1/workspace/tmp/nlopt-lala/lib && {
ln -s -f libnlopt.so.0.4.2 libnlopt.so || { rm -f libnlopt.so && ln -s
libnlopt.so.0.4.2 libnlopt.so; }; })
libtool: install: /usr/bin/install -c .libs/libnlopt.lai
/home/b45ch1/workspace/tmp/nlopt-lala/lib/libnlopt.la
libtool: install: /usr/bin/install -c .libs/libnlopt.a
/home/b45ch1/workspace/tmp/nlopt-lala/lib/libnlopt.a
libtool: install: chmod 644 /home/b45ch1/workspace/tmp/nlopt-lala/lib/libnlopt.a
libtool: install: ranlib /home/b45ch1/workspace/tmp/nlopt-lala/lib/libnlopt.a
libtool: install: warning: remember to run `libtool --finish
/home/b45ch1/workspace/tmp/nlopt-2.1.2/lib'
test -z "/home/b45ch1/workspace/tmp/nlopt-lala/lib/pkgconfig" ||
/bin/mkdir -p "/home/b45ch1/workspace/tmp/nlopt-lala/lib/pkgconfig"
 /usr/bin/install -c -m 644 nlopt.pc
'/home/b45ch1/workspace/tmp/nlopt-lala/lib/pkgconfig'
make[2]: Leaving directory `/tmp/nlopt-2.1.2'
make[1]: Leaving directory `/tmp/nlopt-2.1.2'
Making install in octave
make[1]: Entering directory `/tmp/nlopt-2.1.2/octave'
make[2]: Entering directory `/tmp/nlopt-2.1.2/octave'
make[2]: Nothing to be done for `install-exec-am'.
test -z "" || /bin/mkdir -p ""
test -z "" || /bin/mkdir -p ""
test -z "" || /bin/mkdir -p ""
make[2]: Leaving directory `/tmp/nlopt-2.1.2/octave'
make[1]: Leaving directory `/tmp/nlopt-2.1.2/octave'
Making install in test
make[1]: Entering directory `/tmp/nlopt-2.1.2/test'
make[2]: Entering directory `/tmp/nlopt-2.1.2/test'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/nlopt-2.1.2/test'
make[1]: Leaving directory `/tmp/nlopt-2.1.2/test'
Making install in swig
make[1]: Entering directory `/tmp/nlopt-2.1.2/swig'
make  install-am
make[2]: Entering directory `/tmp/nlopt-2.1.2/swig'
make[3]: Entering directory `/tmp/nlopt-2.1.2/swig'
test -z "/home/b45ch1/workspace/tmp/nlopt-lala/lib" || /bin/mkdir -p
"/home/b45ch1/workspace/tmp/nlopt-lala/lib"
test -z "/home/b45ch1/workspace/tmp/nlopt-lala/lib/python2.6/site-packages"
|| /bin/mkdir -p
"/home/b45ch1/workspace/tmp/nlopt-lala/lib/python2.6/site-packages"
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   _nlopt.la
'/home/b45ch1/workspace/tmp/nlopt-lala/lib/python2.6/site-packages'
libtool: install: error: cannot install `_nlopt.la' to a directory not
ending in /home/b45ch1/workspace/tmp/nlopt-2.1.2/lib/python2.6/site-packages
make[3]: *** [install-pyexecLTLIBRARIES] Error 1
make[3]: Leaving directory `/tmp/nlopt-2.1.2/swig'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/tmp/nlopt-2.1.2/swig'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/tmp/nlopt-2.1.2/swig'
make: *** [install-recursive] Error 1

2) Another issue is that the files are written to
lib/python2.6/site-packages

However, on my ubuntu machine I only have
/usr/lib/python2.6/dist-packages

i.e. there is no site-packages, which results in an error when installing with
./configure --enable-shared Python=python && make && install

3) I think it would be nice if you could make a package

nlopt/
   __init__.py
   nlopt.py
   _nlopt.so

or similar.  At the moment, the site-packages gets cluttered with many files
b45...@shlp:~/workspace/tmp/nlopt-2.1.2/lib/python2.6/site-packages$ ls
_nlopt.a   nlopt.py   nlopt.pyo  _nlopt.so.0
_nlopt.la  nlopt.pyc  _nlopt.so  _nlopt.so.0.4.2



4) It would be nice if nlopt.py had a docstring that gives a simple
example that helps you get started:

In [7]: import nlopt

In [8]: nlopt?
Type:           module
Base Class:     <type 'module'>
String Form:    <module 'nlopt' from
'/home/b45ch1/workspace/tmp/nlopt-2.1.2/lib/python2.6/site-packages/nlopt.py'>
Namespace:      Interactive
File:
/home/b45ch1/workspace/tmp/nlopt-2.1.2/lib/python2.6/site-packages/nlopt.py
Docstring:
    <no docstring>




best regards,
Sebastian

run

On Thu, Jul 8, 2010 at 11:50 PM, Steven G. Johnson
<[email protected]> wrote:
> Dear NLopt users,
>
> NLopt 2.1.2 is now available from the NLopt web page
> (http://ab-initio.mit.edu/nlopt), fixing a couple of minor bugs in the last
> release, and changing the Python vector-valued constraint interface to use a
> more natural 2d array for the gradient.
>
> Regards,
> Steven G. Johnson
>
> NLopt 2.1.2 (8 July 2010)
>
> * The Python mconstraint (vector-valued constraint) functions
>  now pass a 2-dimensional array for the gradient argument, rather
>  than a flattened 1d array.
>
> * Improved handling of exceptions and forced stops for constrained
>  optimization, making sure that no constraints are evaluated after
>  the stop.
>
> * Return an NLOPT_INVALID_ARGS error if more than n equality constraints
>  are added in an n-dimensional problem.
>
> * Fix bug that could cause spurious NLOPT_INVALID_ARGS errors when
>  adding constraints under rare circumstances.
>
> * Eliminate a few small memory leaks that could occur under error
> conditions.
>
>
> _______________________________________________
> NLopt-discuss mailing list
> [email protected]
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
>

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

Reply via email to