|
4 | 4 | set -e |
5 | 5 | RELEASE_DIR=release |
6 | 6 | DEBUG_DIR=debug |
7 | | -GRAPHLAB_HOME=$PWD |
| 7 | +GRAPHLAB_HOME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
8 | 8 | DEPS_PREFIX=$PWD/deps/local |
9 | 9 |
|
10 | 10 | if [[ $OSTYPE == linux* ]]; then |
@@ -57,6 +57,8 @@ function print_help { |
57 | 57 | echo |
58 | 58 | echo " --python_only Only run python dependency installation." |
59 | 59 | echo |
| 60 | + echo " --python3 Use Python 3.4, default is Python 2.7." |
| 61 | + echo |
60 | 62 | echo " --toolchain=[toolchain] Toolchain is either a dato-deps file on disk, " |
61 | 63 | echo " or a URL to a toolchain. If toolchain is" |
62 | 64 | echo " \"default\", a default one is selected" |
@@ -96,8 +98,8 @@ function unknown_option { |
96 | 98 | function run_cleanup { |
97 | 99 | #!/bin/bash |
98 | 100 | echo "cleaning up"; |
99 | | - rm -rf release debug deps cmake patches description.json |
100 | | - rm -f *.tar.gz |
| 101 | + rm -rf release debug deps cmake patches description.json deps_version dummy.cpp miniconda.sh |
| 102 | + rm -f *.tar.gz |
101 | 103 | } |
102 | 104 |
|
103 | 105 |
|
@@ -162,6 +164,7 @@ while [ $# -gt 0 ] |
162 | 164 | --yes) default_yes=1;; |
163 | 165 | --cmake_only) cmake_only=1;; |
164 | 166 | --python_only) python_only=1;; |
| 167 | + --python3) python3=1;; |
165 | 168 | --R_integration) R_integration=1;; |
166 | 169 | --help) print_help ;; |
167 | 170 | -D) CFLAGS="$CFLAGS -D $2"; shift ;; |
@@ -201,10 +204,20 @@ if [[ $python_only == 1 ]]; then |
201 | 204 | run_cmake_configure=0 |
202 | 205 | fi |
203 | 206 |
|
| 207 | +if [[ $python3 == 1 ]]; then |
| 208 | + CFLAGS="$CFLAGS -D PYTHON_VERSION=\"python3.4m\"" |
| 209 | + PYTHON_VERSION="python3.4m" |
| 210 | +else |
| 211 | + CFLAGS="$CFLAGS -D PYTHON_VERSION=\"python2.7\"" |
| 212 | + PYTHON_VERSION="python2.7" |
| 213 | +fi |
204 | 214 |
|
205 | 215 | if [[ $run_toolchain_install == 1 ]]; then |
206 | 216 | run_cleanup |
207 | | - ./oss_local_scripts/install_python_toolchain.sh |
| 217 | + |
| 218 | + cd ${GRAPHLAB_HOME} |
| 219 | + PYTHON_VERSION=${PYTHON_VERSION} ./oss_local_scripts/install_python_toolchain.sh |
| 220 | + |
208 | 221 | REMAINING_OPTIONS=$@ |
209 | 222 | if [[ $toolchain == default || $toolchain == "" ]]; then |
210 | 223 | if [[ $OSTYPE == darwin* ]]; then |
@@ -251,13 +264,12 @@ if [[ $OSTYPE == msys ]]; then |
251 | 264 | CXX=g++.exe |
252 | 265 | fi |
253 | 266 | CMAKE=$PWD/deps/local/bin/cmake |
| 267 | + |
254 | 268 | LINKER="" |
255 | 269 | if [ -e $PWD/deps/local/bin/ld.gold ]; then |
256 | 270 | LINKER="-DCMAKE_LINKER=$PWD/deps/local/bin/ld.gold" |
257 | 271 | elif [ -e $PWD/deps/local/bin/ld ]; then |
258 | 272 | LINKER="-DCMAKE_LINKER=$PWD/deps/local/bin/ld" |
259 | | -else |
260 | | - LINKER="" |
261 | 273 | fi |
262 | 274 |
|
263 | 275 | mkdir -p doc |
@@ -292,9 +304,12 @@ if [[ $OSTYPE == msys ]]; then |
292 | 304 | AR=`cygpath -m $AR` |
293 | 305 | CFLAGS="$CFLAGS -D CMAKE_AR=$AR" |
294 | 306 | # a bunch of stuff needed for python |
295 | | - CFLAGS="$CFLAGS -D PYTHON_LIBRARY:FILEPATH=$PWD/deps/local/lib/python27.dll" |
| 307 | + if [[ $python3 == 1 ]]; then |
| 308 | + CFLAGS="$CFLAGS -D PYTHON_LIBRARY:FILEPATH=$PWD/deps/local/lib/python34.dll" |
| 309 | + else |
| 310 | + CFLAGS="$CFLAGS -D PYTHON_LIBRARY:FILEPATH=$PWD/deps/local/lib/python27.dll" |
| 311 | + fi |
296 | 312 | CFLAGS="$CFLAGS -D PYTHON_EXECUTABLE:FILEPATH=$PWD/deps/conda/bin/python" |
297 | | - CFLAGS="$CFLAGS -D PYTHON_INCLUDE_DIR:FILEPATH=$PWD/deps/local/include/python2.7" |
298 | 313 | export PATH=$PATH:/mingw64/bin |
299 | 314 | fi |
300 | 315 | ## ============================================================================ |
|
0 commit comments