Coder Social home page Coder Social logo

svf-python's Introduction

0. Install npm, zlib, unzip, cmake, gcc, nodejs (if you machine does not have these libs)

sudo apt-get install zlib1g-dev unzip cmake gcc g++ nodejs libtinfo5 python3

1. Install SVF and its dependence (LLVM pre-built binary) via npm

npm i --silent svf-lib --prefix ${HOME}

2. Clone repository

git clone https://github.com/SVF-tools/SVF-Python

3. Install repository

cd noce_modules/svf-lib
./llvm_install.sh   
For mac arm64 system replace two files
node_modules/SVF/Release-build/svf/libSvfCore.a
node_modules/SVF/Release-build/svf-llvm/libSvfLLVM.a
to the given file in MacLib respectively
For mac arm64 system need to use 

brew install llvm@14 

install the correct llvm for the arm64 then open the terminal and input

cd /opt/homebrew/Cellar

then copy the file llvm@14 and paste it into node_modules
and replace the original llvm-14.0.0.obj

4. Setup SVF environment and create python lib

source ./env.sh
cmake . && make

5. Analyze a bc file using svf-ex.py

clang -S -c -g -fno-discard-value-names -emit-llvm example.c -o example.ll
python3 ./src/svfpy/svf-ex.py example.ll
the path of node_modules is in the /User/@username/node_modules

svf-python's People

Contributors

yby-44 avatar yuleisui avatar rogan-heng avatar doctormeee avatar svf-tools avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.