Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM unable to find Z3 #697

Open
tfeng opened this issue Jan 28, 2020 · 0 comments
Open

LLVM unable to find Z3 #697

tfeng opened this issue Jan 28, 2020 · 0 comments

Comments

@tfeng
Copy link
Contributor

tfeng commented Jan 28, 2020

While building with build_docker.sh, I observed the following error:

...
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Z3: Found unsuitable version "/usr/src/souper/third_party/llvm/Release-build/CMakeFiles/CMakeTmp/cmTC_ddcb5: error while loading shared libraries: libz3.so: cannot open shared object file: No such file or directory
", but required is at least "4.7.1" (found /usr/src/souper/third_party/z3-install/lib/libz3.a)
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
...

On checking build_deps.sh and contents in the container, I found Z3 was built and installed into /usr/src/souper/third_party/z3-install. Its include and lib directories were properly set in LLVM's cmake command. However, libz3.so was not found because it was not in LD_LIBRARY_PATH.

Adding the following line in build_deps.sh leads to a successful message.

export LD_LIBRARY_PATH=$z3_installdir/lib:$LD_LIBRARY_PATH

The message is now this.

...
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Z3: /usr/src/souper/third_party/z3-install/lib/libz3.a (found suitable version "4.8.6", minimum required is "4.7.1") 
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant