OPTIONS_AUTOMAKE=gnu
-lib_LTLIBRARIES = libnlopt.la
+lib_LTLIBRARIES = libnlopt@NLOPT_SUFFIX@.la
ACLOCAL_AMFLAGS=-I ./m4
NOCEDAL_LBFGS=lbfgs/liblbfgs.la
endif
-libnlopt_la_SOURCES =
-libnlopt_la_LIBADD = subplex/libsubplex.la direct/libdirect.la \
-cdirect/libcdirect.la $(CXX_LIBS) praxis/libpraxis.la $(NOCEDAL_LBFGS) \
-luksan/libluksan.la crs/libcrs.la mlsl/libmlsl.la mma/libmma.la \
-api/libapi.la util/libutil.la
+libnlopt@NLOPT_SUFFIX@_la_SOURCES =
+libnlopt@NLOPT_SUFFIX@_la_LIBADD = subplex/libsubplex.la \
+direct/libdirect.la cdirect/libcdirect.la $(CXX_LIBS) \
+praxis/libpraxis.la $(NOCEDAL_LBFGS) luksan/libluksan.la crs/libcrs.la \
+mlsl/libmlsl.la mma/libmma.la api/libapi.la util/libutil.la
-libnlopt_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
+libnlopt@NLOPT_SUFFIX@_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = nlopt.pc
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
+NLOPT_SUFFIX=""
AC_ARG_WITH(cxx,
[AC_HELP_STRING([--with-cxx], [include C++-based routines])],
with_cxx=$withval,with_cxx=no)
if test "x$with_cxx" = xyes; then
AC_PROG_CXX
AC_DEFINE([WITH_CXX], 1, [Define if compiled including C++-based routines])
+ NLOPT_SUFFIX="_cxx"
fi
+AC_SUBST(NLOPT_SUFFIX)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDC
dnl -----------------------------------------------------------------------
-test -r $srcdir/lbfgs/ap.cpp && test -r $srcdir/lbfgs/ap.h && test -r $srcdir/lbfgs/l-bfgs-b.cpp && test -r $srcdir/lbfgs/l-bfgs-b.h && have_lbfgs=yes
+if test "x$with_cxx" = xyes; then
+ test -r $srcdir/lbfgs/ap.cpp && test -r $srcdir/lbfgs/ap.h && test -r $srcdir/lbfgs/l-bfgs-b.cpp && test -r $srcdir/lbfgs/l-bfgs-b.h && have_lbfgs=yes
+fi
AM_CONDITIONAL(WITH_NOCEDAL, test -n "$have_lbfgs")
if test -n "$have_lbfgs"; then
AC_DEFINE(WITH_NOCEDAL, [1], [Define if we have the non-free Nocedal LBFGS code])
endif
nlopt_minimize.oct: nlopt_minimize-oct.cc nlopt_minimize_usage.h
- $(MKOCTFILE) -o $@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(srcdir)/nlopt_minimize-oct.cc $(LDFLAGS) -L$(top_builddir)/.libs -lnlopt
+ $(MKOCTFILE) -o $@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(srcdir)/nlopt_minimize-oct.cc $(LDFLAGS) -L$(top_builddir)/.libs -lnlopt@NLOPT_SUFFIX@
nlopt_minimize_usage.h: $(srcdir)/nlopt_minimize.m
echo "#define NLOPT_MINIMIZE_USAGE \\" > $@
endif
nlopt_minimize.$(MEXSUFF): nlopt_minimize-mex.c
- $(MEX) -output nlopt_minimize -O $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(srcdir)/nlopt_minimize-mex.c $(LDFLAGS) -L$(top_builddir)/.libs -lnlopt
+ $(MEX) -output nlopt_minimize -O $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(srcdir)/nlopt_minimize-mex.c $(LDFLAGS) -L$(top_builddir)/.libs -lnlopt@NLOPT_SUFFIX@
#######################################################################
-% NLOPT_GD_STOGO: StoGO (NOT COMPILED)
+% NLOPT_GD_STOGO: StoGO (global, derivative-based)
%
% See nlopt_minimize for more information.
function val = NLOPT_GD_STOGO
-% NLOPT_GD_STOGO_RAND: StoGO randomized (NOT COMPILED)
+% NLOPT_GD_STOGO_RAND: StoGO with randomized search (global, derivative-based)
%
% See nlopt_minimize for more information.
function val = NLOPT_GD_STOGO_RAND
names=`egrep NLOPT_[LG][ND] ../api/nlopt.h |sed 's/ //g' |tr = , |cut -d, -f1`
i=0
-gcc -E ../api/nlopt.c | perl -pe 's/^ *\n//' > foo.c
+gcc -I.. -E ../api/nlopt.c | perl -pe 's/^ *\n//' > foo.c
desc_start=`grep -n nlopt_algorithm_names foo.c |cut -d: -f1 |head -1`
for n in $names; do
noinst_PROGRAMS = testopt
testopt_SOURCES = testfuncs.c testfuncs.h testopt.cpp
-testopt_LDADD = $(top_builddir)/libnlopt.la
+testopt_LDADD = $(top_builddir)/libnlopt@NLOPT_SUFFIX@.la