PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.51k stars 1.14k forks source link

USD build on linux centos 7 fails #1162

Closed wolzjohannes closed 3 years ago

wolzjohannes commented 4 years ago

Description of Issue

USD build fails on centos 7 linux via python virtual env.

Steps to Reproduce

  1. Activate Python virtual env with all usd python dependencies.
  2. Clone USD repo
  3. python USD/build_scripts/build_usd.py /usr/local/USD

System Information (OS, Hardware)

OS: Linux centos 7 64-bit Prozessor: Intel® Core™ i5-8265U CPU @ 1.60GHz × 8 Grafik: Intel® HD Graphics (Whiskey Lake 3x8 GT2) Gnome: Version 3.28.2

Package Versions

Latest.

Build Flags

gmake[2]: [pxr/base/tf/libtf.so] Fehler 1 gmake[1]: [pxr/base/tf/CMakeFiles/tf.dir/all] Fehler 2 gmake: *** [all] Fehler 2

ERROR: Failed to run 'cmake --build . --config Release --target install -- -j8' See /usr/local/USD/build/USD/log.txt for more details. (usd_python_env) [johanneswolz@localhost Development]$

log.txt

meshula commented 4 years ago

The problem is that the virtualenv needs position independent code, but according to the log.txt, your python was not compiled with -fPIC. That is symptomatic of more than one possible cause. You might find some useful clues for troubleshooting here:

https://stackoverflow.com/questions/42582712/relocation-r-x86-64-32s-against-py-notimplementedstruct-can-not-be-used-when

wolzjohannes commented 4 years ago

The problem is that the virtualenv needs position independent code, but according to the log.txt, your python was not compiled with -fPIC. That is symptomatic of more than one possible cause. You might find some useful clues for troubleshooting here:

https://stackoverflow.com/questions/42582712/relocation-r-x86-64-32s-against-py-notimplementedstruct-can-not-be-used-when

Thx a lot will try it out! Let you if it worked out thx a lot!

jilliene commented 4 years ago

Filed as internal issue #USD-5983

wolzjohannes commented 4 years ago

The problem is that the virtualenv needs position independent code, but according to the log.txt, your python was not compiled with -fPIC. That is symptomatic of more than one possible cause. You might find some useful clues for troubleshooting here:

https://stackoverflow.com/questions/42582712/relocation-r-x86-64-32s-against-py-notimplementedstruct-can-not-be-used-when

Hey guys, iam sorry iam not the best programmer. So i tried to find more information on the internet about recompile python with this flag -fPIC. So i found this https://stackoverflow.com/questions/27883921/how-do-you-recompile-python-in-virtual-env-with-enable-shared https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-centos-7/ Is this helpful?? Can i try to keep everything in a virtual env or i have to go back to my system python? I thought build usd with a linux system python would be normal or everybody has to recompile python with this flag -fPIC before he can use USD. Thanks in advance for your help. Greetings

wolzjohannes commented 4 years ago

Hey guys, so iam hitting the wall! I compiled a python2.7 version with the --enable-share flag and then i created a virtualenv from that compiled python version but i still get the same error message: gmake[2]: [pxr/base/tf/libtf.so] Fehler 1 gmake[1]: [pxr/base/tf/CMakeFiles/tf.dir/all] Fehler 2 gmake: *** [all] Fehler 2

ERROR: Failed to run 'cmake --build . --config Release --target install -- -j8' See /usr/local/USD/build/USD/log.txt for more details.

wolzjohannes commented 4 years ago

So i tried to compile USD with my system python from usr/local and i get the same error: gmake[2]: [pxr/base/tf/libtf.so] Fehler 1 gmake[1]: [pxr/base/tf/CMakeFiles/tf.dir/all] Fehler 2 gmake: *** [all] Fehler 2

ERROR: Failed to run 'cmake --build . --config Release --target install -- -j8' Please can anybody help! log.txt

sunyab commented 4 years ago

Hi @wolzjohannes, you may need to install the python3-devel and python3-libs packages using yum.

wolzjohannes commented 4 years ago

Hi @wolzjohannes, you may need to install the python3-devel and python3-libs packages using yum.

THx a lot will try that! But im using python2.7?

sunyab commented 4 years ago

