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

Added CMake support for SVF #8

Merged
merged 6 commits into from Aug 4, 2016
Merged

Conversation

rboggild
Copy link
Contributor

As requested, here is a PR for including CMake support for SVF for LLVM 3.8.

@yuleisui
Copy link
Collaborator

Hi Rasmus,

It seems that your patch does not support out-of-tree project cmake. Could you please help us make one based on your patch? It would be good that you could make some notes about the steps and command line options for the cmake.

Thanks

@rboggild
Copy link
Contributor Author

rboggild commented Aug 2, 2016

Hi Yulei,

sorry about that - our LLVM build is somewhat modified so we just have SVF in the projects folder - I'll look into it and see how to support out-of-source builds as well.

Best regards,

Rasmus

@rboggild
Copy link
Contributor Author

rboggild commented Aug 2, 2016

Hi Yulei,

I have added support for building SVF out of source (it is still possible to build in source by placing the SVF dir inside the projects/ dir).

All you have to do to build SVF with CMake now is:

  1. Build LLVM 3.8 with Cmake (e.g. cmake /path/to/llvm/source && make)
  2. Set the LLVM_DIR environment variable to point at the build directory for LLVM (e.g. export LLVM_DIR=/path/to/llvm/build )
  3. Build SVF with Cmake (e.g. cmake /path/to/svf && make)

This will produce both the wpa and saber binaries (placed in the /bin folder) and the shared libraries so that other projects can include the SVF pass.

I added an explicit check and warning if the LLVM_DIR is not set as the default message might not make a sense, if a user forgets to add the environmental variable.

Best,

Rasmus

@yuleisui
Copy link
Collaborator

yuleisui commented Aug 3, 2016

Hi Rasmus,

Awesome! thanks a lot for the out-of-tree patch:)

Before I merge your pull request, could you please make the following small changes to your patch.

(1) Please separate the cmake config files and CUDD file deletions into two patches.
(2) There are lots of pointer casting warnings issued from CUDD package during compilation. Could you please add "-Wno-pointer-to-int-cast" and "-Wno-pointer-to-int-cast" flags in the CUDD/CMakeLists.txt to disable those warnings?

Best,
Yulei

@rboggild
Copy link
Contributor Author

rboggild commented Aug 3, 2016

Hi Yulei,

I added the flags to suppress the warnings of CUDD and I think I was able to update the git history to contain the commits we need:

  1. The "cudd_tests" branch (other pull request) now contains only the move commands for the cudd files from the lib folder to the tests folder. This is required for the cmake files, because the LLVM cmake system requires all files to be included in the cmake files and we can only have one .c file with a main method.

  2. The master branch contains the merged commits (including the "cudd_test" and the "cmake" branches). If you apply the other patch first, I think we should get the desired result.

Hope it works :-)

/Rasmus

@yuleisui
Copy link
Collaborator

yuleisui commented Aug 4, 2016

Hi Rasmus,

Perfect!

Thanks for your contribution.

Best,
Yulei

@yuleisui yuleisui merged commit 6d37864 into SVF-tools:master Aug 4, 2016
@dtzWill
Copy link
Contributor

dtzWill commented Aug 17, 2016

Thank you both! 👍

@nix7965 nix7965 mentioned this pull request Mar 20, 2019
yuleisui pushed a commit that referenced this pull request Apr 9, 2021
yuleisui added a commit that referenced this pull request Nov 14, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants