Memo‎ > ‎

A dirty trick to install numpy via distutils without gcc 4.9

posted Dec 15, 2014, 12:17 AM by Teng-Yok Lee   [ updated Dec 15, 2014, 12:17 AM ]
After python 2.7.8, its distutils use gcc 4.9 as the C compiler, which introduces a new flag -fstack-protector-strong. Also, the AR executable is changed. However, on a system without gcc 4.9, this can fail. Consequently, numpy cannot be built.

While not all package management system has gcc 4.9 (e.g. old Ubuntu AMI from AWS), a quick trick is to modify the following file:

/usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py

First, remove -fstack-protector-strong in this file. Second, change the value of AR to 'ar'.


Comments