Skip to content

Commit 73453e5

Browse files
committed
NF: set default compilers
1 parent da7cff9 commit 73453e5

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

install.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PNG_BASE_URL=http://downloads.sourceforge.net/project/libpng/libpng16
99
PNG_VERSION="1.6.10"
1010
XQ_BASE_URL=http://xquartz.macosforge.org/downloads/SL
1111
XQUARTZ_VERSION="2.7.4"
12+
# Compiler defaults
13+
CC=clang
14+
CXX=clang++
1215

1316
function require_success {
1417
STATUS=$?
@@ -29,7 +32,7 @@ function install_macports {
2932
tar -xzf $MACPORTS.tar.gz
3033

3134
cd $MACPORTS
32-
./configure --prefix=$PREFIX
35+
CC=${CC} CXX=${CXX} ./configure --prefix=$PREFIX
3336
make
3437
sudo make install
3538
cd ..
@@ -42,9 +45,13 @@ function install_macports {
4245

4346

4447
function install_matplotlib {
48+
# Accept c and c++ compilers, default to cc, c++
49+
MPL_CC=${1:-"cc"}
50+
MPL_CXX=${2:-"c++"}
51+
4552
cd matplotlib
4653

47-
$SUDO $PYTHON setup.py install
54+
$SUDO CC=$MPL_CC CXX=$MPL_CXX $PYTHON setup.py install
4855
require_success "Failed to install matplotlib"
4956

5057
cd ..
@@ -129,7 +136,8 @@ function install_freetype {
129136
tar -xjf freetype.tar.bz2
130137
cd freetype-$FT_VERSION
131138
require_success "Failed to cd to freetype directory"
132-
./configure --enable-shared=no --enable-static=true
139+
140+
CC=${CC} CXX=${CXX} ./configure --enable-shared=no --enable-static=true
133141
make
134142
sudo make install
135143
require_success "Failed to install freetype $FT_VERSION"
@@ -259,7 +267,6 @@ elif [ "$TEST" == "brew_py3" ] ; then
259267
fi
260268

261269
$PIP install numpy
262-
263270
install_matplotlib
264271

265272
elif [ "$TEST" == "macports" ] ; then
@@ -282,7 +289,6 @@ then
282289

283290
install_macports
284291
install_macports_python $PY noforce $VENV
285-
286292
install_matplotlib
287293

288294
elif [ "$TEST" == "macpython27_10.9" ] ; then
@@ -308,7 +314,7 @@ elif [ "$TEST" == "macpython27_10.9" ] ; then
308314
install_mac_numpy $NUMPY $PY $OS
309315
fi
310316

311-
install_matplotlib
317+
install_matplotlib $CC $CXX
312318

313319
elif [ "$TEST" == "macpython33_10.9" ] ; then
314320

@@ -328,7 +334,7 @@ elif [ "$TEST" == "macpython33_10.9" ] ; then
328334
exit "numpy does not distribute python 3 binaries, yet"
329335
fi
330336

331-
install_matplotlib
337+
install_matplotlib $CC $CXX
332338

333339
else
334340
echo "Unknown test setting ($TEST)"

0 commit comments

Comments
 (0)