mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 01:41:17 +08:00
Linux build for CI of other packages (#660)
This commit is contained in:
parent
7f3f8d8f8d
commit
11d2c8f7a1
@ -7,6 +7,9 @@ parameters:
|
|||||||
weekly_build:
|
weekly_build:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
test_release:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux_build_and_test:
|
linux_build_and_test:
|
||||||
@ -170,12 +173,61 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|
||||||
|
build_linux_test_release:
|
||||||
|
parameters:
|
||||||
|
python_version:
|
||||||
|
type: string
|
||||||
|
default: "3.9"
|
||||||
|
extra_env:
|
||||||
|
type: string
|
||||||
|
default: "DEV_RELEASE=1"
|
||||||
|
docker:
|
||||||
|
- image: ubuntu:20.04
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Build wheel
|
||||||
|
command: |
|
||||||
|
PYTHON=python<< parameters.python_version >>
|
||||||
|
apt-get update
|
||||||
|
apt-get upgrade -y
|
||||||
|
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
|
||||||
|
apt-get install -y apt-utils
|
||||||
|
apt-get install -y software-properties-common
|
||||||
|
add-apt-repository -y ppa:deadsnakes/ppa
|
||||||
|
apt-get install -y $PYTHON $PYTHON-dev $PYTHON-full
|
||||||
|
apt-get install -y libblas-dev liblapack-dev liblapacke-dev
|
||||||
|
apt-get install -y build-essential git
|
||||||
|
$PYTHON -m venv env
|
||||||
|
source env/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install --upgrade cmake
|
||||||
|
pip install --upgrade pybind11[global]
|
||||||
|
pip install --upgrade setuptools
|
||||||
|
pip install pybind11-stubgen
|
||||||
|
pip install numpy
|
||||||
|
pip install auditwheel
|
||||||
|
pip install patchelf
|
||||||
|
pip install build
|
||||||
|
<< parameters.extra_env >> \
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL="" \
|
||||||
|
pip install . -v
|
||||||
|
python setup.py generate_stubs
|
||||||
|
<< parameters.extra_env >> \
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL="" \
|
||||||
|
python -m build --wheel
|
||||||
|
auditwheel show dist/*
|
||||||
|
auditwheel repair dist/* --plat manylinux_2_31_x86_64
|
||||||
|
- store_artifacts:
|
||||||
|
path: wheelhouse/
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
when:
|
when:
|
||||||
and:
|
and:
|
||||||
- not: << pipeline.parameters.nightly_build >>
|
- not: << pipeline.parameters.nightly_build >>
|
||||||
- not: << pipeline.parameters.weekly_build >>
|
- not: << pipeline.parameters.weekly_build >>
|
||||||
|
- not: << pipeline.parameters.test_release >>
|
||||||
jobs:
|
jobs:
|
||||||
- mac_build_and_test
|
- mac_build_and_test
|
||||||
- linux_build_and_test
|
- linux_build_and_test
|
||||||
@ -207,3 +259,11 @@ workflows:
|
|||||||
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
xcode_version: ["14.3.1", "15.2.0"]
|
xcode_version: ["14.3.1", "15.2.0"]
|
||||||
build_env: ["DEV_RELEASE=1"]
|
build_env: ["DEV_RELEASE=1"]
|
||||||
|
linux_test_release:
|
||||||
|
when: << pipeline.parameters.test_release >>
|
||||||
|
jobs:
|
||||||
|
- build_linux_test_release:
|
||||||
|
matrix:
|
||||||
|
parameters:
|
||||||
|
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
|
extra_env: ["PYPI_RELEASE=1"]
|
||||||
|
@ -123,8 +123,8 @@ else()
|
|||||||
/usr/include
|
/usr/include
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
$ENV{BLAS_HOME}/include)
|
$ENV{BLAS_HOME}/include)
|
||||||
message(STATUS "Blas lib" ${BLAS_LIBRARIES})
|
message(STATUS "Blas lib " ${BLAS_LIBRARIES})
|
||||||
message(STATUS "Blas include" ${BLAS_INCLUDE_DIRS})
|
message(STATUS "Blas include " ${BLAS_INCLUDE_DIRS})
|
||||||
target_include_directories(mlx PRIVATE ${BLAS_INCLUDE_DIRS})
|
target_include_directories(mlx PRIVATE ${BLAS_INCLUDE_DIRS})
|
||||||
target_link_libraries(mlx ${BLAS_LIBRARIES})
|
target_link_libraries(mlx ${BLAS_LIBRARIES})
|
||||||
find_package(LAPACK REQUIRED)
|
find_package(LAPACK REQUIRED)
|
||||||
@ -134,7 +134,7 @@ else()
|
|||||||
find_path(LAPACK_INCLUDE_DIRS lapacke.h
|
find_path(LAPACK_INCLUDE_DIRS lapacke.h
|
||||||
/usr/include
|
/usr/include
|
||||||
/usr/local/include)
|
/usr/local/include)
|
||||||
message(STATUS "Lapack lib" ${LAPACK_LIBRARIES})
|
message(STATUS "Lapack lib " ${LAPACK_LIBRARIES})
|
||||||
message(STATUS "Lapack include " ${LAPACK_INCLUDE_DIRS})
|
message(STATUS "Lapack include " ${LAPACK_INCLUDE_DIRS})
|
||||||
target_include_directories(mlx PRIVATE ${LAPACK_INCLUDE_DIRS})
|
target_include_directories(mlx PRIVATE ${LAPACK_INCLUDE_DIRS})
|
||||||
target_link_libraries(mlx ${LAPACK_LIBRARIES})
|
target_link_libraries(mlx ${LAPACK_LIBRARIES})
|
||||||
|
Loading…
Reference in New Issue
Block a user