Package Details: nlopt 2.4.2-2

Git Clone URL: https://aur.archlinux.org/nlopt.git (read-only)
Package Base: nlopt
Description: nonlinear optimization library
Upstream URL: http://ab-initio.mit.edu/wiki/index.php/NLopt
Licenses: LGPL
Submitter: dkremer
Maintainer: xantares
Last Packager: xantares
Votes: 17
Popularity: 0.142302
First Submitted: 2010-10-31 19:17
Last Updated: 2015-09-11 20:58

Dependencies (8)

Required by (8)

Sources (2)

Latest Comments

poluyan commented on 2015-09-11 12:07

There is a problem in file nlopt_optimize-oct.cc. Octave_map class is deprecated and must be replaced by octave_map. With this change the package builds successfully.

bchretien commented on 2014-03-10 18:54

+1 on linker error and on kett's fix.

kett commented on 2014-01-22 19:46

The LDFLAG --as-needed prevents it from being built, which is a part of /etc/makepkg.conf by default. To remove it, add the following line to the PKGBUILD:

export LDFLAGS="${LDFLAGS//,--as-needed}"

It should be inserted before configure is called either time.

lmccl commented on 2014-01-19 23:38

I'm getting a link error when trying to build the package with makepkg:

[...]
/bin/sh ../libtool --tag=CXX --mode=link g++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fpermissive -Wl,-O1,--sort-common,--as-needed,-z,relro -o testopt testfuncs.o testopt.o ../libnlopt_cxx.la -lm
libtool: link: g++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fpermissive -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z -Wl,relro -o .libs/testopt testfuncs.o testopt.o ../.libs/libnlopt_cxx.so -lm
../.libs/libnlopt_cxx.so: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
[...]

dtag commented on 2013-08-11 09:31

Thank you. Works again.

xantares commented on 2013-08-09 20:58

My bad, fixed.
x.

dtag commented on 2013-08-08 10:50

In the build_cxx folder, the ./configure call needs a --with-cxx parameter. Otherwise the cxx library is not built correctly.

xantares commented on 2013-07-30 07:42

Ok, it's fixed.

xantares commented on 2013-07-30 07:42

Ok, it's fixed.

xantares commented on 2013-07-30 07:42

Ok, it's fixed.

xantares commented on 2013-07-30 07:42

Ok, it's fixed.

xantares commented on 2013-07-30 07:42

Ok, it's fixed.

xantares commented on 2013-07-25 21:07

Hi,

There are several problems with this package:

1. out-of-source build bug:
sed -i "s|top_builddir)/api|top_srcdir)/api|g" swig/Makefile.am
autoreconf --verbose --install --symlink --force

2. should depend on gcc libs:
depends=('gcc-libs')

3. should makedepend on autotools, python-numpy, octave:
makedepends=('libtool' 'automake' 'autoconf' 'gcc' 'python2-numpy' 'octave')

4. I wouldn't optdepend on matlab:
optdepends=('octave: for use with octave',
'python2: for use with python',
'python-numpy: for use with python')

5. the guile module doesn't build, disable it:
--without-guile

