From 014d6fdacb4c590b2e840188ce07a151c20e7eb8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 9 Mar 2009 00:43:18 +0000 Subject: [PATCH] configure support for ProbLog --- config.h.in | 1 + configure | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++- configure.in | 37 +++++++- 3 files changed, 297 insertions(+), 3 deletions(-) diff --git a/config.h.in b/config.h.in index 1cfaa1c34..7aa3006da 100644 --- a/config.h.in +++ b/config.h.in @@ -50,6 +50,7 @@ #undef HAVE_ARPA_INET_H #undef HAVE_CTYPE_H +#undef HAVE_CUDD_H #undef HAVE_DIRECT_H #undef HAVE_DIRENT_H #undef HAVE_DLFCN_H diff --git a/configure b/configure index 071267d57..2fc1baef0 100755 --- a/configure +++ b/configure @@ -722,6 +722,9 @@ LAMOBJS MAX_WORKERS STATIC_MODE ENABLE_WINCONSOLE +USE_CUDD +CUDD_LDFLAGS +CUDD_CPPFLAGS INSTALL_MATLAB MATLAB_INCLUDE M4GENABSMI @@ -1344,6 +1347,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gmp=DIR use GNU Multiple Precision in DIR + --with-cudd=DIR use CUDD package in DIR --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME --with-readline=DIR use GNU Readline Library in DIR --with-matlab=DIR use MATLAB package in DIR @@ -2891,6 +2895,23 @@ else fi + +# Check whether --with-cudd was given. +if test "${with_cudd+set}" = set; then + withval=$with_cudd; if test "$withval" = yes; then + yap_cv_cudd=yes + elif test "$withval" = no; then + yap_cv_cudd=no + else + yap_cv_cudd=$with_cudd + CUDD_LDFLAGS="$yap_cv_cudd/cudd/libcudd.a $yap_cv_cudd/mtr/libmtr.a $yap_cv_cudd/st/libst.a $yap_cv_cudd/util/libutil.a $yap_cv_cudd/epd/libepd.a " + CUDD_CPPFLAGS="-I $yap_cv_cudd/include" + fi +else + yap_cv_cudd=yes +fi + + # Check whether --enable-myddas was given. if test "${enable_myddas+set}" = set; then enableval=$enable_myddas; if test "$enableval" = yes; then @@ -3363,6 +3384,13 @@ else INSTALL_MATLAB="" fi +if test "$yap_cv_cudd" = no +then + USE_CUDD="# " +else + USE_CUDD="" +fi + if test "$use_condor" = yes then use_malloc="yes" @@ -4866,6 +4894,81 @@ fi fi +if test "$yap_cv_cudd" != "no" +then + +{ echo "$as_me:$LINENO: checking for Cudd_Init in -lcudd" >&5 +echo $ECHO_N "checking for Cudd_Init in -lcudd... $ECHO_C" >&6; } +if test "${ac_cv_lib_cudd_Cudd_Init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcudd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Cudd_Init (); +int +main () +{ +return Cudd_Init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_cudd_Cudd_Init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_cudd_Cudd_Init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cudd_Cudd_Init" >&5 +echo "${ECHO_T}$ac_cv_lib_cudd_Cudd_Init" >&6; } +if test $ac_cv_lib_cudd_Cudd_Init = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCUDD 1 +_ACEOF + + LIBS="-lcudd $LIBS" + +fi + +fi + if test "$yap_cv_myddas" != "no" then { echo "$as_me:$LINENO: checking for main in -lmysqlclient" >&5 @@ -9846,6 +9949,149 @@ fi done +fi +if test "$yap_cv_cudd" != "no" +then + +for ac_header in cudd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + fi if test "$yap_cv_myddas" != "no" then @@ -13558,6 +13804,9 @@ EXEC_SUFFIX="" + + + @@ -16311,8 +16560,11 @@ mkdir -p GPL mkdir -p GPL/clpqr mkdir -p GPL/http mkdir -p packages/cplint +mkdir -p packages/ProbLog +mkdir -p packages/ProbLog/simplecudd -ac_config_files="$ac_config_files Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile" + +ac_config_files="$ac_config_files Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile packages/ProbLog/Makefile packages/ProbLog/simplecudd/Makefile packages/ProbLog/problog_dir.yap" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16895,6 +17147,9 @@ do "GPL/Makefile") CONFIG_FILES="$CONFIG_FILES GPL/Makefile" ;; "packages/cplint/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/Makefile" ;; "packages/PLStream/Makefile") CONFIG_FILES="$CONFIG_FILES packages/PLStream/Makefile" ;; + "packages/ProbLog/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/Makefile" ;; + "packages/ProbLog/simplecudd/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/simplecudd/Makefile" ;; + "packages/ProbLog/problog_dir.yap") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/problog_dir.yap" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -17106,6 +17361,9 @@ LAMOBJS!$LAMOBJS$ac_delim MAX_WORKERS!$MAX_WORKERS$ac_delim STATIC_MODE!$STATIC_MODE$ac_delim ENABLE_WINCONSOLE!$ENABLE_WINCONSOLE$ac_delim +USE_CUDD!$USE_CUDD$ac_delim +CUDD_LDFLAGS!$CUDD_LDFLAGS$ac_delim +CUDD_CPPFLAGS!$CUDD_CPPFLAGS$ac_delim INSTALL_MATLAB!$INSTALL_MATLAB$ac_delim MATLAB_INCLUDE!$MATLAB_INCLUDE$ac_delim M4GENABSMI!$M4GENABSMI$ac_delim @@ -17117,7 +17375,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index b852a98cf..767a02a6e 100644 --- a/configure.in +++ b/configure.in @@ -98,6 +98,19 @@ AC_ARG_WITH(gmp, fi, [yap_cv_gmp=yes]) +AC_ARG_WITH(cudd, + [ --with-cudd[=DIR] use CUDD package in DIR], + if test "$withval" = yes; then + yap_cv_cudd=yes + elif test "$withval" = no; then + yap_cv_cudd=no + else + yap_cv_cudd=$with_cudd + CUDD_LDFLAGS="$yap_cv_cudd/cudd/libcudd.a $yap_cv_cudd/mtr/libmtr.a $yap_cv_cudd/st/libst.a $yap_cv_cudd/util/libutil.a $yap_cv_cudd/epd/libepd.a " + CUDD_CPPFLAGS="-I $yap_cv_cudd/include" + fi, + [yap_cv_cudd=yes]) + AC_ARG_ENABLE(myddas, [ --enable-myddas[[=DIR]] enable the MYDDAS library], if test "$enableval" = yes; then @@ -320,6 +333,13 @@ else INSTALL_MATLAB="" fi +if test "$yap_cv_cudd" = no +then + USE_CUDD="# " +else + USE_CUDD="" +fi + dnl condor does not like dynamic linking on Linux, DEC, and HP-UX platforms. if test "$use_condor" = yes then @@ -489,6 +509,11 @@ then AC_CHECK_LIB(gmp,main) fi +if test "$yap_cv_cudd" != "no" +then + AC_CHECK_LIB(cudd,Cudd_Init) +fi + if test "$yap_cv_myddas" != "no" then dnl check for mysql @@ -1033,6 +1058,10 @@ if test "$yap_cv_gmp" != "no" then AC_CHECK_HEADERS(gmp.h) fi +if test "$yap_cv_cudd" != "no" +then + AC_CHECK_HEADERS(cudd.h) +fi if test "$yap_cv_myddas" != "no" then AC_CHECK_HEADERS(mysql/mysql.h) @@ -1141,6 +1170,9 @@ AC_SUBST(MAX_WORKERS) AC_SUBST(STATIC_MODE) AC_SUBST(ENABLE_WINCONSOLE) +AC_SUBST(USE_CUDD) +AC_SUBST(CUDD_LDFLAGS) +AC_SUBST(CUDD_CPPFLAGS) AC_SUBST(INSTALL_MATLAB) AC_SUBST(MATLAB_INCLUDE) @@ -1455,8 +1487,11 @@ mkdir -p GPL mkdir -p GPL/clpqr mkdir -p GPL/http mkdir -p packages/cplint +mkdir -p packages/ProbLog +mkdir -p packages/ProbLog/simplecudd -AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile) + +AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile packages/chr/Makefile packages/CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile packages/cplint/Makefile packages/PLStream/Makefile packages/ProbLog/Makefile packages/ProbLog/simplecudd/Makefile packages/ProbLog/problog_dir.yap) make depend (cd packages/PLStream; make depend; cd ../..)