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

Installation error on MacOs: wrong architecture is built #243

Open
fjarri opened this issue Sep 16, 2018 · 6 comments
Open

Installation error on MacOs: wrong architecture is built #243

fjarri opened this issue Sep 16, 2018 · 6 comments

Comments

@fjarri
Copy link
Contributor

fjarri commented Sep 16, 2018

The new pybind11 version does not install properly on MacOs 10.13.6. During the compilation the linker produces several warnings:

ld: warning: ld: warning: ignoring file build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl.oignoring file build/temp.macosx-10.13-x86_64-3.6/src/wrap_constants.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/wrap_constants.o
ld: warning: ignoring file build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl_part_1.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl_part_1.o
ld: warning: ignoring file build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl_part_2.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/wrap_cl_part_2.o
ld: warning: ignoring file build/temp.macosx-10.13-x86_64-3.6/src/wrap_mempool.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/wrap_mempool.o
ld: warning: ignoring file build/temp.macosx-10.13-x86_64-3.6/src/bitlog.o, file was built for x86_64 which is not the architecture being linked (i386): build/temp.macosx-10.13-x86_64-3.6/src/bitlog.o
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks//OpenCL.framework/OpenCL.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (i386): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks//OpenCL.framework/OpenCL.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (i386): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libSystem.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libc++.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (i386): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libc++.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks//OpenCL.framework/OpenCL.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks//OpenCL.framework/OpenCL.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libc++.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libc++.tbd
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib/libSystem.tbd

The installation succeeds despite that, but the module cannot be imported:

>>> import pyopencl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bogdan/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pyopencl/__init__.py", line 37, in <module>
    import pyopencl._cl as _cl
ImportError: dlopen(/Users/bogdan/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pyopencl/_cl.cpython-36m-darwin.so, 2): Symbol not found: _clBuildProgram
  Referenced from: /Users/bogdan/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pyopencl/_cl.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/bogdan/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pyopencl/_cl.cpython-36m-darwin.so
@inducer
Copy link
Owner

inducer commented Sep 16, 2018

That is weird. Are you sure that that is not something to do with your environment? The pybind11 version passes CI on an Apple machine for me:

https://gitlab.tiker.net/inducer/pyopencl/-/jobs/62183

@fjarri
Copy link
Contributor Author

fjarri commented Sep 16, 2018

It may be my environment, the question is whether it is something the installation script should detect, or something I should fix. Do you have any ideas on how I can debug it?

On a side note, perhaps this ld warning should actually be an error.

@inducer
Copy link
Owner

inducer commented Sep 16, 2018

It seems to be trying to build a 32-bit binary. Any clue why it would try to do that?

Could you post a link to the full build log, including the compiler/linker invocations?

@fjarri
Copy link
Contributor Author

fjarri commented Sep 16, 2018

No idea, the previous PyOpenCL versions do not seem to have this problem (with the same environment). The build log is here: https://gist.github.com/fjarri/70a44c9dafc7f8cbdf6524eb9f02f6c6

@inducer
Copy link
Owner

inducer commented Sep 16, 2018

Could you try this branch?

https://gitlab.tiker.net/inducer/pyopencl/merge_requests/48

@fjarri
Copy link
Contributor Author

fjarri commented Sep 17, 2018

The branch by itself does not help. But I've done some more googling, and it seems that the problem lies in the most recent XCode version (starting from either 9.3 or 9.4). I am not sure how to fix the build for them, but switching to XCode 9.2 plus using the branch makes everything build successfully.

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

2 participants