Oops, sorry -- python-devel and python-libs in that case, I think.

wolzjohannes commented 4 years ago

Oops, sorry -- python-devel and python-libs in that case, I think.

dont worry! :-) THX a lot but was already installed so i dont whats the problem

wolzjohannes commented 4 years ago

Hey Guys so i tried it now with a new virtualenv from a new compiled python3.6.8 now i get this error.

(usd_python_env_2) [johanneswolz@localhost Development]$ python USD/build_scripts/build_usd.py /usr/local/USD File "USD/build_scripts/build_usd.py", line 50 print msg ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(msg)?

So i guess it is because the build script is written in a python version below python3! So i tried almost everything! Is there anybody who was able to get USD work on a linux centos7 machine! And maybe he can give my a tutorial or help how he did it! I would appreciative it so much :-)

meshula commented 4 years ago

I think you need to update your copy of the source code. The current code is Python3 compatible, and line 58 in the new code does have the parenthesis. https://github.com/PixarAnimationStudios/USD/blob/ebac0a8b6703f4fa1c27115f1f013bb9819662f4/build_scripts/build_usd.py#L58

wolzjohannes commented 4 years ago

I think you need to update your copy of the source code. The current code is Python3 compatible, and line 58 in the new code does have the parenthesis.

https://github.com/PixarAnimationStudios/USD/blob/ebac0a8b6703f4fa1c27115f1f013bb9819662f4/build_scripts/build_usd.py#L58

thx a lot! That solved my python build_script problem! But opened another:

ERROR: CMake not found -- please install it and adjust your PATH But i installed cmake: [johanneswolz@localhost Development]$ cmake --version cmake version 3.17.1 And it is in my &PATH: [johanneswolz@localhost Development]$ which cmake /usr/local/bin/cmake [johanneswolz@localhost Development]$ echo $PATH /usr/local/bin

meshula commented 4 years ago

Could you try running the build script again with the -v option, and post your results? Perhaps some clues will be printed explaining why cmake failed detection.

wolzjohannes commented 4 years ago

@meshula Hey you! Thanks for your advice and i tried what you said! But for it still makes no sense! Maybe for you! Here is the error:

gmake: *** [all] Fehler 2

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

And the log file: log.txt

meshula commented 4 years ago

Ah, that's very helpful. Your gcc is 4.8.5 ~ USD requires at least gcc 6.3.1. The versions are documented here: https://github.com/PixarAnimationStudios/USD/blob/master/VERSIONS.md

Here's the line I found in your log.txt:

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5

and the errors that follow, all indicate that the compiler doesn't support the C++ features that USD needs. e.g.:

In file included from /home/johanneswolz/Development/USD/pxr/base/vt/dictionary.cpp:26:0:
/home/johanneswolz/Development/USD/pxr/base/vt/dictionary.h:64:53: Fehler: falsche Anzahl der Templateargumente (0, sollte 1 sein)
     typedef std::map<std::string, VtValue, std::less<>> _Map;
wolzjohannes commented 4 years ago

Thank you so much will give it a try

wolzjohannes commented 3 years ago

@meshula Hey You! Thank you so much for your help. I was able to build it with the new gcc version. usd_build_success

wolzjohannes commented 3 years ago

But now i have another problem :-) I tried to open the usdview to test it but couldnt find the file in the build directory.


Error: Unable to open stage 'extras/usd/tutorials/convertingLayerFormats/Sphere.usda'
File not found```
wolzjohannes commented 3 years ago

But i found out that it exist in another directory:


Error: Unable to open stage 'share/usd/tutorials/convertingLayerFormats/Sphere.usda'
File not found```
wolzjohannes commented 3 years ago

But is not working anyway. When i give usdview the absolute path it works fine: [johanneswolz@localhost ~]$ usdview /home/johanneswolz/Development/usd-build/share/usd/tutorials/convertingLayerFormats/Sphere.usda Has anybody a idea why this happens????

wolzjohannes commented 3 years ago

I build it with this arguments: python USD/build_scripts/build_usd.py /home/johanneswolz/Development/usd-build --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem"

sunyab commented 3 years ago

The path to the sample asset shown in the README.md should be adjusted to read USD/extras/... since the instructions assume you're one level up from the USD directory with the source code. We'll fix this in the next release.