chiark / gitweb /
allow cxx library to be installed simultaneously with non-cxx
authorstevenj <stevenj@alum.mit.edu>
Tue, 29 Jul 2008 17:36:17 +0000 (13:36 -0400)
committerstevenj <stevenj@alum.mit.edu>
Tue, 29 Jul 2008 17:36:17 +0000 (13:36 -0400)
darcs-hash:20080729173617-c8de0-e9479d60f1f9cd9da68867e219449884c77768f7.gz

Makefile.am
configure.ac
octave/Makefile.am
octave/NLOPT_GD_STOGO.m
octave/NLOPT_GD_STOGO_RAND.m
octave/mkconstants.sh
test/Makefile.am

index 3570f88ad527ee9ce28c9461ac933aa5d62cb48b..4bfe81591f380db5c9030876bda4da5d52b1f49e 100644 (file)
@@ -1,5 +1,5 @@
 OPTIONS_AUTOMAKE=gnu
-lib_LTLIBRARIES = libnlopt.la
+lib_LTLIBRARIES = libnlopt@NLOPT_SUFFIX@.la
 
 ACLOCAL_AMFLAGS=-I ./m4
 
@@ -15,13 +15,13 @@ if WITH_NOCEDAL
 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
index 4f98d81e0054656e229e782de3adfa54323f22ba..a8030849fc1cde0f097b534d79cb105cd7d23ca9 100644 (file)
@@ -18,6 +18,7 @@ AC_PROG_MAKE_SET
 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)
@@ -25,7 +26,9 @@ AM_CONDITIONAL(WITH_CXX, test "x$with_cxx" = xyes)
 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
@@ -64,7 +67,9 @@ AC_MSG_RESULT(${ok})
 
 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])
index 0de0af26ab278e3c68cac4416b10591d80b8ec5e..cb11f15443f543a231f5be6a820c7757093748ad 100644 (file)
@@ -11,7 +11,7 @@ m_DATA = $(MFILES) nlopt_minimize.m
 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 \\" > $@
@@ -25,7 +25,7 @@ mex_DATA = nlopt_minimize.$(MEXSUFF) $(MFILES) nlopt_minimize.m
 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@
 
 #######################################################################
 
index e648885dd525c5d2624c99b283c2d2c72f737f3f..67575c09dc17c7fffca553917506cb86761fdb76 100644 (file)
@@ -1,4 +1,4 @@
-% NLOPT_GD_STOGO: StoGO (NOT COMPILED)
+% NLOPT_GD_STOGO: StoGO (global, derivative-based)
 %
 % See nlopt_minimize for more information.
 function val = NLOPT_GD_STOGO
index c9546c997dda771204f07acdf8b5ab7cc9d8c14b..decd945794d5b07146e38f88fe6e59e8dc18237e 100644 (file)
@@ -1,4 +1,4 @@
-% 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
index 47aef440163ab7d37cf5b6e6ceb717995a253837..aec541a386ccc10dfb61692363d6c665ba79417b 100755 (executable)
@@ -3,7 +3,7 @@
 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
index 0851054e5286514d5766513a19468f710e5bdd38..dd2476bcdb9e519b316310c77f81405697cc5998 100644 (file)
@@ -3,4 +3,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/api -I$(top_srcdir)/util
 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