VUISIS / formula

FORMULA 2.0: Formal Specifications for Verification and Synthesis
Other
10 stars 3 forks source link

Unable to load Z3 by default on Mac #4

Open balasub opened 2 years ago

balasub commented 2 years ago

Running the symbolic execution engine on Mac throws the following exception:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libz3' or one of its dependencies.

This exception is thrown even though the libz3.dylib and Microsoft.Z3.dll are downloaded through NuGet.

A temporary workaround is to manually export the DYLD_LIBRARY_PATH environment variable with the location of libz3.dylib.

siraben commented 2 years ago

In the Nix expression, the following command ensures that the output binary has DYLD_LIBRARY_PATH set.

makeWrapper ${dotnetCorePackages.runtime_5_0}/bin/dotnet $out/bin/formula \
  --add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
  --prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native