JacquesLucke / animation_nodes

Node based visual scripting system designed for motion graphics in Blender.
Other
2.29k stars 342 forks source link

Error after enabling the addon #649

Closed D4N13L1980 closed 7 years ago

D4N13L1980 commented 7 years ago

Hi, Jacques Lucke

Error after enabling the addon.

Animation Nodes Addon - Cython Branch from graphicall.org Clean Blender 2.78.a 12118_animation_nodes.zip for Linux My system Ubuntu 16.04 LTS 64-bit

Traceback (most recent call last): File "/home/d4n13l/blender/2.78/scripts/modules/addon_utils.py", line 330, in enable mod = import(module_name) File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/init.py", line 115, in modules = developer_utils.setup_addon_modules(path, name, "bpy" in locals()) File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/developer_utils.py", line 40, in setup_addon_modules modules = import_submodules(names) File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/developer_utils.py", line 30, in import_submodules modules.append(importlib.import_module("." + name, package_name)) File "/home/d4n13l/blender/2.78/python/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/algorithms/interpolations/init.py", line 1, in from . implementations import * File "animation_nodes/algorithms/interpolations/implementations.pyx", line 1, in init animation_nodes.algorithms.interpolations.implementations (/tmp/animation_nodes/animation_nodes/algorithms/interpolations/implementations.c:10188) cimport cython File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/data_structures/init.py", line 20, in dataStructures = importDataStructures() File "/home/d4n13l/blender/2.78/scripts/addons/animation_nodes/data_structures/init.py", line 4, in importDataStructures from . meshes.mesh_data import MeshData File "animation_nodes/data_structures/lists/base_lists.pxd", line 22, in init animation_nodes.data_structures.meshes.mesh_data (/tmp/animation_nodes/animation_nodes/data_structures/meshes/mesh_data.c:3752) cdef class FloatList(CList): ImportError: /home/d4n13l/blender/2.78/scripts/addons/animation_nodes/data_structures/lists/base_lists.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

GottfriedHofmann commented 7 years ago

Hello, I had the same error. I compiled myself using the Python package collection "Anaconda" and got a working build: http://blenderdiplom.com/files/animation_nodes.zip

JacquesLucke commented 7 years ago

thanks, this is still an open issue, can you try the build Gottfried provided, please? And it would be helpful if you report if it works or not.

D4N13L1980 commented 7 years ago

thanks, Gottfried's build works.

plasmasolutions commented 7 years ago

Hi Gottfried,

are you using 16.04 as well? Which library versions are installed for Cython & Python ?

As my builds are created on 16.10 it could very well be that the libraries you have installed are older than the one I'd like to see... could you verify that?

Cheers, Thomas

plasmasolutions commented 7 years ago

Ok, it's getting more interesting. Gottfried's elf definition contains this one (which is totally correct btw):

0x0000000000000001 (NEEDED) Shared library: [libpython3.5m.so.1.0] 0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000f (RPATH) Library rpath: [/home/g/anaconda3/lib]

