Skip to content

Commit 1358f62

Browse files
authored
Merge pull request #13650 from velconia/10_mac_py3_local
10 mac py3 local
2 parents b151d90 + 2404d04 commit 1358f62

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function cmake_gen() {
7070
PYTHON_FLAGS=""
7171
SYSTEM=`uname -s`
7272
if [ "$SYSTEM" == "Darwin" ]; then
73+
echo "using python abi: $1"
7374
if [[ "$1" == "cp27-cp27m" ]] || [[ "$1" == "" ]]; then
74-
echo "using python abi: $1"
7575
if [ -d "/Library/Frameworks/Python.framework/Versions/2.7" ]; then
7676
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/2.7
7777
export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/2.7
@@ -82,7 +82,18 @@ function cmake_gen() {
8282
else
8383
exit 1
8484
fi
85-
# TODO: qiyang add python3 part here
85+
elif [ "$1" == "cp35-cp35m" ]; then
86+
if [ -d "/Library/Frameworks/Python.framework/Versions/3.5" ]; then
87+
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/
88+
export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/
89+
export PATH=/Library/Frameworks/Python.framework/Versions/3.5/bin/:${PATH}
90+
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
91+
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m/
92+
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib"
93+
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
94+
else
95+
exit 1
96+
fi
8697
fi
8798
else
8899
if [ "$1" != "" ]; then
@@ -384,7 +395,7 @@ EOF
384395
ctest --output-on-failure -j $1
385396
# make install should also be test when unittest
386397
make install -j 8
387-
pip install /usr/local/opt/paddle/share/wheels/*.whl
398+
pip install ${INSTALL_PREFIX:-/paddle/build}/opt/paddle/share/wheels/*.whl
388399
if [[ ${WITH_FLUID_ONLY:-OFF} == "OFF" ]] ; then
389400
paddle version
390401
fi

0 commit comments

Comments
 (0)