Check whether Cryptominisat4/ABC was installed via get-* script. (#1565)
authorMathias Preiner <mathias.preiner@gmail.com>
Thu, 8 Feb 2018 15:27:16 +0000 (07:27 -0800)
committerAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 8 Feb 2018 15:27:16 +0000 (09:27 -0600)
config/abc.m4
config/cryptominisat.m4
contrib/get-abc
contrib/get-cryptominisat4

index faeb68cf202367af40e911b9b1a53b72da8fcf3c..6f095de7b9b87c8210ab0b1bea09e425d30551d1 100644 (file)
@@ -21,11 +21,20 @@ elif test -n "$with_abc"; then
       [path to top level of abc source tree]
     ),
     [ABC_HOME="$withval"],
-    [ if test -z "$ABC_HOME"; then
-        AC_MSG_FAILURE([must give --with-abc-dir=PATH or define environment variable ABC_HOME!])
+    [ if test -z "$ABC_HOME" && ! test -e "$ac_abs_confdir/abc/alanmi-abc-53f39c11b58d/arch_flags"; then
+        AC_MSG_FAILURE([must give --with-abc-dir=PATH, define environment variable ABC_HOME, or use contrib/get-abc to setup ABC for CVC4!])
       fi
     ]
   )
+  # Check if ABC was installed via contrib/get-abc
+  AC_MSG_CHECKING([whether ABC was already installed via contrib/get-abc])
+  if test -z "$ABC_HOME" && test -e "$ac_abs_confdir/abc/alanmi-abc-53f39c11b58d/arch_flags"; then
+    ABC_HOME="$ac_abs_confdir/abc/alanmi-abc-53f39c11b58d"
+    AC_MSG_RESULT([yes, $ABC_HOME])
+  else
+    AC_MSG_RESULT([no])
+  fi
+
   if ! test -d "$ABC_HOME" || ! test -x "$ABC_HOME/arch_flags"; then
     AC_MSG_FAILURE([either $ABC_HOME is not an abc source tree or it's not yet built])
   fi
index e35420edbd36885fa568ec39127765219c07237a..2cd48e87ddcab4b0aca384d86c7348cef0208019 100644 (file)
@@ -7,7 +7,7 @@ AC_MSG_CHECKING([whether user requested cryptominisat support])
 have_libcryptominisat=0
 CRYPTOMINISAT_LIBS=
 CRYPTOMINISAT_LDFLAGS=
-     
+
 have_libcryptominisat=0
 if test "$with_cryptominisat" = no; then
   AC_MSG_RESULT([no, cryptominisat disabled by user])
@@ -20,19 +20,28 @@ elif test -n "$with_cryptominisat"; then
       [--with-cryptominisat-dir=PATH],
       [path to top level of cryptominisat source tree]
     ),
-    [CRYPTOMINISAT_HOME="$withval"],
-    [ if test -z "$CRYPTOMINISAT_HOME"; then
-        AC_MSG_FAILURE([must give --with-cryptominisat-dir=PATH or define environment variable CRYPTOMINISAT_HOME!])
+    CRYPTOMINISAT_HOME="$withval",
+    [ if test -z "$CRYPTOMINISAT_HOME" && ! test -e "$ac_abs_confdir/cryptominisat4/install/bin/cryptominisat"; then
+        AC_MSG_FAILURE([must give --with-cryptominisat-dir=PATH, define environment variable CRYPTOMINISAT_HOME, or use contrib/get-cryptominisat4 to setup Cryptominisat4 for CVC4!])
       fi
     ]
   )
 
+  # Check if cryptominisat4 was installed via contrib/get-cryptominisat4
+  AC_MSG_CHECKING([whether Cryptominisat4 was already installed via contrib/get-cryptominisat4])
+  if test -z "$CRYPTOMINISAT_HOME" && test -e "$ac_abs_confdir/cryptominisat4/install/bin/cryptominisat"; then
+    CRYPTOMINISAT_HOME="$ac_abs_confdir/cryptominisat4"
+    AC_MSG_RESULT([yes, $CRYPTOMINISAT_HOME])
+  else
+    AC_MSG_RESULT([no])
+  fi
+
   if ! test -d "$CRYPTOMINISAT_HOME" || ! test -x "$CRYPTOMINISAT_HOME/install/bin/cryptominisat" ; then
     AC_MSG_FAILURE([either $CRYPTOMINISAT_HOME is not an cryptominisat install tree or it's not yet built])
   fi
 
   CPPFLAGS="$CPPFLAGS -I$CRYPTOMINISAT_HOME/install/include"
-  
+
   AC_MSG_CHECKING([how to link cryptominisat])
 
   dnl TODO FIXME:
index 0a840fc84b5a5362f79098635ec874127ba32a13..217cbfdf8d108a0644392dd2c4ed1f5fb9c12b03 100755 (executable)
@@ -26,10 +26,10 @@ sed 's,\( *\)\(.*Libs_Init(\),\1//\2,;s,\( *\)\(.*Libs_End(\),\1//\2,' src/base/
 
 # Build optimized, without readline, without pthreads.
 # These aren't necessary for our usage and we don't want the dependencies.
-make libabc.a OPTFLAGS=-O ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1
+make -j$(nproc) libabc.a OPTFLAGS=-O ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1
 mv libabc.a libabc-static.a
 make clean
-make libabc.a OPTFLAGS='-O -fPIC' ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1
+make -j$(nproc) libabc.a OPTFLAGS='-O -fPIC' ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1
 
 echo
 echo ===================== Now configure CVC4 with =====================
index c6f2a1ce8e4ecd88519dd61a75c69b301903f244..5c7cdd95839ced36df822c7fc5f4270e2ad22a90 100755 (executable)
@@ -25,7 +25,7 @@ mkdir ../build
 cd ../build
 
 cmake -DCMAKE_INSTALL_PREFIX:PATH=$CRYPTOMINISAT_PATH/install -DSTATICCOMPILE="ON" -DNOM4RI="ON"  ../cryptominisat-$version
-make install -j2
+make install -j$(nproc)
 
 cd ../