GithubHelp home page GithubHelp logo

catboost-arm's Introduction

catboost-arm

编译catboost

3.7.4

# 需要在x86_64架构的机器上执行,在aarch64执行会失败
# docker挂载目录
mkdir wheel_out
cd wheel_out
# 需要指定platform
docker run -it --platform=linux/amd64 -v $(pwd)/:/wheel_out -e PYTHON_VSERSION=3.7.4 -e TAG=v1.1.1 debian:11
# 以上命令在容器外执行

# 以下命令在容器内执行
# 替换镜像源
sed -i -E 's/(deb|security).debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
# sed -i -E 's/(deb|security).debian.org/mirrors.huaweicloud.com/g' /etc/apt/sources.list
apt update && \
	apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
	wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git
# 安装pyenv
curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
# 使用代理下载catboost
# curl -s -S -L https://ghproxy.com/https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec "$SHELL"
pyenv install -v $PYTHON_VSERSION
pyenv virtualenv $PYTHON_VSERSION catboost_build_$PYTHON_VSERSION
pyenv activate catboost_build_$PYTHON_VSERSION
# npm nodejs
curl -sS -L https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install -y nodejs npm
npm config set registry https://registry.npmmirror.com
npm install rimraf yarn -g
# 下载catboost
git clone -b $TAG https://github.com/catboost/catboost.git
# 使用代理下载catboost
# git clone -b v1.1.1 https://ghproxy.com/https://github.com/catboost/catboost.git
cd catboost
curl -sS -L https://ghproxy.com/https://raw.githubusercontent.com/fengqi5866/catboost-arm/main/arm64-v1.1.1.patch | git apply

cd catboost/python-package/catboost
python3 ../mk_wheel.py --target-platform=default-linux-aarch64 -DPYTHON_BIN=/root/.pyenv/versions/$PYTHON_VSERSION/bin/python3 -DPYTHON_CONFIG=/root/.pyenv/versions/$PYTHON_VSERSION/bin/python3-config -DHAVE_CUDA=no
mv ../*.whl /wheel_out

其他版本

# 3.7.16 3.8.16 3.9.16 3.10.9
export PYTHON_VSERSION=3.8.16
pyenv install -v $PYTHON_VSERSION
pyenv virtualenv $PYTHON_VSERSION catboost_build_$PYTHON_VSERSION
pyenv activate catboost_build_$PYTHON_VSERSION
python3 ../mk_wheel.py --target-platform=default-linux-aarch64 -DPYTHON_BIN=/root/.pyenv/versions/$PYTHON_VSERSION/bin/python3 -DPYTHON_CONFIG=/root/.pyenv/versions/$PYTHON_VSERSION/bin/python3-config -DHAVE_CUDA=no

测试

# 需要在arm64架构的机器上执行
git clone https://ghproxy.com/https://github.com/fengqi5866/catboost-arm.git && cd catboost-arm
docker run -it --platform=linux/arm64 -v $(pwd)/:/wheel_out python:3.7.4-buster bash
# 以上命令在容器外执行

# 以下命令在容器内执行
pip3 install /wheel_out/catboost-1.1.1-cp37-none-linux_aarch64.whl -i https://pypi.tuna.tsinghua.edu.cn/simple
python3 test_catboost.py

catboost-arm's People

Contributors

fengqi2010 avatar

Stargazers

 avatar

Watchers

 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.