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

usdview executable not built when using build_scripts/build_usd.py on Mac OS #230

Closed
CreateTheImaginable opened this issue Jun 23, 2017 · 13 comments

Comments

@CreateTheImaginable
Copy link

Description of Issue

When building the "dev" branch using the python build script build_usd.py, the executable usdview is not built on MacOS

Steps to Reproduce

  1. Install Pyside using https://www.macports.org as the build script recommends ( port install py27-pyside-tools ).

  2. git clone https://github.com/PixarAnimationStudios/USD

  3. cd USD

  4. git checkout dev

  5. cd ..

  6. python USD/build_scripts/build_usd.py -v $HOME/Projects/Pixar/BUILD/USD

When the build completes successfully, usdview is not built and also usdview does not exist in the bin directory with the other tools ( i.e. usdcat, usddiff, usdedit, etc )

System Information (OS, Hardware)

MacOS 10.12.5 using Xcode 8.3.3, Mac Pro ( 2013 )

Package Versions

usd - dev branch v0.7.5

Build Flags

No special build flags

@sunyab
Copy link
Contributor

sunyab commented Jun 23, 2017

I think this is similar to issue #225 -- is pyside-uic (or pyside-uic-2.7) available in your PATH? Installing Pyside via MacPorts should put pyside-uic-2.7 in /opt/local/bin by default, so adding that to your PATH should get usdview building.

@jtran56
Copy link

jtran56 commented Jun 23, 2017

Filed as internal issue #147963.

@CreateTheImaginable
Copy link
Author

@sunyab thanks for your work on this build script - /opt/local/bin/pyside-uic-2.7 is in my path and looks like the build script is finding it, I am getting another error...

I turned on verbose level 3 -v -v -v and I get the following...

-- Found PySide: with /opt/local/bin/python2.7, will use /opt/local/bin/pyside-uic-2.7 for pyside-uic binary
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named OpenGL
-- C++ namespace configured to (external) pxr, (internal) pxrInternal_v0_7
-- Skipping validation of gf generated code because PXR_VALIDATE_GENERATED_CODE=OFF
-- Skipping validation of sdf generated code because PXR_VALIDATE_GENERATED_CODE=OFF
CMake Warning at pxr/usd/lib/usd/CMakeLists.txt:126 (message):
Skipping building usdGenSchema due to missing dependency: Jinja2

-- Skipping alembic-based usddiff tests because PXR_BUILD_ALEMBIC_PLUGIN=OFF
CMake Warning at pxr/usdImaging/lib/usdviewq/CMakeLists.txt:8 (message):
Not building usdviewq because of missing dependency: PyOpenGL

CMake Warning at pxr/usdImaging/bin/usdview/CMakeLists.txt:5 (message):
Not building usdview because of missing dependency: usdviewq

Earlier in the build output I get this for OpenGL...

STATUS: Installing PyOpenGL...
STATUS: Installing PyOpenGL...
INFO: Running "pip install PyOpenGL"
Requirement already satisfied: PyOpenGL in /Library/Python/2.7/site-packages
STATUS: Installing USD...

@meshula
Copy link
Member

meshula commented Jun 25, 2017

/opt/local/bin/python2.7 is a MacPorts build of Python, and /Library/Python/2.7/ is for the os supplied system python. cmake is trying to cross-wire them together.

@sunyab The reason I used homebrew to install PySide was that it uses system Python. I'm not sure if MacPorts also has a way to prefer system python? Having two pythons in the path can be a bit spooky.

(A bit spooky means that both pythons can start to see bits of each other if you start to mess with $PATH and $PYTHON_PATH to resolve issues like this one with PyOpenGL, and ultimately you can run into dynamic linking problems)

@CreateTheImaginable
Copy link
Author

CreateTheImaginable commented Jun 25, 2017

@sunyab @meshula - Yes there are two pythons...

/usr/bin/python2.7 Apple's python
/opt/local/bin/python installed by MacPorts

MacPorts also creates a .profile file to put its python first in the system PATH

# MacPorts Installer addition on 2017-06-22_at_02:51:22: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.

So to run the build_usd.py script I need to use:

/usr/bin/python2.7 USD/build_scripts/build_usd.py -v -v -v $HOME/Projects/Pixar/BUILD/USD

If I try to use MacPorts /opt/local/bin/python which is now first in the system path to run the build_usd.py script I get an SSL error when downloading the zlib dependency

python USD/build_scripts/build_usd.py -v -v -v $HOME/Projects/Pixar/BUILD/USD

