You will need Git, Rustup, Python 3(v3.8+), the Node.js active LTS (v16.17.0), yarn, and npm (v8+).
If you are using Ubuntu/Debian, please additionally install:
> apt install build-essential python3-dev python3-pip openssl git libgit2-dev
If you are using Fedora/Centos, please additionally install:
> dnf install base-devel python3-devel python3-pip openssl-devel git libgit2-devel
x86_64-pc-windows-msvc target is required. Compiling with windows-gnu target will not be successful.
Follow Visual Studio guide to install msvc
For macOS,you can't use the python3 that comes with the system because it's static linked and no dylib. You can install python3 with dylib from conda/miniconda3/brew.
copy .cargo/config.toml and edit it to where your python installed
> cp .cargo/config.toml.example .cargo/config.toml
> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
> source "$HOME/.cargo/env"
edit .cargo/config.toml
[target.x86_64-apple-darwin]
rustflags = ["-L", "/opt/homebrew/lib/", "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
[env]
PYO3_PYTHON="/opt/homebrew/bin/python3"
Modify .cargo/config.toml as follows:
(note that you need to replace CONDA_PREFIX
with
the output of echo $CONDA_PREFIX
from your terminal.)
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", "-C", "link-arg=-Wl,-rpath,`CONDA_PREFIX`/lib"]
> ./scripts/build.sh
> ./target/release/idp
> docker build -t note -f Dockerfile --target release .