Skip to content

Commit 255cc1e

Browse files
committed
Add support for Mac build
test=develop
1 parent c19ff1f commit 255cc1e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,30 @@ function cmake_gen() {
9494
else
9595
exit 1
9696
fi
97+
elif [ "$1" == "cp36-cp36m" ]; then
98+
if [ -d "/Library/Frameworks/Python.framework/Versions/3.6" ]; then
99+
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/
100+
export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/
101+
export PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin/:${PATH}
102+
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
103+
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m/
104+
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib"
105+
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
106+
else
107+
exit 1
108+
fi
109+
elif [ "$1" == "cp37-cp37m" ]; then
110+
if [ -d "/Library/Frameworks/Python.framework/Versions/3.7" ]; then
111+
export LD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/
112+
export DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/
113+
export PATH=/Library/Frameworks/Python.framework/Versions/3.7/bin/:${PATH}
114+
PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
115+
-DPYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/
116+
-DPYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib"
117+
WITH_FLUID_ONLY=${WITH_FLUID_ONLY:-ON}
118+
else
119+
exit 1
120+
fi
97121
fi
98122
else
99123
if [ "$1" != "" ]; then

0 commit comments

Comments
 (0)