-
Notifications
You must be signed in to change notification settings - Fork 764
Closed
Milestone
Description
Expected behaviour
After upgrade to cython 0.28 MDAnalysis should build.
Actual behaviour
It fails (on travis) and locally (here: macOS):
Attempting to autodetect OpenMP support... Did not detect OpenMP support.
No openmp compatible compiler found default to serial build.
Will attempt to use Cython.
Compiling MDAnalysis/lib/formats/libdcd.pyx because it changed.
Compiling MDAnalysis/lib/c_distances.pyx because it changed.
Compiling MDAnalysis/lib/c_distances_openmp.pyx because it changed.
Compiling MDAnalysis/lib/qcprot.pyx because it changed.
Compiling MDAnalysis/lib/formats/libmdaxdr.pyx because it changed.
Compiling MDAnalysis/lib/formats/cython_util.pyx because it changed.
Compiling MDAnalysis/analysis/encore/cutils.pyx because it changed.
Compiling MDAnalysis/analysis/encore/clustering/affinityprop.pyx because it changed.
Compiling MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.pyx because it changed.
[1/9] Cythonizing MDAnalysis/analysis/encore/clustering/affinityprop.pyx
Error compiling Cython file:
------------------------------------------------------------
...
"""
from ..utils import TriangularMatrix
import logging
import numpy
cimport numpy
cimport caffinityprop
^
------------------------------------------------------------
MDAnalysis/analysis/encore/clustering/affinityprop.pyx:32:8: 'caffinityprop.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
# Prepare input and ouput arrays
cdef numpy.ndarray[numpy.float32_t, ndim=1] matndarray = numpy.ascontiguousarray(s._elements, dtype=numpy.float32)
cdef numpy.ndarray[long, ndim=1] clusters = numpy.zeros((s.size),dtype=long)
# run C module Affinity Propagation
iterations = caffinityprop.CAffinityPropagation( <float*>matndarray.data, cn, lam, max_iterations, convergence, noise, <long*>clusters.data)
^
------------------------------------------------------------
MDAnalysis/analysis/encore/clustering/affinityprop.pyx:100:30: cimported module has no attribute 'CAffinityPropagation'
Error compiling Cython file:
------------------------------------------------------------
...
# Prepare input and ouput arrays
cdef numpy.ndarray[numpy.float32_t, ndim=1] matndarray = numpy.ascontiguousarray(s._elements, dtype=numpy.float32)
cdef numpy.ndarray[long, ndim=1] clusters = numpy.zeros((s.size),dtype=long)
# run C module Affinity Propagation
iterations = caffinityprop.CAffinityPropagation( <float*>matndarray.data, cn, lam, max_iterations, convergence, noise, <long*>clusters.data)
^
------------------------------------------------------------
MDAnalysis/analysis/encore/clustering/affinityprop.pyx:100:30: Compiler crash in AnalyseExpressionsTransform
ModuleNode.body = StatListNode(affinityprop.pyx:28:0)
StatListNode.stats[6] = StatListNode(affinityprop.pyx:37:0)
StatListNode.stats[0] = CompilerDirectivesNode(affinityprop.pyx:37:0)
CompilerDirectivesNode.body = StatListNode(affinityprop.pyx:37:0)
StatListNode.stats[0] = DefNode(affinityprop.pyx:37:0,
doc = 'Affinity propagation clustering algorithm. This class is a Cython wrapper around the Affinity propagation algorithm, which is implement as a C library (see ap.c). The implemented algorithm is described in the paper:\n\n Clustering by Passing Messages Between Data Points.\n Brendan J. Frey and Delbert Dueck, University of Toronto\n Science 315, 972–976, February 2007\n\n Parameters\n ----------\n s : encore.utils.TriangularMatrix object\n Triangular matrix containing the similarity values for each pair of\n clustering elements. Notice that the current implementation does not\n allow for asymmetric values (i.e. similarity(a,b) is assumed to be\n equal to similarity(b,a))\n preference : numpy.array of floats or float\n Preference values, which the determine the number of clusters. If a\n single value is given, all the preference values are set to that.\n Otherwise, the list is used to set the preference values (one value per\n element, so the list must be of the same size as the number of\n elements)\n lam : float\n Floating point value that defines how much damping is applied to the\n solution at each iteration. Must be ]0,1]\n max_iterations : int\n Maximum number of iterations\n convergence : int\n Number of iterations in which the cluster centers must remain the same\n in order to reach convergence\n noise : int\n Whether to apply noise to the input s matrix, such there are no equal\n values. 1 is for yes, 0 is for no.\n\n Returns\n -------\n elements : list of int or None\n List of cluster-assigned elements, which can be used by\n encore.utils.ClustersCollection to generate Cluster objects. See these\n classes for more details.\n\n ',
modifiers = [...]/0,
name = 'AffinityPropagation',
np_args_idx = [...]/0,
num_required_args = 5,
py_wrapper_required = True,
reqd_kw_flags_cname = '0',
used = True)
File 'ExprNodes.py', line 5213, in infer_type: SimpleCallNode(affinityprop.pyx:100:51,
result_is_used = True,
use_managed_ref = True)
File 'ExprNodes.py', line 6704, in infer_type: AttributeNode(affinityprop.pyx:100:30,
attribute = 'CAffinityPropagation',
is_attribute = 1,
needs_none_check = True,
result_is_used = True,
use_managed_ref = True)
Compiler crash traceback from this point on:
File "/Users/oliver/anaconda3/envs/mda_develop/lib/python3.6/site-packages/Cython/Compiler/ExprNodes.py", line 6704, in infer_type
return node.entry.type
AttributeError: 'NoneType' object has no attribute 'type'
Traceback (most recent call last):
File "setup.py", line 482, in <module>
exts, cythonfiles = extensions(config)
File "setup.py", line 372, in extensions
extensions = cythonize(pre_exts)
File "/Users/oliver/anaconda3/envs/mda_develop/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1026, in cythonize
cythonize_one(*args)
File "/Users/oliver/anaconda3/envs/mda_develop/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1146, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: MDAnalysis/analysis/encore/clustering/affinityprop.pyx
Code to reproduce the behaviour
conda upgrade --all
cd package
python setup.py buildCurrently version of MDAnalysis:
develop
(run python -c "import MDAnalysis as mda; print(mda.__version__)")