Opened 3 years ago

Closed 3 years ago

#61326 closed defect (fixed)

py-pytorch: Symbol not found: __ZdlPvSt11align_val_t

Reported by: chrstphrchvz (Christopher Chavez) Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: mascguy (Christopher Nielsen)
Port: py-pytorch

Description

On macOS 10.12, pytorch can't be imported, as currently observed in the build logs for pyXX-torchvision:

Traceback (most recent call last):
  File "setup.py", line 13, in <module>
    import torch
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/__init__.py", line 189, in <module>
    from torch._C import *
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/_C.cpython-36m-darwin.so, 2): Symbol not found: __ZdlPvSt11align_val_t
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/lib/libtorch_python.dylib
  Expected in: /usr/lib/libc++.1.dylib
 in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/lib/libtorch_python.dylib

From searching online, this has to do with std::uncaught_exceptions() not being found in libc++.

Change History (12)

comment:1 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:2 Changed 3 years ago by mascguy (Christopher Nielsen)

While he's not listed in the portfile, my understanding is that cjones051073 is the py-pytorch maintainer. Go ahead and assign this ticket to him.

comment:3 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Owner: set to cjones051073
Status: newassigned

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

LLVM folks, is this a limitation of the host libc++, or... ?

comment:5 Changed 3 years ago by mascguy (Christopher Nielsen)

Can anyone speak to this issue? Is it a limitation of the host libc++, an unpatched issue in the MacPorts-provided tool chain, ...?

comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)

KenC/anyone, can you speak to whether this is a host libcc++ issue, and/or something that needs to be corrected in the MacPorts-provided toolchain...?

comment:7 Changed 3 years ago by kencu (Ken)

looks like the host libc++ doesn't have the desired symbol.

options would be to either not use that symbol (build configuration, source patch) or try using a newer libc++ like macports-libcxx

comment:8 Changed 3 years ago by cjones051073 (Chris Jones)

Sorry, missed this until now...

Another option is to use the standard 'emulation' of std::uncaught_exceptions() with ( std::uncaught_exception() ? 1 : 0 )

Also it might be an option to add this to legacy support....

comment:9 Changed 3 years ago by cjones051073 (Chris Jones)

Hmmm.. cannot reproduce on my 10.12 VM (using python 3.9 as 3.6 support has since been removed)

Also seems like last build attempt on 10.12 was OK

https://ports.macports.org/port/py39-torchvision/builds

comment:10 in reply to:  9 Changed 3 years ago by mascguy (Christopher Nielsen)

Replying to cjones051073:

Hmmm.. cannot reproduce on my 10.12 VM (using python 3.9 as 3.6 support has since been removed)

Also seems like last build attempt on 10.12 was OK

https://ports.macports.org/port/py39-torchvision/builds

That's good news!

@ChristopherChavez, are you still encountering this issue with 3.7, 3.8, or 3.9?

comment:11 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

I reported this on behalf of builders. I personally do not use this port nor macOS 10.12.

comment:12 Changed 3 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.