FATSLiM / fatslim

Main code repository for FATSLiM
GNU General Public License v3.0
21 stars 11 forks source link

Does not compile with cython >= 0.28.0 #5

Closed jbarnoud closed 4 years ago

jbarnoud commented 6 years ago

I manage to pip install fatslim with various version of cython up to 0.27.3. Yet, when trying the install of fatslim 0.2.1 from both pypi or a local clone of the master branch, and a version of cython >= 0.28.0, I get the following traceback during the install:

jon@md79:~/dev/fatslim$ pip install cython==0.28.0
Collecting cython==0.28.0
  Downloading https://files.pythonhosted.org/packages/1a/ee/fa4ff946ac727492a6eab051b92e2929de4ccdc254e26fb0913218747ca6/Cython-0.28-cp36-cp36m-manylinux1_x86_64.whl (3.4MB)
    100% |████████████████████████████████| 3.4MB 1.1MB/s 
Installing collected packages: cython
  Found existing installation: Cython 0.27.3
    Uninstalling Cython-0.27.3:
      Successfully uninstalled Cython-0.27.3
Successfully installed cython-0.28
(apricot) jon@md79:~/dev/fatslim$ pip install -e .
Obtaining file:///home/jon/dev/fatslim
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/jon/dev/fatslim/setup.py", line 274, in <module>
        core_analysis]),
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1026, in cythonize
        cythonize_one(*args)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1129, in cythonize_one
        result = compile_single(pyx_file, options, full_module_name=full_module_name)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 649, in compile_single
        return run_pipeline(source, options, full_module_name)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 499, in run_pipeline
        err, enddata = Pipeline.run_pipeline(pipeline, source)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 354, in run_pipeline
        data = run(phase, data)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 334, in run
        return phase(data)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 52, in generate_pyx_code_stage
        module_node.process_implementation(options, result)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/ModuleNode.py", line 142, in process_implementation
        self.generate_c_code(env, options, result)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/ModuleNode.py", line 378, in generate_c_code
        self.body.generate_function_definitions(env, code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 438, in generate_function_definitions
        stat.generate_function_definitions(env, code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 438, in generate_function_definitions
        stat.generate_function_definitions(env, code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 1976, in generate_function_definitions
        self.generate_function_body(env, code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 1738, in generate_function_body
        self.body.generate_execution_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 444, in generate_execution_code
        stat.generate_execution_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 444, in generate_execution_code
        stat.generate_execution_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 5102, in generate_execution_code
        self.generate_rhs_evaluation_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/Nodes.py", line 5389, in generate_rhs_evaluation_code
        self.rhs.generate_evaluation_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/ExprNodes.py", line 719, in generate_evaluation_code
        self.generate_result_code(code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/ExprNodes.py", line 13120, in generate_result_code
        self.arg.py_result(), self.result(), self.pos, code, from_py_function=from_py_function))
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/PyrexTypes.py", line 514, in from_py_call_code
        error_condition or self.error_condition(result_code)
      File "/coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Compiler/PyrexTypes.py", line 2473, in from_py_call_code
        assert not error_condition, '%s: %s' % (error_pos, error_condition)
    AssertionError: (<StringSourceDescriptor:(tree fragment)>, 10, 263): PyErr_Occurred()
    INFO: Cython will be used.
    INFO: Checking for OpenMP support...
    INFO: OpenMP is present and will be used!
    Compiling fatslimlib/core_base.pyx because it depends on /coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Includes/cpython/mem.pxd.
    Compiling fatslimlib/core_datareading.pyx because it depends on /coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Includes/cpython/mem.pxd.
    Compiling fatslimlib/core_geometry.pyx because it depends on /coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Includes/libc/string.pxd.
    Compiling fatslimlib/core_ns.pyx because it depends on /coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Includes/libc/string.pxd.
    Compiling fatslimlib/core_analysis.pyx because it depends on /coarse/jon/Envs/apricot/lib/python3.6/site-packages/Cython/Includes/cpython/type.pxd.
    [1/5] Cythonizing fatslimlib/core_base.pyx
    [2/5] Cythonizing fatslimlib/core_datareading.pyx
    [3/5] Cythonizing fatslimlib/core_analysis.pyx

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/jon/dev/fatslim/
orbeckst commented 6 years ago

Same problem here. Would be good to fix it!

EDIT: more precisely:

seb-buch commented 6 years ago

The assertion error seems to be triggered by some code generated by the cython compiler and that does not correspond to any line in core_analysis.pyx. As far as I can tell it is related to some object (un)pickling code which is added by Cython without any option to remove nor disable it. I am still trying to find what actual line in core_analysis.pyx trigger the addition of the faulty code.

MelchorSanchez commented 5 years ago

Same problem here using Python2.7 with Cython 0.29.2

seb-buch commented 5 years ago

Thanks for reporting. I've been rewriting fatslim from scratch for the past two months. New code is still pretty experimental, undocumented and lacks some features (in particular, I still need to reimplement the CLI and the support for interacting atoms -eg proteins-)... But, it works with python 3 and the last version of Cython and can be used inside jupyter notebooks! You can follow the progress by checking the branch named full-rewrite.

seb-buch commented 4 years ago

Finally! I managed to find out where the problem was and fixed it! Closing this