Skip to content

Commit

Permalink
Added configure option: --with(out)-all-solvers
Browse files Browse the repository at this point in the history
 - compile with NO solvers is broken, otherwise works properly
  • Loading branch information
boyle committed Apr 19, 2011
1 parent b6a3c25 commit 449349d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -34,7 +34,7 @@ and would like to install it in your home directory)
If you've used the get_dependancies script then you probably
want to run configure with

./configure LDFLAGS="-L$PWD/$(gcc -dumpmachine)/lib -Wl,-rpath,$PWD/$(gcc -dumpmachine)/lib" CPPFLAGS="-I $PWD/$(gcc -dumpmachine)/include" --prefix=$PWD/installed --enable-debug=yes
./configure LDFLAGS="-L$PWD/$(gcc -dumpmachine)/lib -Wl,-rpath,$PWD/$(gcc -dumpmachine)/lib" CPPFLAGS="-I $PWD/$(gcc -dumpmachine)/include" --prefix=$PWD/installed --enable-debug=yes --with-all-solvers

or something similar. The -L and -I directories should be
current locations for the files, while the -rpath should
Expand Down
3 changes: 3 additions & 0 deletions TODO
Expand Up @@ -50,6 +50,9 @@ These are somewhat arranged in order of priority. Highest at the top.
- fix "inline" in matrix.c/h
- extend tests/unit-matrix.c to push things harder

- configure:
- allow compile with no solvers (--without-all-solvers) (adds requirement for MPI, openMP dependencies)

Fix memory leaks:
- Run valgrind. Find bad allocations and uninitialized variables.

Expand Down
22 changes: 16 additions & 6 deletions configure.ac
Expand Up @@ -78,11 +78,12 @@ AC_CONFIG_FILES([Makefile])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
#AC_OPENMP

# Checks for libraries.
AC_SEARCH_LIBS([load_sparse_matrix], [sparse_matrix_converter],,AC_MSG_ERROR([missing BeBOP sparse matrix I/O library]))

AC_ARG_WITH(all-solvers, AS_HELP_STRING(--with-all-solvers, Force presence of all solvers))

m4_define([MC_WITH_LIB],[
dnl ---------------------------------
Expand All @@ -100,22 +101,31 @@ m4_define(MC_EXTRA_FLAGS, $5)
AC_ARG_WITH(MC_LOWERNAME,
AS_HELP_STRING([--without-]MC_LOWERNAME, [Ignore presence of ]MC_FULLNAME[ solver and disable it]))
dnl force value for all solvers if --with-all-solvers
AS_IF([test "x$with_all_solvers" = "xyes"],
[with_]MC_LOWERNAME[=yes],
[test "x$with_all_solvers" = "xno"],
[with_]MC_LOWERNAME[=no]
)
dnl test for library unless explicitly disabled
MC_EXTRA_CODE
AS_IF([test "x$with_]MC_LOWERNAME[" != "xno"],
[
AC_SEARCH_LIBS(]MC_FUNC[,]MC_LIB[,have_]MC_LOWERNAME[=yes], [have_]MC_LOWERNAME[=no],MC_EXTRA_FLAGS[)
AC_SEARCH_LIBS(]MC_FUNC[,]MC_LIB[,have_]MC_LOWERNAME[=yes,have_]MC_LOWERNAME[=no,]MC_EXTRA_FLAGS[)
],
[have_]MC_LOWERNAME[=no
AC_MSG_CHECKING(for library containing ]MC_FUNC[)
AC_MSG_RESULT(<skipped>)]
)
dnl if its found, then all good
dnl if it wasn't found and it was required, then error
AS_IF([test "x$have_]MC_LOWERNAME[" = "xyes"],
[AC_DEFINE(HAVE_]MC_UPPERNAME[,1,]MC_FULLNAME[ solver is available)],
[AS_IF([test "x$with_]MC_LOWERNAME[" = "xyes"],
[AC_MSG_ERROR(MC_FULLNAME[ solver requested but not found])
])
])
[test "x$with_]MC_LOWERNAME[" = "xyes"],
[AC_MSG_ERROR(]MC_FULLNAME[ solver requested but not found)]
)
AM_CONDITIONAL([HAVE_]MC_UPPERNAME,[test "x$have_]MC_LOWERNAME[" = "xyes"])
AC_SUBST([have_]MC_LOWERNAME)
Expand Down

0 comments on commit 449349d

Please sign in to comment.