问题
I am trying to install ScalaZ3 by using the site https://github.com/epfl-lara/ScalaZ3 .
I cloned the code into my directory on Windows, opened a Linux terminal and ran sbt +package
.
At first it returned several errors since I am using Ubuntu Linux subsystem on Windows, so I had to comment out some lines in mk_util.py
to make it work.
I now encounter another problem where it is trying to run a "make" file but it can't find it. It has the correct directory path and the file exists in that directory.
In addition, I searched online and found that a possible solution for this is to change the path to the file to be the full path. So I tried looking for the source of the command that's searching for and running the "make" file, but I can't find it anywhere in the ScalaZ3 folder.
Here is the full output to sbt +package
:
[info] Loading settings for project scalaz3-master-build from build.sbt ...
[info] Loading project definition from /mnt/c/Users/casey/Desktop/notes/FYP/forked-monitor/stmonitor/ScalaZ3-master/ScalaZ3-master/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to ScalaZ3 (in build file:/mnt/c/Users/casey/Desktop/notes/FYP/forked-monitor/stmonitor/ScalaZ3-master/ScalaZ3-master/)
[info] Setting Scala version to 2.13.0 on 1 projects.
[info] Reapplying settings...
[info] Set current project to ScalaZ3 (in build file:/mnt/c/Users/casey/Desktop/notes/FYP/forked-monitor/stmonitor/ScalaZ3-master/ScalaZ3-master/)
[info] Checksum of Z3 source file: 1e5d60da3f4eb2e261af166eb978c80
[info] Compiling Z3...
[info] $ cd ./z3/z3-4.7.1 && python2.7 scripts/mk_make.py --java
[info] opt = --java, arg =
[info] New component: 'util'
[info] New component: 'lp'
[info] New component: 'polynomial'
[info] New component: 'sat'
[info] New component: 'nlsat'
[info] New component: 'hilbert'
[info] New component: 'simplex'
[info] New component: 'automata'
[info] New component: 'interval'
[info] New component: 'realclosure'
[info] New component: 'subpaving'
[info] New component: 'ast'
[info] New component: 'rewriter'
[info] New component: 'macros'
[info] New component: 'normal_forms'
[info] New component: 'model'
[info] New component: 'tactic'
[info] New component: 'substitution'
[info] New component: 'parser_util'
[info] New component: 'grobner'
[info] New component: 'euclid'
[info] New component: 'core_tactics'
[info] New component: 'sat_tactic'
[info] New component: 'arith_tactics'
[info] New component: 'nlsat_tactic'
[info] New component: 'subpaving_tactic'
[info] New component: 'aig_tactic'
[info] New component: 'proofs'
[info] New component: 'solver'
[info] New component: 'ackermannization'
[info] New component: 'interp'
[info] New component: 'cmd_context'
[info] New component: 'extra_cmds'
[info] New component: 'smt2parser'
[info] New component: 'fpa'
[info] New component: 'pattern'
[info] New component: 'bit_blaster'
[info] New component: 'smt_params'
[info] New component: 'proto_model'
[info] New component: 'smt'
[info] New component: 'bv_tactics'
[info] New component: 'fuzzing'
[info] New component: 'smt_tactic'
[info] New component: 'sls_tactic'
[info] New component: 'qe'
[info] New component: 'duality'
[info] New component: 'muz'
[info] New component: 'dataflow'
[info] New component: 'transforms'
[info] New component: 'rel'
[info] New component: 'pdr'
[info] New component: 'spacer'
[info] New component: 'clp'
[info] New component: 'tab'
[info] New component: 'bmc'
[info] New component: 'ddnf'
[info] New component: 'duality_intf'
[info] New component: 'fp'
[info] New component: 'nlsat_smt_tactic'
[info] New component: 'ufbv_tactic'
[info] New component: 'sat_solver'
[info] New component: 'smtlogic_tactics'
[info] New component: 'fpa_tactics'
[info] New component: 'portfolio'
[info] New component: 'opt'
[info] New component: 'api'
[info] New component: 'shell'
[info] New component: 'test'
[info] New component: 'api_dll'
[info] New component: 'dotnet'
[info] New component: 'java'
[info] New component: 'ml'
[info] New component: 'cpp'
[info] Python bindings directory was detected.
[info] New component: 'python'
[info] New component: 'python_install'
[info] New component: 'cpp_example'
[info] New component: 'z3_tptp'
[info] New component: 'c_example'
[info] New component: 'maxsat'
[info] New component: 'dotnet_example'
[info] New component: 'java_example'
[info] New component: 'ml_example'
[info] New component: 'py_example'
[info] Generating src/util/version.h from src/util/version.h.in
[info] Generated 'src/util/version.h'
[info] Generating src/api/dotnet/Properties/AssemblyInfo.cs from src/api/dotnet/Properties/AssemblyInfo.cs.in
[info] Generated 'src/ackermannization/ackermannization_params.hpp'
[info] Generated 'src/ackermannization/ackermannize_bv_tactic_params.hpp'
[info] Generated 'src/ast/pp_params.hpp'
[info] Generated 'src/ast/fpa/fpa2bv_rewriter_params.hpp'
[info] Generated 'src/ast/normal_forms/nnf_params.hpp'
[info] Generated 'src/ast/pattern/pattern_inference_params_helper.hpp'
[info] Generated 'src/ast/rewriter/arith_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/array_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/bool_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/bv_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/fpa_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/poly_rewriter_params.hpp'
[info] Generated 'src/ast/rewriter/rewriter_params.hpp'
[info] Generated 'src/interp/interp_params.hpp'
[info] Generated 'src/math/polynomial/algebraic_params.hpp'
[info] Generated 'src/math/realclosure/rcf_params.hpp'
[info] Generated 'src/model/model_evaluator_params.hpp'
[info] Generated 'src/model/model_params.hpp'
[info] Generated 'src/muz/base/fixedpoint_params.hpp'
[info] Generated 'src/nlsat/nlsat_params.hpp'
[info] Generated 'src/opt/opt_params.hpp'
[info] Generated 'src/parsers/util/parser_params.hpp'
[info] Generated 'src/sat/sat_asymm_branch_params.hpp'
[info] Generated 'src/sat/sat_params.hpp'
[info] Generated 'src/sat/sat_scc_params.hpp'
[info] Generated 'src/sat/sat_simplifier_params.hpp'
[info] Generated 'src/smt/params/smt_params_helper.hpp'
[info] Generated 'src/solver/combined_solver_params.hpp'
[info] Generated 'src/tactic/sls/sls_params.hpp'
[info] Generated 'src/tactic/smtlogics/qfufbv_tactic_params.hpp'
[info] Generated 'src/util/lp/lp_params.hpp'
[info] Generated 'src/ast/pattern/database.h'
[info] Generated 'src/shell/install_tactic.cpp'
[info] Generated 'src/test/install_tactic.cpp'
[info] Generated 'src/api/dll/install_tactic.cpp'
[info] Generated 'src/shell/mem_initializer.cpp'
[info] Generated 'src/test/mem_initializer.cpp'
[info] Generated 'src/api/dll/mem_initializer.cpp'
[info] Generated 'src/shell/gparams_register_modules.cpp'
[info] Generated 'src/test/gparams_register_modules.cpp'
[info] Generated 'src/api/dll/gparams_register_modules.cpp'
[info] Generated 'src/api/python/z3/z3consts.py
[info] Finding javac ...
[info] bin/javac.exe
[info] CMB: /usr/local/sbin/bin/javac.exe
[info] CMB: /usr/local/bin/bin/javac.exe
[info] CMB: /usr/sbin/bin/javac.exe
[info] CMB: /usr/bin/bin/javac.exe
[info] CMB: /sbin/bin/javac.exe
[info] CMB: /bin/bin/javac.exe
[info] CMB: /usr/games/bin/javac.exe
[info] CMB: /usr/local/games/bin/javac.exe
[info] CMB: /mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath/bin/javac.exe
[info] CMB: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common/bin/javac.exe
[info] CMB: /mnt/c/Windows/system32/bin/javac.exe
[info] CMB: /mnt/c/Windows/bin/javac.exe
[info] CMB: /mnt/c/Windows/System32/Wbem/bin/javac.exe
[info] CMB: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/bin/javac.exe
[info] CMB: /mnt/c/Windows/System32/OpenSSH/bin/javac.exe
[info] CMB: /mnt/c/Program Files (x86)/OpenVPN/bin/bin/javac.exe
[info] CMB: /mnt/c/Program Files (x86)/sbt/bin/bin/javac.exe
[info] CMB: /mnt/c/Program Files/Git/cmd/bin/javac.exe
[info] CMB: /mnt/c/Program Files/R/bin/javac.exe
[info] CMB: /mnt/c/Program Files/OracleJavaJDK/bin/javac.exe
[info] Finding jar ...
[info] Testing /mnt/c/Program Files/OracleJavaJDK/bin/javac.exe...
[info] Finding jni.h...
[info] None
[info] plus heuristics
[info] False
[info] /mnt/c/Users/casey/Desktop/notes/FYP/forked-monitor/stmonitor/ScalaZ3-master/ScalaZ3-master/z3
[info] False
[info] include/jni.h
[info] CMB: /usr/local/sbin/include/jni.h
[info] CMB: /usr/local/bin/include/jni.h
[info] CMB: /usr/sbin/include/jni.h
[info] CMB: /usr/bin/include/jni.h
[info] CMB: /sbin/include/jni.h
[info] CMB: /bin/include/jni.h
[info] CMB: /usr/games/include/jni.h
[info] CMB: /usr/local/games/include/jni.h
[info] CMB: /mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath/include/jni.h
[info] CMB: /mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common/include/jni.h
[info] CMB: /mnt/c/Windows/system32/include/jni.h
[info] CMB: /mnt/c/Windows/include/jni.h
[info] CMB: /mnt/c/Windows/System32/Wbem/include/jni.h
[info] CMB: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/include/jni.h
[info] CMB: /mnt/c/Windows/System32/OpenSSH/include/jni.h
[info] CMB: /mnt/c/Program Files (x86)/OpenVPN/bin/include/jni.h
[info] CMB: /mnt/c/Program Files (x86)/sbt/bin/include/jni.h
[info] CMB: /mnt/c/Program Files/Git/cmd/include/jni.h
[info] CMB: /mnt/c/Program Files/R/include/jni.h
[info] CMB: /mnt/c/Program Files/OracleJavaJDK/include/jni.h
[info] Generated 'src/api/java/enumerations/Z3_lbool.java'
[info] Generated 'src/api/java/enumerations/Z3_symbol_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_parameter_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_sort_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_ast_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_decl_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_param_kind.java'
[info] Generated 'src/api/java/enumerations/Z3_ast_print_mode.java'
[info] Generated 'src/api/java/enumerations/Z3_error_code.java'
[info] Generated 'src/api/java/enumerations/Z3_goal_prec.java'
[info] Generated 'src/api/api_log_macros.h'
[info] Generated 'src/api/api_log_macros.cpp'
[info] Generated 'src/api/api_commands.cpp'
[info] Generated 'src/api/python/z3/z3core.py'
[info] Generated 'src/api/java/Native.java'
[info] Listing src/api/python/z3 ...
[info] Compiling src/api/python/z3/__init__.py ...
[info] Compiling src/api/python/z3/z3.py ...
[info] Compiling src/api/python/z3/z3consts.py ...
[info] Compiling src/api/python/z3/z3core.py ...
[info] Compiling src/api/python/z3/z3num.py ...
[info] Compiling src/api/python/z3/z3poly.py ...
[info] Compiling src/api/python/z3/z3printer.py ...
[info] Compiling src/api/python/z3/z3rcf.py ...
[info] Compiling src/api/python/z3/z3types.py ...
[info] Compiling src/api/python/z3/z3util.py ...
[info] Generated python bytecode
[info] Copied 'z3.py'
[info] Copied 'z3consts.py'
[info] Copied 'z3core.py'
[info] Copied 'z3num.py'
[info] Copied 'z3poly.py'
[info] Copied 'z3printer.py'
[info] Copied 'z3rcf.py'
[info] Copied 'z3types.py'
[info] Copied 'z3util.py'
[info] Copied '__init__.py'
[info] Copied 'z3.pyc'
[info] Copied 'z3consts.pyc'
[info] Copied 'z3core.pyc'
[info] Copied 'z3num.pyc'
[info] Copied 'z3poly.pyc'
[info] Copied 'z3printer.pyc'
[info] Copied 'z3rcf.pyc'
[info] Copied 'z3types.pyc'
[info] Copied 'z3util.pyc'
[info] Copied '__init__.pyc'
[info] Host platform: Linux
[info] C++ Compiler: None
[info] C Compiler : None
[info] Archive Tool: ar
[info] Arithmetic: internal
[info] Prefix: /usr
[info] 64-bit: True
[info] Python pkg dir: /usr/lib/python2.7/dist-packages
[info] Python version: 2.7
[info] JNI Bindings: /mnt/c/Program Files/OracleJavaJDK/include/jni.h
[info] Java Compiler: /mnt/c/Program Files/OracleJavaJDK/bin/javac.exe
[info] Writing build/make
[info] Copied Z3Py example 'all_interval_series.py' to 'build/python'
[info] Copied Z3Py example 'example.py' to 'build/python'
[info] Copied Z3Py example 'parallel.py' to 'build/python'
[info] Copied Z3Py example 'socrates.py' to 'build/python'
[info] Copied Z3Py example 'visitor.py' to 'build/python'
[info] make was successfully generated.
[info] compilation mode: Release
[info] Type 'cd build; make' to build Z3
[info] HERE build
[info] $ cd ./z3/z3-4.7.1/build && make -j4
[error] java.io.IOException: Cannot run program "make" (in directory "./z3/z3-4.7.1/build"): error=2, No such file or directory
[error] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
[error] at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
[error] at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
[error] at sbt.internal.util.BufferedLogger.buffer(BufferedLogger.scala:101)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
[error] at ScalaZ3Build$.exec(Build.scala:69)
[error] at ScalaZ3Build$.$anonfun$z3Task$1(Build.scala:151)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] Caused by: java.io.IOException: error=2, No such file or directory
[error] at java.lang.UNIXProcess.forkAndExec(Native Method)
[error] at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
[error] at java.lang.ProcessImpl.start(ProcessImpl.java:134)
[error] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[error] at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
[error] at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
[error] at sbt.internal.util.BufferedLogger.buffer(BufferedLogger.scala:101)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
[error] at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
[error] at ScalaZ3Build$.exec(Build.scala:69)
[error] at ScalaZ3Build$.$anonfun$z3Task$1(Build.scala:151)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (checksum) java.io.IOException: Cannot run program "make" (in directory "./z3/z3-4.7.1/build"): error=2, No such file or directory
[error] Total time: 23 s, completed Dec 16, 2020 5:58:03 PM
I would also like to add that there were some issues with the names "make" and "Makefile", so I made some changes to the mk_util.py code to change the file name to make and both files exist in the mentioned ./z3/z3-4.7.1/build
directory.
Help on this would be much appreciated.
Update
Upon running sudo apt-get install build-essential
as suggested in the comments and running sbt +package
again I get this new error:
...
[info] $ cd ./z3/z3-4.7.1/build && make -j4
[info] src/api/api_commands.cpp
[error] make: None: Command not found
[error] make: *** [Makefile:3879: api/api_commands.o] Error 127
[error] java.lang.RuntimeException: Compilation of Z3 failed... aborting
[error] at scala.sys.package$.error(package.scala:26)
[error] at ScalaZ3Build$.$anonfun$z3Task$1(Build.scala:170)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (checksum) Compilation of Z3 failed... aborting
[error] Total time: 26 s, completed Dec 23, 2020 11:29:52 PM
I tried looking up the error online but there was nothing about the make: None: Command not found
error.
I also tried installing some additional z3 libraries from https://lara.epfl.ch/w/ScalaZ3 that I might have missed before by running sudo apt-get install
on libz3-4
, libz3-dev
and z3
but they didn't change anything.
Update #2
Some continuation of this issue can be found here
来源:https://stackoverflow.com/questions/65396956/scalaz3-installation-issue