Memo-migrated‎ > ‎

A dirty trick to install numpy via distutils without gcc 4.9

posted Dec 15, 2014, 12:17 AM by Teng-Yok Lee   [ updated Jan 3, 2021, 12:21 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:


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