6 Star 45 Fork 11

Baihai IDP / IDP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
compile-deploy-from-source.md 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
Regan Yue 提交于 2023-02-23 17:04 . Create compile-deploy-from-source_zh.md

Compile and Deploy IDP From Source

System Requirements

You will need Git, Rustup, Python 3(v3.8+), the Node.js active LTS (v16.17.0), yarn, and npm (v8+).

Linux additional build dependencies

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

Windows additional build dependencies

x86_64-pc-windows-msvc target is required. Compiling with windows-gnu target will not be successful.

Follow Visual Studio guide to install msvc

macOS

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

Install Rust

> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
> source "$HOME/.cargo/env"

Homebrew's Python

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"

macOS conda's python

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"]

Compile and Run

> ./scripts/build.sh
> ./target/release/idp

Build Docker Image

> docker build -t note -f Dockerfile --target release .
Rust
1
https://gitee.com/baihai-idp/IDP.git
git@gitee.com:baihai-idp/IDP.git
baihai-idp
IDP
IDP
main

搜索帮助