Coder Social home page Coder Social logo

glslang / gdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blockstream/gdk

0.0 2.0 0.0 3.16 MB

Blockstream Green Development Kit

License: Other

C 91.23% Meson 0.33% C++ 7.40% Swift 0.24% Python 0.03% Dockerfile 0.01% Shell 0.46% Objective-C 0.03% SWIG 0.26%

gdk's Introduction

GreenAddress C/C++ SDK

GDK is a cross-platform, cross-language library for Blockstream Green wallets.

Read the API documentation at https://gdk.readthedocs.io/en/latest/

Build Status

Meson/Ninja build:

Build dependencies:

For Debian Stretch:

sudo apt update && sudo apt install build-essential python3-pip ninja-build clang wget autoconf pkg-config libtool swig (optional)
sudo pip3 install -r tools/requirements.txt or pip3 install --user -r tools/requirements.txt

For Mac OSX:

Install Xcode and brew if not installed, then

brew update && brew install ninja automake autoconf libtool gnu-sed python3 wget pkg-config swig (optional) gnu-getopt gnu-tar
pip3 install --user meson
xcode-select --install

You may also need to change your PATH environment variable to add $HOME/Library/Python/3.6/bin

If you want to target Android you will need to download the NDK and set the ANDROID_NDK env variable to the directory you uncompress it to, for example

export ANDROID_NDK=$HOME/Downloads/ndk

or you can add it to your bash profile ~/.bash_profile

JAVA bindings can be built by installing swig as explained above and setting JAVA_HOME to the location of the JDK.

To build:

tools/build.sh <options>

Options exist to build for a particular configuration/platform (flags in squared brackets are optional):

--clang
--gcc
--ndk [armeabi-v7a arm64-v8a x86 x86_64]
--iphone [static]

for example

tools/build.sh --gcc

Build output is placed in build-<target>, e.g. build-clang, build-gcc sub-directories.

You can quickly run a single targets build from the build-<target> sub-directory using:

ninja

To clean:

tools/clean.sh

Docker based deps & build

This doesn't require any of the previous steps but requires docker installed; it will build the project

docker build -t greenaddress_sdk - < tools/Dockerfile
docker run -v $PWD:/sdk greenaddress_sdk

or if you don't want to build it locally

docker pull greenaddress/ci@sha256:d9f628bdfad8159aafd38139f6de91fa1040f3378ccb813893888dde5d80d13f
docker run -v $PWD:/sdk greenaddress/ci

in both cases (built or fetched) this will build the sdk with clang by default

if you want to change it for example to ndk armeabi-v7a:

docker run -v $PWD:/sdk greenaddress/ci bash -c "cd /sdk && ./tools/build.sh --ndk armeabi-v7a"

Extra build options

Disable LTO

By default builds use link time optimisation. It can be disabled when invoking build.sh. For example

tools/build.sh --lto=false --clang

Debug builds

By default the build type is release. A debug build can specified as

tools/build.sh --buildtype=debug --clang

or

tools/build.sh --buildtype=debugoptimized --clang

for a debug optimized build.

Clang Analyzer

To build using clang-analyzer use

tools/build.sh --analyze --clang

Clang tidy

The clang-tidy targets are enabled if found in the PATH. Extra options exist to specify version of it,

tools/build.sh --clang-tidy-version=7 --clang

then use as follows

ninja src/clang-tidy

Sanitizers

A sanitizer build can be invoked using

tools/build.sh --sanitizer=<type> --gcc

where <type> is any available sanitizer of your choice and available on the toolchain being used.

Compiler versions

A different compiler version can be specified as

tools/build.sh --compiler-version=<version>

which allows for multiple side by side installs of compilers in common linux distributions.

Build examples

Use clang-5.0, no LTO, enable clang-tidy and debug build

./tools/build.sh --compiler-version=5.0 --buildtype=debug --lto=false --clang-tidy-version=5.0 --clang

Use address sanitizer with gcc-7, no LTO, enable clang-tidy and debug build

./tools/build.sh --compiler-version=7 --buildtype=debug --lto=false --sanitizer=address --clang-tidy-version=5.0 --gcc

Use clang-analyzer (it'll analyze GDK and its direct dependencies)

./tools/build.sh --analyze --clang

Upgrading dependencies

Use tools/upgrade_deps.sh, for example to upgrade wally

./tools/upgrade_deps.sh -l libwally-core -s 987575025520d18bac31e6e2d27c8c936d812c64 -u https://github.com/ElementsProject/libwally-core/archive/987575025520d18bac31e6e2d27c8c936d812c64.tar.gz

Java and Python wrappers

Java and Python wrappers are available if SWIG is installed.

If JAVA_HOME is set while the library is built, a Java wrapper is built exposing the API.

Similarly, if --python-version is passed to tools/build.sh a Python wrapper is built, for example:

./tools/build.sh --install $PWD --gcc --python-version 3.7

Swift wrapper

A swift wrapper is available at GreenAddress.swift.

gdk's People

Contributors

afilini avatar domegabri avatar glslang avatar greenaddress avatar jamiedriver avatar jb55 avatar jgriffiths avatar jkauffman1 avatar leocomandini avatar lvaccaro avatar promag avatar rcasatta avatar

Watchers

 avatar  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.