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

No make file generated from cmake on OSX? Any tips on building the xcodeproj file? #50

Closed
pkanyuk opened this issue Sep 12, 2016 · 8 comments

Comments

@pkanyuk
Copy link

pkanyuk commented Sep 12, 2016

Hi USD Wizards,

I'm trying to build USD on OSX and have been following the instructions at https://github.com/PixarAnimationStudios/USD. After hunting down the required libraries, I managed to get cmake mostly error free and completing with the comforting line:

-- Generating done
-- Build files have been written to: /Users/pkanyuk/USD/build

However, there are no Makefiles in the build directory, which makes running the command specified in the docs: make -j <NUM_CORES> install, impossible. I take it that may be a copy-paste typo and the intention is to build the resulting usd.xcodeproj project. I attempted to do that with:

/usr/bin/xcodebuild -target install

But this failed due to glPlatformContextDarwin.h not being in build/include/pxr/imaging/garch. Fine, I copied it over, but then I got the build error:

/Users/pkanyuk/USD/pxr/imaging/lib/garch/glPlatformContextGLX.cpp:27:10: fatal error: 'boost/functional/hash.hpp' file not found

I do have boost installed, and the relevant file is at /usr/local/include/boost/functional/hash.hpp, but sure enough the compile command did not have a -I argument with boost. That leads me to believe either CMake failed to configure the xcodeproj file correctly, or there really is a Makefile that's missing, and I'm going down a dangerous path. Any tips?

Thanks!
-- Paul

@asluk
Copy link
Collaborator

asluk commented Sep 12, 2016

Hi Paul,

I think those are problems when X11 is present in OSX, and those have been
fixed in the dev branch, but not yet in master. Can you try dev? It works
for me in Xcode, though I haven't tried a command line build.

-a.

Am Sonntag, 11. September 2016 schrieb pkanyuk :

Hi USD Wizards,

I'm trying to build USD on OSX and have been following the instructions at
https://github.com/PixarAnimationStudios/USD. After hunting down the
required libraries, I managed to get cmake mostly error free and completing
with the comforting line:

-- Generating done
-- Build files have been written to: /Users/pkanyuk/USD/build

However, there are no Makefiles in the build directory, which makes
running the command specified in the docs: make -j install, impossible. I
take it that may be a copy-paste typo and the intention is to build the
resulting usd.xcodeproj project. I attempted to do that with:

/usr/bin/xcodebuild -target install

But this failed due to glPlatformContextDarwin.h not being in
build/include/pxr/imaging/garch. Fine, I copied it over, but then I got
the build error:

/Users/pkanyuk/USD/pxr/imaging/lib/garch/glPlatformContextGLX.cpp:27:10:
fatal error: 'boost/functional/hash.hpp' file not found

I do have boost installed, and the relevant file is at
/usr/local/include/boost/functional/hash.hpp, but sure enough the compile
command did not have a -I argument with boost. That leads me to believe
either CMake failed to configure the xcodeproj file correctly, or there
really is a Makefile that's missing, and I'm going down a dangerous path.
Any tips?

Thanks!
-- Paul


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#50, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AB_7ZiDjmVqbBQ9nhjTe-EO0qogVtPZeks5qpKcCgaJpZM4J6KGG
.

@pkanyuk
Copy link
Author

pkanyuk commented Sep 12, 2016

Hi Aaron,

Good to hear from you! Sure enough, running cmake on the dev branch allows the xcodeproj build to succeed. Unfortunately the recommended steps for testing the build don't appear to work:

export PYTHONPATH=$PYTHONPATH:USD_INSTALL_ROOT/lib/python
usdview extras/usd/tutorials/convertingLayerFormats/sphere.usda

There is no USD_INSTALL_ROOT environment variable defined and poking around I don't see a lib/python in the build directory. That being said, Wave said he can show my some tricks to get his working, I'll find out more tomorrow.

Thanks!
-- Paul

@jtran56
Copy link

jtran56 commented Sep 12, 2016

Filed as internal issue #137181.

@davvid
Copy link
Contributor

davvid commented Sep 30, 2016

@pkanyuk on OS X cmake defaults to Xcode mode. Not sure if this helps, but you can specify the generator to cmake so that it outputs unix makefiles on OS X. You might have better luck with this approach since it's closer to how it's done on Linux.

$ cmake -G 'Unix Makefiles' ...

@meshula
Copy link
Member

meshula commented Oct 1, 2016

