Skip to content

Add python abi cp313-cp313 #70944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ function cmake_base() {
else
exit 1
fi
elif [ "$1" == "cp313-cp313" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.13" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.13/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.13/lib/
export PATH=/Library/Frameworks/Python.framework/Versions/3.13/bin/:${PATH}
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.13/bin/python3
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.13/include/python3.13/
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.13/lib/libpython3.13.dylib"
pip3.13 install --user -r ${PADDLE_ROOT}/python/requirements.txt
else
exit 1
fi
fi
else
if [ "$1" != "" ]; then
Expand Down Expand Up @@ -182,6 +194,14 @@ function cmake_base() {
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.12.0/lib/libpython3.so"
pip3.12 install -r ${PADDLE_ROOT}/python/requirements.txt
pip3.12 install -r ${PADDLE_ROOT}/paddle/scripts/compile_requirements.txt
elif [ "$1" == "cp313-cp313" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.13.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.13.0/bin/:${PATH}
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.13.0/bin/python3.13
-DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.13.0/include/python3.13
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-3.13.0/lib/libpython3.so"
pip3.13 install -r ${PADDLE_ROOT}/python/requirements.txt
pip3.13 install -r ${PADDLE_ROOT}/paddle/scripts/compile_requirements.txt
elif [ "$1" == "conda-python3.8" ]; then
export LD_LIBRARY_PATH=/opt/conda/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/conda/bin/:${PATH}
Expand Down Expand Up @@ -4130,6 +4150,19 @@ function run_setup(){
else
exit 1
fi
elif [ "$1" == "cp313-cp313" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.13" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.13/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.13/lib/
export PATH=/Library/Frameworks/Python.framework/Versions/3.13/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.13/bin/python3
export PYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.13/include/python3.13/
export PYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.13/lib/libpython3.13.dylib
pip3.13 install --user -r ${PADDLE_ROOT}/python/requirements.txt
else
exit 1
fi
fi
else
if [ "$1" != "" ]; then
Expand Down Expand Up @@ -4179,7 +4212,16 @@ function run_setup(){
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.12.0/lib/libpython3.so
pip3.12 install -r ${PADDLE_ROOT}/python/requirements.txt
pip3.12 install -r ${PADDLE_ROOT}/paddle/scripts/compile_requirements.txt
fi
elif [ "$1" == "cp313-cp313" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.13.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.13.0/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/opt/_internal/cpython-3.13.0/bin/python3.13
export PYTHON_INCLUDE_DIR=/opt/_internal/cpython-3.13.0/include/python3.13
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.13.0/lib/libpython3.so
pip3.13 install -r ${PADDLE_ROOT}/python/requirements.txt
pip3.13 install -r ${PADDLE_ROOT}/paddle/scripts/compile_requirements.txt
fi
else
pip install -r ${PADDLE_ROOT}/python/requirements.txt
fi
Expand Down Expand Up @@ -4409,6 +4451,20 @@ function run_setup_mac(){
else
exit 1
fi
elif [ "$1" == "cp313-cp313" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.13" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.13/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.13/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${PADDLE_ROOT}/build/third_party/install/lapack/lib
export PATH=/Library/Frameworks/Python.framework/Versions/3.13/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.13/bin/python3
export PYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.13/include/python3.13/
export PYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.13/lib/libpython3.13.dylib
pip3.13 install --user -r ${PADDLE_ROOT}/python/requirements.txt
else
exit 1
fi
fi
else
if [ "$1" != "" ]; then
Expand Down Expand Up @@ -4453,15 +4509,23 @@ function run_setup_mac(){
export PYTHON_INCLUDE_DIR=/opt/_internal/cpython-3.12.0/include/python3.12
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.12.0/lib/libpython3.so
pip3.12 install -r ${PADDLE_ROOT}/python/requirements.txt
elif [ "$1" == "conda-python3.8" ]; then
elif [ "$1" == "cp313-cp313" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.13.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.13.0/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/opt/_internal/cpython-3.13.0/bin/python3.13
export PYTHON_INCLUDE_DIR=/opt/_internal/cpython-3.13.0/include/python3.13
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.13.0/lib/libpython3.so
pip3.13 install -r ${PADDLE_ROOT}/python/requirements.txt
elif [ "$1" == "conda-python3.8" ]; then
export LD_LIBRARY_PATH=/opt/conda/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/conda/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export DPYTHON_EXECUTABLE=/opt/conda/bin/python
export PYTHON_INCLUDE_DIR=/opt/conda/include/python3.8m
export PYTHON_LIBRARIES=/opt/conda/lib/libpython3.so
/opt/conda/bin/pip install -r ${PADDLE_ROOT}/python/requirements.txt
fi
fi
else
pip install -r ${PADDLE_ROOT}/python/requirements.txt
fi
Expand Down
Loading