STATUS: Installing zlib...
INFO: Downloading https://github.com/madler/zlib/archive/v1.2.11.zip to /Users/wilhoitm/Projects/Pixar/BUILD/USD/src/v1.2.11.zip
ERROR: Failed to download https://github.com/madler/zlib/archive/v1.2.11.zip: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>

@meshula
Copy link
Member

meshula commented Jun 26, 2017

I definitely feel like the right answer is not to let MacPorts install its own Python, if that's an option. The macports version of SSL also has issues, so having /opt/local/bin and sbin in the path can be problematic.

@sunyab
Copy link
Contributor

sunyab commented Jun 26, 2017

@CreateTheImaginable - sorry you're running into these issues! Do you get the urlopen error if you rerun the build script using MacPorts' python? I've seen SSL errors from urlopen before, but they seem to be something server side and usually go away if I run the script again. If that's the case, I need to make the script more resilient to those errors.

From your earlier post, my guess is that the build script used system python/pip to install PyOpenGL but then used MacPorts' python to build USD, which couldn't find PyOpenGL in its site-packages. I think if pip was installed from MacPorts as well well via:

port install py27-pip
port select --set pip pip27

the build script would do the right thing -- it would find MacPorts' pip via $PATH and use it to install PyOpenGL in MacPorts' site-packages.

Ideally, the build script should at least warn users about this problem, though I'm not 100% sure how to go about that yet.

@meshula - I don't think MacPorts has an option to use system python -- it seems like it wants to create its own isolated area for packages and dependencies. I had thought brew didn't support installing PySide on MacOS Sierra without some patches to the Qt source code, which we're not at liberty to do -- that's why the script asks users to use MacPorts instead. In theory, we should be able to change that when we're able to move usdview to PySide2/Qt5.

@sunyab
Copy link
Contributor

sunyab commented Jun 26, 2017

Scratch my question about the urlopen SSL errors with MacPorts, I can reproduce those locally and they're different from what I had run into before. I see a bunch of pages about needing to install curl-ca-bundle from MacPorts for other SSL issues, and I wonder if that would help.

@meshula
Copy link
Member

meshula commented Jun 27, 2017

@sunyab - the brew version of PyQt definitely doesn't work out of the box as you note.

I've been using cartr's patched version, which gets installed such that system Python can see it. I'm careful not to let brew spider in any other dependencies though.

brew install cartr/qt4/qt
brew install cartr/qt4/pyside
brew install cartr/qt4/pyside-tools

@CreateTheImaginable
Copy link
Author

CreateTheImaginable commented Jun 27, 2017

@sunyab @meshula - That worked like a charm using Apple's default python! I now have usdview running on MacOS!

I uninstalled MacPorts using these instructions - https://guide.macports.org/chunked/installing.macports.uninstalling.html

Did the git set up

cd $HOME
mkdir Projects
cd Projects
mkdir Pixar
cd Pixar
git clone https://github.com/PixarAnimationStudios/USD
cd USD
git checkout dev
cd ..

I then did brew install of qt4 & pyside

brew install cartr/qt4/qt
brew install cartr/qt4/pyside
brew install cartr/qt4/pyside-tools

Set my PYTHONPATH environment variable

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages

Ran the build_usd.py build script

python USD/build_scripts/build_usd.py -v -v -v $HOME/Projects/Pixar/BUILD/USD

Set up Env variables

export PYTHONPATH=$PYTHONPATH:$HOME/Projects/Pixar/BUILD/USD/lib/python
export PATH=$PATH:$HOME/Projects/Pixar/BUILD/USD/bin

And it works! :-)

usdview ./USD/extras/usd/tutorials/convertingLayerFormats/Sphere.usda

@meshula
Copy link
Member

meshula commented Jun 28, 2017

@CreateTheImaginable I've documented the homebrew variant on the build-club wiki, thanks for posting your steps. https://github.com/vfxpro99/usd-build-club/wiki/USD-on-macOS

@carmandale
Copy link

I get this error when I try to build...

Traceback (most recent call last):
File "USD/build_scripts/build_usd.py", line 1674, in
import maya
ImportError: No module named maya
ERROR: CMake not found -- please install it and adjust your PATH

I don't use Maya. Can I do the build without it?

thanks,
Dale

@johndpope
Copy link

@carmandale brew install cmake

AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
…/feature/ios

[OGSMOD-2797] Fix build error for iOS target. Step 1/2, sync code and fix conflict
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