Browse Source

mlr: adapting configuration so that min-dgels compilation is done with main Makefile

Luka Stanisic 8 years ago
parent
commit
4873d1c036
2 changed files with 16 additions and 10 deletions
  1. 8 1
      Makefile.am
  2. 8 9
      configure.ac

+ 8 - 1
Makefile.am

@@ -19,7 +19,14 @@
 ACLOCAL_AMFLAGS=-I m4
 ACLOCAL_AMFLAGS=-I m4
 CLEANFILES = *.gcno *.gcda *.linkinfo
 CLEANFILES = *.gcno *.gcda *.linkinfo
 
 
-SUBDIRS = src
+SUBDIRS = 
+
+if STARPU_USE_MIN_DGELS
+SUBDIRS += min-dgels
+endif
+
+SUBDIRS += src
+
 SUBDIRS += tools
 SUBDIRS += tools
 
 
 if BUILD_TESTS
 if BUILD_TESTS

+ 8 - 9
configure.ac

@@ -1135,6 +1135,7 @@ AC_ARG_ENABLE(mlr, [AS_HELP_STRING([--disable-mlr],
 			[Disable multiple linear regression models])],
 			[Disable multiple linear regression models])],
 			enable_mlr=$enableval, enable_mlr=yes)
 			enable_mlr=$enableval, enable_mlr=yes)
 
 
+install_min_dgels=no
 if test x$enable_mlr = xyes; then
 if test x$enable_mlr = xyes; then
    	STARPU_SEARCH_LIBS(LAPACK,[dgels_],[lapack],use_system_lapack=yes,,)
    	STARPU_SEARCH_LIBS(LAPACK,[dgels_],[lapack],use_system_lapack=yes,,)
 	if test x$use_system_lapack = xyes; then
 	if test x$use_system_lapack = xyes; then
@@ -1148,21 +1149,19 @@ if test x$enable_mlr = xyes; then
 			LDFLAGS="$DGELS_LIBS $LDFLAGS"
 			LDFLAGS="$DGELS_LIBS $LDFLAGS"
 			AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
 			AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
 		else
 		else
-			AC_MSG_RESULT(no-need to install LAPACK or min-dgels library)
-			AC_MSG_CHECKING(installation of min-dgels)
-			mkdir -p min-dgels-build
-			cd $STARPU_SRC_DIR/min-dgels
-			make 1> $STARPU_BUILD_DIR/min-dgels-build/min-dgels.out 2> $STARPU_BUILD_DIR/min-dgels-build/min-dgels.err
-			cd -
-			cp $STARPU_SRC_DIR/min-dgels/build/*.a min-dgels-build/
-			AC_MSG_RESULT(done)
-			DGELS_LIBS="-Wl,--start-group $STARPU_BUILD_DIR/min-dgels-build/*.a -Wl,--end-group"
+			AC_MSG_RESULT(no)
+			AC_MSG_CHECKING(min-dgels source)
+			cp -r $srcdir/min-dgels $PWD/
+			AC_MSG_RESULT(yes)
+			DGELS_LIBS="-Wl,--start-group $STARPU_BUILD_DIR/min-dgels/build/*.a -Wl,--end-group"
 			AC_DEFINE(STARPU_MLR_MODEL, [1], [use user defined library])
 			AC_DEFINE(STARPU_MLR_MODEL, [1], [use user defined library])
 			LDFLAGS="$DGELS_LIBS $LDFLAGS"
 			LDFLAGS="$DGELS_LIBS $LDFLAGS"
 			AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
 			AC_ARG_VAR([DGELS_LIBS], [linker flags for lapack dgels])
+			install_min_dgels=yes
 		fi
 		fi
 	fi
 	fi
 fi
 fi
+AM_CONDITIONAL(STARPU_USE_MIN_DGELS, test x$install_min_dgels = xyes)
 
 
 ###############################################################################
 ###############################################################################
 #                                                                             #
 #                                                                             #