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

IfcOpenShell Architecture error (ARM) #1702

Closed
HeySora opened this issue Aug 27, 2021 · 10 comments
Closed

IfcOpenShell Architecture error (ARM) #1702

HeySora opened this issue Aug 27, 2021 · 10 comments

Comments

@HeySora
Copy link
Contributor

HeySora commented Aug 27, 2021

This happens when trying to enable the BlenderBIM add-on on a M1 Mac, with the (official) ARM/Apple Silicon version of Blender.

The important parts of the error are:
ImportError: IfcOpenShell not built for 'darwin/64bit/python3.9'
/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so: mach-o, but wrong architecture

Running file _ifcopenshell_wrapper.so returns:
_ifcopenshell_wrapper.so: Mach-O 64-bit bundle x86_64

Rosetta 2 is installed on this Mac.

Traceback (most recent call last):
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/ifcopenshell_wrapper.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1108, in create_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
ImportError: dlopen(/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so, 2): no suitable image found.  Did find:
	/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so: mach-o, but wrong architecture
	/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so: mach-o, but wrong architecture

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/__init__.py", line 43, in <module>
    from . import ifcopenshell_wrapper
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/ifcopenshell_wrapper.py", line 17, in <module>
    _ifcopenshell_wrapper = swig_import_helper()
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/ifcopenshell_wrapper.py", line 16, in swig_import_helper
    return importlib.import_module('_ifcopenshell_wrapper')
  File "/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so, 2): no suitable image found.  Did find:
	/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so: mach-o, but wrong architecture
	/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/_ifcopenshell_wrapper.so: mach-o, but wrong architecture

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/__init__.py", line 24, in <module>
    from .bim import *
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/bim/__init__.py", line 9, in <module>
    from . import handler, ui, prop, operator
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/bim/handler.py", line 4, in <module>
    import ifcopenshell.api.owner.settings
  File "/Users/sora/Library/Application Support/Blender/2.93/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/__init__.py", line 51, in <module>
    raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'darwin/64bit/python3.9'
@Moult
Copy link
Contributor

Moult commented Aug 27, 2021

IfcOpenShell doesn't seem to be compiled for arm. You might need to compile it yourself. Ping @aothms ?

@Moult Moult changed the title BlenderBIM: Architecture error (ARM) IfcOpenShell Architecture error (ARM) Aug 27, 2021
@cheshiren
Copy link

Reposting from the OSArch Forum.
The same issue for the M1 version of Blender:
image

@aothms
Copy link
Member

aothms commented Sep 9, 2021

#1402

For the time being you can compile yourself, see nix/build-all.py

@twisker
Copy link

twisker commented Sep 26, 2021

I tried to run the build script today. failed on the first step. it seems the hdf5-1.8.22.tar.gz was incomplete. Anyway, I attacked the log file and the screenshot. anyone can help? thanks
截屏2021-09-26 上午1 44 32
hdf5.log

@aothms
Copy link
Member

aothms commented Sep 27, 2021

@twisker my guess is that the HDF5 build simply doesn't succeed. You can try running it manually and see the output https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/nix/build-all.py#L415 or check what's in the hdf5.log file in ./IfcOpenShell/build/.../build/hdf5/build/hdf5.log (I think)

I guess you can also just try the IfcOpenShell 0.6 branch which does not depend on hdf5 yet.

@twisker
Copy link

twisker commented Sep 28, 2021

@twisker my guess is that the HDF5 build simply doesn't succeed. You can try running it manually and see the output https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/nix/build-all.py#L415 or check what's in the hdf5.log file in ./IfcOpenShell/build/.../build/hdf5/build/hdf5.log (I think)

I guess you can also just try the IfcOpenShell 0.6 branch which does not depend on hdf5 yet.

Thank you @aothms . I will try it later.

@benjamindahl
Copy link
Contributor

benjamindahl commented Jan 12, 2022

I tried to build it myself, but it failed.

see issue #1975

@Moult
Copy link
Contributor

Moult commented Sep 4, 2022

@HeySora @cheshiren @twisker @benjamindahl hey all! Great news! We're doing a fundraiser to try and raise 70USD per month (unfortunately yes, a recurring payment, not a one-off) to afford an Apple M1 buildserver which will provide regular builds for Apple M1 devices! If you're still keen, perhaps you can help us out maybe for the price of a cup of coffee or two per month?

Details are here: https://opencollective.com/opensourcebim/projects/apple-m1-build-server - looking forward to when we can provide this with your help!

@Moult
Copy link
Contributor

Moult commented Sep 18, 2022

We're still a little short of recurring funds to sustain building this in the long term, so donations are still very welcome, but there are now Apple M1 builds for both IfcOpenShell and the BlenderBIM Add-on! Closing bug :)

@Moult Moult closed this as completed Sep 18, 2022
@benjamindahl
Copy link
Contributor

us out maybe for the price of a cup of coffee or two per month?

I'll try.

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

6 participants