@pkanyuk When the instructions say USD_INSTALL_ROOT, they just mean you need to supply it. In my build, that would be

export PYTHONPATH=$PYTHONPATH:~/Projects/usd/stage/local/lib/python

To run usdview you'll also probably need to specify the

--renderer simple
switch.

I personally build using Xcode because the build parallelizes better than make, so it completes much quicker.

I configure Xcode as follows - substitute SOURCEDIR and BUILDDIR appropriately.

  cmake ${SOURCEDIR} \
      -DCMAKE_INSTALL_PREFIX=${BUILDDIR} \
      -DCMAKE_PREFIX_PATH=${BUILDDIR} \
      -DALEMBIC_DIR=${BUILDDIR} \ 
      -DDOUBLE_CONVERSION_DIR=${BUILDDIR} \ 
      -DGLEW_LOCATION=${BUILDDIR} \ 
      -DOIIO_LOCATION=${BUILDDIR} \ 
      -DOPENEXR_ROOT_DIR=${BUILDDIR} \
      -DOPENSUBDIV_ROOT_DIR=${BUILDDIR} \
      -DQT_USE_FRAMEWORKS=0 \
      -DQT_ROOT_DIR=${BUILDDIR} \
      -DPTEX_LOCATION=${BUILDDIR} \
      -DTBB_ROOT_DIR=${BUILDDIR} \
      -DBoost_INCLUDE_DIR=${BUILDDIR}/include -DBoost_LIBRARY_DIR=${BUILDDIR}/lib \
      -G Xcode

then, to build from the command line, I use

cmake --build . --target install --config Release -- /maxcpucount:8

@pkanyuk
Copy link
Author

pkanyuk commented Oct 3, 2016

Hi Nick and David,

Gotcha, thanks for the tips! I ended up getting help from a co-worker that
showed me some steps from the "USD build club", that got me up and running
with a build that could at least read/write USD files. At some point in
the near future, I may be trying to add a new schema for representing
skeletons in USD in which case I'll be revisiting some of these issues.
Sounds like a ton is in flux ride now though, so I'm taking a step back
till the smoke clears :)

Thanks for the help!
-- Paul

On Fri, Sep 30, 2016 at 10:45 PM, Nick Porcino notifications@github.com
wrote:

@pkanyuk https://github.com/pkanyuk When the instructions say
USD_INSTALL_ROOT, they just mean you need to supply it. In my build, that
would be

export PYTHONPATH=$PYTHONPATH:~/Projects/usd/stage/local/lib/python

To run usdview you'll also probably need to specify the

--renderer simple

switch.

I personally build using Xcode because the build parallelizes better than
make, so it completes much quicker.

I configure Xcode as follows - substitute SOURCEDIR and BUILDDIR
appropriately.

cmake ${SOURCEDIR}
-DCMAKE_INSTALL_PREFIX=${BUILDDIR}
-DCMAKE_PREFIX_PATH=${BUILDDIR}
-DALEMBIC_DIR=${BUILDDIR}
-DDOUBLE_CONVERSION_DIR=${BUILDDIR}
-DGLEW_LOCATION=${BUILDDIR}
-DOIIO_LOCATION=${BUILDDIR}
-DOPENEXR_ROOT_DIR=${BUILDDIR}
-DOPENSUBDIV_ROOT_DIR=${BUILDDIR}
-DQT_USE_FRAMEWORKS=0
-DQT_ROOT_DIR=${BUILDDIR}
-DPTEX_LOCATION=${BUILDDIR}
-DTBB_ROOT_DIR=${BUILDDIR}
-DBoost_INCLUDE_DIR=${BUILDDIR}/include -DBoost_LIBRARY_DIR=${BUILDDIR}/lib

-G Xcode

then, to build from the command line, I use

cmake --build . --target install --config Release -- /maxcpucount:8


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACEpC_A3LwLraHzdO9hGfgRAzAh4VX64ks5qvfOCgaJpZM4J6KGG
.

@meshula
Copy link
Member

meshula commented Oct 3, 2016

Skeletons in USD would be AWESOME, and also seasonally appropriate.

@sunyab
Copy link
Contributor

sunyab commented Feb 10, 2017

I think Paul's all set here so I'm going to close this out. We're still very much in-progress on getting the Mac port released. When that happens, we hope to make simpler/clearer build instructions for the Mac available (and for Linux and Windows as well, for that matter).

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