6. unwanted libtool files:
rm $pkgdir/usr/lib/*.la

Below is the complete file.

Regards.


# Maintainer: David Kremer <david.kremer.dk@gmail.com>

pkgname=nlopt
pkgver=2.3
pkgrel=2
pkgdesc="nlopt : a non-linear optimization package, callable from C, C++, Fortran, Matlab \
or GNU Octave, Python, GNU Guile, and GNU R."
arch=('i686' 'x86_64')
url="http://ab-initio.mit.edu/wiki/index.php/NLopt"
license=('LGPL')
depends=('gcc-libs')
makedepends=('libtool' 'automake' 'autoconf' 'gcc' 'python2-numpy' 'octave')
optdepends=('octave: for use with octave',
'python2: for use with python',
'python-numpy: for use with python')
source=("http://ab-initio.mit.edu/nlopt/$pkgname-$pkgver.tar.gz")
md5sums=('811a9f1c7a7f879c7d7b4caa059eb8d6')

build() {
cd $srcdir/$pkgname-$pkgver
sed -i "s|top_builddir)/api|top_srcdir)/api|g" swig/Makefile.am
autoreconf --verbose --install --symlink --force
mkdir build_cxx
cd build_cxx
../configure --prefix=/usr --enable-shared PYTHON=python2 --with-cxx --without-guile
cd ..
mkdir build
cd build
../configure --prefix=/usr --enable-shared PYTHON=python2 --without-guile
}

package() {
cd $srcdir/$pkgname-$pkgver/build_cxx
make DESTDIR=$pkgdir install
cd ../build
make DESTDIR=$pkgdir install
rm $pkgdir/usr/lib/*.la
}

dreieck commented on 2013-03-08 10:51

For me, makepkg fails:

==>
[...]
make[2]: Entering directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/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 `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/test'
make[1]: Leaving directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/test'
Making install in swig
make[1]: Entering directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/swig'
make install-am
make[2]: Entering directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/swig'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../swig -I.. -pthread -I../api -g0 -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fpermissive -Wwrite-strings -fomit-frame-pointer -MT libnlopt_cxx_guile_la-nlopt-guile.lo -MD -MP -MF .deps/libnlopt_cxx_guile_la-nlopt-guile.Tpo -c -o libnlopt_cxx_guile_la-nlopt-guile.lo `test -f 'nlopt-guile.cpp' || echo '../../swig/'`nlopt-guile.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../swig -I.. -pthread -I../api -g0 -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fpermissive -Wwrite-strings -fomit-frame-pointer -MT libnlopt_cxx_guile_la-nlopt-guile.lo -MD -MP -MF .deps/libnlopt_cxx_guile_la-nlopt-guile.Tpo -c ../../swig/nlopt-guile.cpp -fPIC -DPIC -o .libs/libnlopt_cxx_guile_la-nlopt-guile.o
../../swig/nlopt-guile.cpp:1274:21: fatal error: nlopt.hpp: No such file or directory
compilation terminated.
make[2]: *** [libnlopt_cxx_guile_la-nlopt-guile.lo] Error 1
make[2]: Leaving directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/swig'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/var/tmp/yaourt-tmp-root/aur-nlopt/src/nlopt-2.3/build_cxx/swig'
make: *** [install-recursive] Error 1

<==

svitenti commented on 2012-09-20 12:39

This solution don't work since it reconfigure in the same dir and always install last version (configured) only (the pure C). The problem is in the package itself, they use $(top_builddir)/api instead of $(top_srcdir)/api . I made a patch to solve this and already sent to the packager maintainer.

tnoo commented on 2012-09-20 03:52

Building from within ./build does not work for me (Symbol Error). Building within the source directory works fine, though.

build() {
cd $srcdir/$pkgname-$pkgver
./configure --prefix=/usr --enable-shared PYTHON=python2 --with-cxx
make
./configure --prefix=/usr --enable-shared PYTHON=python2
make
}

dkremer commented on 2012-09-17 20:47

ok done

svitenti commented on 2012-09-17 20:04

Ok, I'm using the modified PKGBUILD for a while and didn't had any problems, however, I've been testing it with C projects only. Since it distributes different headers and libraries for each build I don't think that any conflicts will occur.

Other people already experienced similar problems (http://article.gmane.org/gmane.science.analysis.nlopt.general/358). Therefore, the best solution would be to contact the nlopt developers to try to figure this out.

Thank you for your time.

dkremer commented on 2012-09-17 19:52

Ok, I can see at least two problems.

1) the PKGBUILD file is not more really regular, maybe it fits anyway the AUR standards, but I am not sure, I need to check.
2) Are they some file conflicts between the regular C compilation and the C++ compilation ?

for 1) , that's not a so big problem, but I'll check. For 2) also it doesn't seem to be a problem, since I suppose you tested your stuff better than I will.

So, I will probably do that change, let me know if you experiment some problems with this method.

svitenti commented on 2012-09-17 11:28

It is not the case, the C library is not built when you pass --with-cxx. The point is to not have to compile my C project using g++, this would slow down a lot the compilation time. Of course I can always modify PKGBUILD myself, which is what I do, however, as there are people using nlopt for both C and C++ project I don't see why the distribution has to be C++ only, adding the fact that the solution is so simple.

dkremer commented on 2012-09-17 10:33

@svitenti:

I can't understand what's the point. I thought that the C lib was built along with the C++ lib but now you tell me that it is not the case.

If you feel the need for the C library only, please modify the PKGBUILD for yourself.

svitenti commented on 2012-07-10 16:25

Hi, is it possible to change the PKGBUILD build and package
to match the following. This is necessary to build both
libnlopt and libnlopt_cxx.

build() {
cd $srcdir/$pkgname-$pkgver
mkdir build_cxx
cd build_cxx
../configure --prefix=/usr --enable-shared PYTHON=python2 --with-cxx
cd ..
mkdir build
cd build
../configure --prefix=/usr --enable-shared PYTHON=python2
}

package() {
cd $srcdir/$pkgname-$pkgver/build_cxx
make DESTDIR=$pkgdir install
cd ../build
make DESTDIR=$pkgdir install
}