Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation errors on MacOS X #157

Open
apal90 opened this issue Jan 3, 2018 · 4 comments
Open

Installation errors on MacOS X #157

apal90 opened this issue Jan 3, 2018 · 4 comments

Comments

@apal90
Copy link

apal90 commented Jan 3, 2018

I am trying to install pele on my MacOS X (Sierra), and I get the following error. I am copy-pasting everything.

Can someone tell me how to correct this?

$ python setup_with_cmake.py build_ext -i --fcompiler=gfortran
Namespace(compiler=None, j=4) ['setup_with_cmake.py', 'build_ext', '-i', '--fcompiler=gfortran', '-c', 'unix']
fatal: Not a git repository (or any of the parent directories): .git
Cythonizing sources
Processing pele/angleaxis/_cpp_aa.pyx
cython --fast-fail --cplus -I /Users/apal/Downloads/pele-master/pele/potentials -v -o _cpp_aa.cxx _cpp_aa.pyx
Compiling /Users/apal/Downloads/pele-master/pele/angleaxis/_cpp_aa.pyx
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:68:40: Buffer unpacking not optimized away.
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:68:40: Buffer unpacking not optimized away.
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:89:47: Buffer unpacking not optimized away.
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:89:47: Buffer unpacking not optimized away.
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:121:43: Buffer unpacking not optimized away.
warning: /Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:121:43: Buffer unpacking not optimized away.

Error compiling Cython file:
------------------------------------------------------------
...
cdef inline np.ndarray[double, ndim=1] pele_array_to_np(Array[double] v):
    """copy the data in a pele::Array into a new numpy array
    """
    cdef int i
    cdef int N = v.size()
    cdef np.ndarray[double, ndim=1] vnew = np.zeros(N)
                                            ^
------------------------------------------------------------

/Users/apal/Downloads/pele-master/pele/potentials/_pele.pxd:84:45: cimported module has no attribute 'zeros'
Traceback (most recent call last):
  File "/Users/apal/Downloads/pele-master/cythonize.py", line 200, in <module>
    main()
  File "/Users/apal/Downloads/pele-master/cythonize.py", line 197, in main
    find_process_files(root_dir)
  File "/Users/apal/Downloads/pele-master/cythonize.py", line 184, in find_process_files
    process(cur_dir, fromfile, tofile, function, hash_db)
  File "/Users/apal/Downloads/pele-master/cythonize.py", line 160, in process
    processor_function(fromfile, tofile)
  File "/Users/apal/Downloads/pele-master/cythonize.py", line 78, in process_pyx
    raise Exception('Cython failed')
Exception: Cython failed
Traceback (most recent call last):
  File "setup_with_cmake.py", line 106, in <module>
    generate_cython()
  File "setup_with_cmake.py", line 104, in generate_cython
    raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!

@js850
Copy link
Member

js850 commented Jan 3, 2018

Hmm, this used to work, but I haven't tried it in a long time. Maybe there was a change in a dependency (e.g. cython or numpy) which caused this break. What versions of cython and numpy are you using?

@lenhsherr
Copy link
Contributor

try adding this line to the start of pele/potentials/_pele.pxd

import numpy as np

@js850 I'm having this problem on Centos and adding this resolved the problem. So maybe a pull request?

@js850
Copy link
Member

js850 commented Jan 17, 2018

A pull request would be great. Thanks @lenhsherr !

@lenhsherr
Copy link
Contributor

#158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants