config.add_extension('_cobyla', sources=[join('cobyla',x) for x in ['cobyla.pyf', 'cobyla2.f', 'trstlp,f']]) It should be trstlp.f gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC' error: unknown file type '' (from 'cobyla/trstlp,f') Nils