From db6074f839266292213a6c20f38af676d07f137a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 21 Apr 2015 16:12:39 -0600 Subject: [PATCH] cmake work --- cmake/Config.cmake | 6 ++--- cmake/FindSqlite3.cmake | 21 ++++++++++++++---- config.h.cmake | 30 ------------------------- config.h.in | 18 --------------- configure.in | 3 +++ library/lists.yap | 1 - library/system.yap | 49 +++++++++++++++++++---------------------- 7 files changed, 46 insertions(+), 82 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 6bb890681..1197fee38 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -201,7 +201,7 @@ check_function_exists( access HAVE_ACCESS ) check_function_exists( acosh HAVE_ACOSH ) check_function_exists( asinh HAVE_ASINH ) check_function_exists( atanh HAVE_ATANH ) -check_function_exists( basename HAVE_BASENAME ) +check_function_exists( basename HAVE_BASENAME ) check_function_exists( chdir HAVE_CHDIR ) check_function_exists( clock HAVE_CLOCK ) check_function_exists( clock_gettime HAVE_CLOCK_GETTIME ) @@ -256,7 +256,7 @@ check_function_exists( drand48 HAVE_DRAND48 ) check_function_exists( rand HAVE_RAND ) check_function_exists( random HAVE_RANDOM ) check_function_exists( readlink HAVE_READLINK ) -check_function_exists( realpath HAVE_REALPATH ) +check_function_exists( realpath HAVE_REALPATH ) check_function_exists( regexec HAVE_REGEXEC ) check_function_exists( rename HAVE_RENAME ) check_function_exists( restartable_syscalls HAVE_RESTARTABLE_SYSCALLS ) @@ -317,7 +317,7 @@ check_function_exists( vsnprintf HAVE_VSNPRINTF ) check_function_exists( waitpid HAVE_WAITPID ) check_function_exists( wcsdup HAVE_WCSDUP ) check_function_exists( wcsnlen HAVE_WCSNLEN ) -check_function_exists( wordexp HAVE_WORDEXP ) +check_function_exists( wordexp HAVE_WORDEXP ) check_function_exists( _bool HAVE__BOOL ) check_function_exists( _chsize_s HAVE__CHSIZE_S ) check_function_exists( _NSGetEnviron HAVE__NSGETENVIRON ) diff --git a/cmake/FindSqlite3.cmake b/cmake/FindSqlite3.cmake index 8e2319968..24654cfe4 100644 --- a/cmake/FindSqlite3.cmake +++ b/cmake/FindSqlite3.cmake @@ -33,27 +33,40 @@ else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) NAMES sqlite3.h PATHS + #! brew is better than default + /usr/local/opt/sqlite/include ${_SQLITE3_INCLUDEDIR} - /usr/local/opt/sqlite/include /usr/include /usr/local/include /opt/local/include /sw/include + NO_DEFAULT_PATH + ) + + find_path(SQLITE3_INCLUDE_DIR + NAMES + sqlite3.h ) find_library(SQLITE3_LIBRARY NAMES sqlite3 PATHS + /usr/local/opt/sqlite/lib ${_SQLITE3_LIBDIR} - /usr/local/opt/sqlite /usr/lib /usr/local/lib /opt/local/lib /sw/lib - ) + NO_DEFAULT_PATH + ) - if (SQLITE3_LIBRARY) + find_library(SQLITE3_LIBRARY + NAMES + sqlite3 + ) + + if (SQLITE3_LIBRARY) set(SQLITE3_FOUND TRUE) endif (SQLITE3_LIBRARY) diff --git a/config.h.cmake b/config.h.cmake index feaae829b..73d7fb77f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -255,31 +255,6 @@ function. */ #cmakedefine HAVE_CTYPE_H ${HAVE_CTYPE_H} #endif -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDDINT_H -#cmakedefine HAVE_CUDDINT_H ${HAVE_CUDDINT_H} -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDDINT_H -#cmakedefine HAVE_CUDD_CUDDINT_H ${HAVE_CUDD_CUDDINT_H} -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_CUDD_H -#cmakedefine HAVE_CUDD_CUDD_H ${HAVE_CUDD_CUDD_H} -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_H -#cmakedefine HAVE_CUDD_H ${HAVE_CUDD_H} -#endif - -/* Define to 1 if you have the header file. */ -#ifndef HAVE_CUDD_UTIL_H -#cmakedefine HAVE_CUDD_UTIL_H ${HAVE_CUDD_UTIL_H} -#endif - /* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if you don't. */ #ifndef HAVE_DECL_RL_CATCH_SIGNALS_ @@ -1568,11 +1543,6 @@ signal. */ #cmakedefine HAVE_USLEEP ${HAVE_USLEEP} #endif -/* Define to 1 if you have the header file. */ -#ifndef HAVE_UTIL_H -#cmakedefine HAVE_UTIL_H ${HAVE_UTIL_H} -#endif - /* Define to 1 if you have the `utime' function. */ #ifndef HAVE_UTIME #cmakedefine HAVE_UTIME ${HAVE_UTIME} diff --git a/config.h.in b/config.h.in index 82f9110a6..19eaf3c89 100644 --- a/config.h.in +++ b/config.h.in @@ -159,21 +159,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H -/* Define to 1 if you have the header file. */ -#undef HAVE_CUDDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUDD_CUDDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUDD_CUDD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUDD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CUDD_UTIL_H - /* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if you don't. */ #undef HAVE_DECL_RL_CATCH_SIGNALS_ @@ -896,9 +881,6 @@ /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIL_H - /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME diff --git a/configure.in b/configure.in index fa4328ac2..736031c41 100755 --- a/configure.in +++ b/configure.in @@ -2172,6 +2172,7 @@ mkdir -p packages/prism/src/c/up mkdir -p packages/prism/src/prolog mkdir -p packages/ProbLog mkdir -p packages/ProbLog/simplecudd +mkdir -p packages/ProbLog/simplecudd_lfi mkdir -p packages/R mkdir -p packages/RDF mkdir -p packages/real @@ -2201,6 +2202,8 @@ AC_CONFIG_FILES([packages/Dialect.defs]) AC_CONFIG_FILES([packages/meld/Makefile]) AC_CONFIG_FILES([packages/xml/Makefile]) AC_CONFIG_FILES([packages/ProbLog/Makefile ]) +AC_CONFIG_FILES([packages/ProbLog/simplecudd/Makefile ]) +AC_CONFIG_FILES([packages/ProbLog/simplecudd_lfi/Makefile ]) AC_CONFIG_FILES([swi/library/Makefile]) AC_CONFIG_FILES([swi/library/clp/Makefile]) diff --git a/library/lists.yap b/library/lists.yap index 9e806f65a..9fa89e372 100644 --- a/library/lists.yap +++ b/library/lists.yap @@ -296,7 +296,6 @@ instead. sum_list/3, sumlist/2 ]). - :- use_module(library(error), [must_be/2]). diff --git a/library/system.yap b/library/system.yap index 3e105ceb5..c5c89373b 100644 --- a/library/system.yap +++ b/library/system.yap @@ -51,7 +51,7 @@ X = datime(2001,5,28,15,29,46) ? -Given an environment variable _E_ this predicate unifies the second argument _S_ with its value. + Given an environment variable _E_ this predicate unifies the second argument _S_ with its value. */ @@ -384,9 +384,10 @@ also `absolute_file_name/2` and chdir/1. file_exists/2, file_property/2, host_id/1, - host_name/1, + host_name/1, + kill/1, pid/1, - mktemp/2, + mktemp/2, make_directory/1, popen/3, rename_file/2, @@ -400,17 +401,13 @@ also `absolute_file_name/2` and chdir/1. mktime/2, tmpnam/1, tmp_file/2, - tmpdir/1, + tmpdir/1, + wait/2, working_directory/2 ]). :- use_module(library(lists), [append/3]). -:- if(current_prolog_flag(windows, false)). -:- reexport(library(unix), [wait/2, - kill/2]). -:- endif. - :- load_foreign_files([sys], [], init_sys). :- dynamic tmp_file_sequence_counter/1. @@ -749,13 +746,13 @@ system(Command, Status) :- Status = 0, handle_system_error(Error, off, G). -%% wait(PID,STATUS) :- var(PID), !, -%% throw(error(instantiation_error,wait(PID,STATUS))). -%% wait(PID,STATUS) :- integer(PID), !, -%% wait(PID, STATUS, Error), -%% handle_system_error(Error, off, wait(PID,STATUS)). -%% wait(PID,STATUS) :- -%% throw(error(type_error(integer,PID),wait(PID,STATUS))). +wait(PID,STATUS) :- var(PID), !, + throw(error(instantiation_error,wait(PID,STATUS))). +wait(PID,STATUS) :- integer(PID), !, + wait(PID, STATUS, Error), + handle_system_error(Error, off, wait(PID,STATUS)). +wait(PID,STATUS) :- + throw(error(type_error(integer,PID),wait(PID,STATUS))). % % host info @@ -774,16 +771,16 @@ pid(X) :- pid(X, Error), handle_system_error(Error, off, pid(X)). -%% kill(X,Y) :- -%% integer(X), integer(Y), !, -%% kill(X, Y, Error), -%% handle_system_error(Error, off, kill(X,Y)). -%% kill(X,Y) :- (var(X) ; var(Y)), !, -%% throw(error(instantiation_error,kill(X,Y))). -%% kill(X,Y) :- integer(X), !, -%% throw(error(type_error(integer,Y),kill(X,Y))). -%% kill(X,Y) :- -%% throw(error(type_error(integer,X),kill(X,Y))). +kill(X,Y) :- + integer(X), integer(Y), !, + kill(X, Y, Error), + handle_system_error(Error, off, kill(X,Y)). +kill(X,Y) :- (var(X) ; var(Y)), !, + throw(error(instantiation_error,kill(X,Y))). +kill(X,Y) :- integer(X), !, + throw(error(type_error(integer,Y),kill(X,Y))). +kill(X,Y) :- + throw(error(type_error(integer,X),kill(X,Y))). mktemp(X,Y) :- var(X), !, throw(error(instantiation_error,mktemp(X,Y))).