Skip to content

Commit

Permalink
add python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tianshuo78520a committed Oct 16, 2023
1 parent 550460f commit 0f67b0f
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3400,20 +3400,7 @@ function run_setup(){
SYSTEM=`uname -s`
if [ "$SYSTEM" == "Darwin" ]; then
echo "Using python abi: $1"
if [ "$1" == "cp37-cp37m" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.7" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.7/lib/
export PATH=/Library/Frameworks/Python.framework/Versions/3.7/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
export PYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/
export PYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
pip3.7 install --user -r ${PADDLE_ROOT}/python/requirements.txt
else
exit 1
fi
elif [ "$1" == "cp38-cp38" ]; then
if [ "$1" == "cp38-cp38" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.8" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.8/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.8/lib/
Expand Down Expand Up @@ -3465,19 +3452,24 @@ function run_setup(){
else
exit 1
fi
elif [ "$1" == "cp312-cp312" ]; then
if [ -d "/Library/Frameworks/Python.framework/Versions/3.12" ]; then
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.12/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/Library/Frameworks/Python.framework/Versions/3.12/lib/
export PATH=/Library/Frameworks/Python.framework/Versions/3.12/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.12/bin/python3
export PYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/
export PYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.12/lib/libpython3.12.dylib
pip3.12 install --user -r ${PADDLE_ROOT}/python/requirements.txt
else
exit 1
fi
fi
else
if [ "$1" != "" ]; then
echo "using python abi: $1"
if [ "$1" == "cp37-cp37m" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.7.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.7.0/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
export PYTHON_EXECUTABLE=/opt/_internal/cpython-3.7.0/bin/python3.7
export PYTHON_INCLUDE_DIR=/opt/_internal/cpython-3.7.0/include/python3.7m
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.7.0/lib/libpython3.so
pip3.7 install -r ${PADDLE_ROOT}/python/requirements.txt
elif [ "$1" == "cp38-cp38" ]; then
if [ "$1" == "cp38-cp38" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.8.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.8.0/bin/:${PATH}
#after changing "PYTHON_LIBRARY:FILEPATH" to "PYTHON_LIBRARY" ,we can use export
Expand Down Expand Up @@ -3509,14 +3501,14 @@ function run_setup(){
export PYTHON_INCLUDE_DIR=/opt/_internal/cpython-3.11.0/include/python3.11
export PYTHON_LIBRARIES=/opt/_internal/cpython-3.11.0/lib/libpython3.so
pip3.11 install -r ${PADDLE_ROOT}/python/requirements.txt
elif [ "$1" == "conda-python3.7" ]; then
export LD_LIBRARY_PATH=/opt/conda/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/conda/bin/:${PATH}
elif [ "$1" == "cp312-cp312" ]; then
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH}
export PATH=/opt/_internal/cpython-3.12.0/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.7m
export PYTHON_LIBRARIES=/opt/conda/lib/libpython3.so
/opt/conda/bin/pip install -r ${PADDLE_ROOT}/python/requirements.txt
export PYTHON_EXECUTABLE=/opt/_internal/cpython-3.12.0/bin/python3.12
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
fi
else
pip install -r ${PADDLE_ROOT}/python/requirements.txt
Expand Down

0 comments on commit 0f67b0f

Please sign in to comment.