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

USD 22.08 - build_usd.py can't find x86_64 symbols #1979

Closed
bread24 opened this issue Aug 2, 2022 · 13 comments
Closed

USD 22.08 - build_usd.py can't find x86_64 symbols #1979

bread24 opened this issue Aug 2, 2022 · 13 comments

Comments

@bread24
Copy link

bread24 commented Aug 2, 2022

Description of Issue

I have a M1 Macbook pro and after following the instructions on #1736. I downloaded USD repo v22.08 and I'm getting the following error.

ERROR: Failed to run 'cmake --build . --config Release --target install -- -j10'

I have also attached the log.txt file on this issue.

Steps to Reproduce

  1. In the terminal I ran python3 build_usd.py /Users/benread/Documents/USD

System Information (OS, Hardware)

CPU: Apple M1 Max
OS: MacOS Monterey version 12.5
Python version: 3.10.5

Package Versions

Build Flags

log.txt

@sunyab
Copy link
Contributor

sunyab commented Aug 2, 2022

Hi @bread24, what version of CMake are you using? I've run into a similar error in the past and it was because I was using an older version of CMake that was built for x86_64. I'd recommend trying a CMake version that ships as a MacOS universal binary -- I'm currently using v3.19.5.

@bread24
Copy link
Author

bread24 commented Aug 2, 2022

Hi @sunyab

I'm currently using cmake version 3.22.5

I'm downloading 3.24 to see if that makes a difference. Made no difference

@sunyab
Copy link
Contributor

sunyab commented Aug 2, 2022

And just to double check, does running arch in your shell give you arm64?

@bread24
Copy link
Author

bread24 commented Aug 2, 2022

yeah, it shows arm64

@bread24
Copy link
Author

bread24 commented Aug 3, 2022

I ran python3 build_usd.py /Users/benread/Documents/USD with sudo at the beginning incase it was a weird permission error, but I still get the same error as before

@sunyab
Copy link
Contributor

sunyab commented Aug 3, 2022

I'm not sure what's going on here. Did you download cmake from the official web site, or was it installed through some other package manager? What do you get if you run

file `which cmake`

@bread24
Copy link
Author

bread24 commented Aug 3, 2022

I did pip3 install cmake to start off with and after running file `which cmake`

I get /Library/Frameworks/Python.framework/Versions/2.7/bin/cmake: a /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python script text executable, ASCII text

and

when I use pip install cmake I get the following:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Requirement already satisfied: cmake in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (3.22.5)

@meshula
Copy link
Member

meshula commented Aug 4, 2022

That might be a good clue as to how things are getting confused. Your log shows that the build is versus python3.10, e.g., I see this in a few places -

/Library/Frameworks/Python.framework/Versions/3.10/bin/python3

but which cmake is pointing into python 2.7. It's more than likely that cmake in it's smartness is discovering that it has a sibling python executable in the same bin folder, and things might be going wrong from there.

I would start by uninstalling that cmake, and ensuring that the python you want to use is discoverable in your path, and that the legacy python 2.7 is not discoverable in your path. i.e. ensure this path /Library/Frameworks/Python.framework/Versions/2.7/bin is not in your $PATH at all.

I'd recommend installing cmake from the "official" installer on cmake.org, and DO add the path to the bin within the resulting installation to your $PATH to make it command line accessible.

@creijon
Copy link
Contributor

creijon commented Aug 4, 2022

Hi @bread24, the diagnosis from @meshula should help you out. When we were adding the AS native support we always used Cmake installers from cmake.org, rather than through pip.

@bread24
Copy link
Author

bread24 commented Aug 4, 2022

Thanks for all the assistance so far but I think I've done something wrong. It's now telling me it can't find ld: symbol(s) not found for architecture arm64

I removed the Python 2.7 path in my ~/.zprofile file and added the directory for cmake-3.23.3 which I downloaded the macOS 10.13 or later version from https://cmake.org/download/

Screen Shot 2022-08-04 at 12 27 29 pm

USD_log.txt

@dpmacri
Copy link

dpmacri commented Aug 4, 2022

How did you build/install OpenSubdiv? The problem appears to be that it was built for x86_64 but you're building USD for arm64. From the log:

ld: warning: ignoring file /Users/benread/Documents/USD/lib/libosdCPU.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /Users/benread/Documents/USD/lib/libosdGPU.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

@bread24
Copy link
Author

bread24 commented Aug 4, 2022

@dpmacri I'm pretty sure it got build as part of the build_usd.py script. I deleted the old build directory and now it built correctly. Thanks for everyone's help.

Success! To use USD, please ensure that you have:

    The following in your PYTHONPATH environment variable:
    /Users/benread/Documents/USD/lib/python

    The following in your PATH environment variable:
    /Users/benread/Documents/USD/bin

@bread24
Copy link
Author

bread24 commented Aug 4, 2022

Closing the issue as it's working now

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

5 participants