While my upload omits the first and last entry... which means:

  1. My build does tell the system that it depends on libpython3.5m.so.1.0 (which it should)
  2. There is no library path where it would search for missing libs (which is totally correct as no one who downloads Gottfried's build has his library path ;))

The question I got now is: What is anaconda doing differently here? How is it getting it's dynamic linking information? @JacquesLucke any info on that? How did you set the project up?

@D4N13L1980 Daniel, thanks for reporting that - it will definitely lead to builds that are more compatible with the Linux world. @GottfriedHofmann Thanks for helping out with a build so quickly!

D4N13L1980 commented 7 years ago

@plasmasolutions you are welcome^^

aliasguru commented 7 years ago

Is Anaconda still the only option to get the Cython branch of AN compiled? I tried compilation today with standard Python 3.5 on Ubuntu 16.10, and still get the /base_lists.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf error when trying to enable the Add-on. Compiling the same repository on Windows worked fine today.

JacquesLucke commented 7 years ago

Unfortunately I still have not found a good solution to this problem.. Sorry :/

JacquesLucke commented 7 years ago

Can you execute these commands in Blenders python console and share the results?

bpy.app.binary_path_python
import sys
sys.version
import numpy

(the last statement just checks if numpy is installed)

aliasguru commented 7 years ago

@JacquesLucke No prob, here are the outputs (I have a custom install of Blender by simply unzipping the current buildbot version to a folder and running it with a symlink):

bpy.app.binary_path_python '/CustomSoftware/CurrentDev/2.78/python/bin/python3.5m'

import sys sys.version '3.5.2 (default, Dec 1 2016, 15:44:44) \n[GCC 6.2.1 20161124]'

import numpy no output at all actually, so numpy is there

Not sure if this helps you debugging the thing. What have you got in mind? What are you looking for?

JacquesLucke commented 7 years ago

Thanks, looks all fine I guess..

I'm not sure what I specifically look for, basicly I googled cython undefined symbol PyFPE_jbuf and it seems to be related to different versions of numpy somehow, I'm not sure..

Also I noticed that it does not work when Blender uses Python 3.6 (as Blender should include 3.5 atm, this should not be an issue). Another weird thing is that both linux builds from graphicall.org work on my pc but only the one by Gottfried works on my laptop.

At the moment I can only hope that someone who knows more about that stuff than me figures out what is happening here. Otherwise I'll have to make multiple Linux builds for the release and the user has to try which one works.. Not a good solution but definitly better than having no builds for Linux.

Nikos-Prinios commented 7 years ago

Hello, Archlinux here (manjaro). Couldn't succeed in installing anaconda. As I don't know how to chanel Cython compilation to python 3.5, Animation Nodes compiled using 3.6. No error reported.

Now, I have two Blender installations, both 1.78c : 1 - using the conventional repository installation method 2- no specific installation, just downloaded and unzipped the folder

My python 3.6 build, Cython branch from Graphicall and GottfriedHofmann's build all return the same error messages : Installation 1 : numpy error installation 2 : general exception error ("this build does not work at the moment")

Hope this helps

aliasguru commented 7 years ago

my numpy installation for Python3.5.2 - which I use to compile AN - was at a version different than the one in Blender, and also not the latest one. Still, even though first updating numpy to 1.12.1, and then downgrading it to 1.10.1 (which is the version used in Blender atm), I get the same error on Add-on activation. Am clueless as of what to try next.

JacquesLucke commented 7 years ago

@aliasguru, did one of the two linux builds from graphicall.org work for you?

http://graphicall.org/1207 http://graphicall.org/1205

aliasguru commented 7 years ago

@JacquesLucke Now this is really interesting:

http://graphicall.org/1207 works fine for me http://graphicall.org/1205 gives me the exact same error I get when compiling myself

JacquesLucke commented 7 years ago

Will close this for now. If someone notices problems again, please open another issue.

niemeyer commented 7 years ago

The underlying issue here is that some Python builds have WANT_SIGFPE_HANDLER defined and expose the fpectl module, and some do not. Then, because Cython-generated files make use of the FPE macros, the generated shared objects will be incompatible if the Python building the add-on has the macros defined but the Python running in Blender does not.

This wouldn't be an issue wasn't for the fact that the implementation strips the symbols altogether, instead of simply disabling the functionality. Unfortunate, to say the least.

There are multiple workarounds:

  1. Make sure the Python used to build animation_nodes does not have the macros defined.
  2. Forcibly disable the macro or strip them so that by the time Cython builds the shared libraries it doesn't depend on the symbols.
  3. Hack the runtime so that the symbols are loaded from a dummy shared object.

The third workaround can be done with something like this in hack.c:

#include <setjmp.h>

double PyFPE_dummy(void *foo) { return 0; }
jmp_buf PyFPE_jbuf;
int PyFPE_counter;

Then run:

$ gcc -Wall -fPIC -shared -o hack.so hack.c

Then open Blender, go to the Python console, and type:

import ctypes
lib = ctypes.CDLL("/path/to/hack.so", ctypes.RTLD_GLOBAL)

After that the addon will load fine. These lines may be added to the initialization file in the addon as a temporary workaround that will survive restarts.

If all else fails or it sounds too convoluted, just get both Blender and the add-on from the same source and it will work fine. For example, just ask @JacquesLucke for which Blender build he's using and install the officially released versions of the plugin, or install Blender from a Linux distribution and build the addon inside the distribution itself.

JacquesLucke commented 6 years ago

Thank you very much for that in-depth answer! I'll definitely try that when I have a bit more time again. The new semester just started and I have to do a lot for university...