Numpy issue and bugfix when installing GRIT v1.1.2

65 views
Skip to first unread message

Fabian Buske

unread,
May 6, 2014, 1:53:20 AM5/6/14
to grit...@googlegroups.com
Hi,

I had some issues installing GRIT v1.1.2 on our HPC cluster, where I have a Python 2.7 version at a custom location.

-bash-4.1$ python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to GRIT.egg-info/requires.txt
writing GRIT.egg-info/PKG-INFO
writing top-level names to GRIT.egg-info/top_level.txt
writing dependency_links to GRIT.egg-info/dependency_links.txt
reading manifest file 'GRIT.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'GRIT.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'grit.sparsify_support_fns' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/share/ClusterShare/software/contrib/fabbus/python/2.7.3/include/python2.7 -c grit/sparsify_support_fns.c -o build/temp.linux-x86_64-2.7/grit/sparsify_support_fns.o
grit/sparsify_support_fns.c:346:31: error: numpy/arrayobject.h: No such file or directory
grit/sparsify_support_fns.c:347:31: error: numpy/ufuncobject.h: No such file or directory
grit/sparsify_support_fns.c:602: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_t_5numpy_int8_t’

Essentially setup could not locate numpy.

I fixed this by adding two lines to the setup.py, importing numpy and adding the 'include_dirs' directive to the config part:

#from distutils.core import setup
#from distutils.extension import Extension

from setuptools import setup, Extension, find_packages
import numpy

...

config = {
    'include_package_data': True,
...
   'include_dirs': [numpy.get_include()],
...
}

if __name__== '__main__':
    setup(**config)
~

Cheers,
Fabian

Nathan Boley

unread,
May 6, 2014, 12:17:09 PM5/6/14
to Fabian Buske, grit...@googlegroups.com
Dear Fabian,

> I fixed this by adding two lines to the setup.py, importing numpy and adding
> the 'include_dirs' directive to the config part:

< snip fix >

Thanks for the report and useful suggestion. I've released 1.1.3 with
this fixed.

Best, Nathan

Chris Zaleski

unread,
Jun 22, 2015, 11:29:42 AM6/22/15
to grit...@googlegroups.com
Hello Nathan,

I'm experiencing this exact problem while trying to build version 2.0.4. Should I use the fix originally suggested here, or do you recommend an alternate method?

Thanks,
Chris

Nathan Boley

unread,
Jun 22, 2015, 11:35:32 AM6/22/15
to Chris Zaleski, grit...@googlegroups.com
Hi Chris,

I'm experiencing this exact problem while trying to build version 2.0.4. Should I use the fix originally suggested here, or do you recommend an alternate method?

That fix would work - I also just tagged and pushed 2.0.5beta1 (https://github.com/nboley/grit/releases/tag/2.0.5beta1) which includes the fix.

Best, Nathan 
Reply all
Reply to author
Forward
0 new messages