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 build on linux centos 7 fails #1162

Closed
wolzjohannes opened this issue Apr 12, 2020 · 23 comments
Closed

USD build on linux centos 7 fails #1162

wolzjohannes opened this issue Apr 12, 2020 · 23 comments

Comments

@wolzjohannes
Copy link

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
Copy link
Member

meshula commented Apr 13, 2020

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
Copy link
Author

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
Copy link

Filed as internal issue #USD-5983

@wolzjohannes
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

sunyab commented Apr 20, 2020

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

@wolzjohannes
Copy link
Author

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
Copy link
Contributor

sunyab commented Apr 20, 2020

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

@wolzjohannes
Copy link
Author

wolzjohannes commented Apr 20, 2020

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
Copy link
Author

wolzjohannes commented Apr 20, 2020

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
Copy link
Member

meshula commented Apr 20, 2020

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
Copy link
Author

wolzjohannes commented Apr 21, 2020

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
Copy link
Member

meshula commented May 27, 2020

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
Copy link
Author

wolzjohannes commented May 31, 2020

@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
Copy link
Member

meshula commented May 31, 2020

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
Copy link
Author

Thank you so much will give it a try

@wolzjohannes
Copy link
Author

wolzjohannes commented Jun 21, 2020

@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
Copy link
Author

wolzjohannes commented Jun 21, 2020

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

sunyab commented Sep 1, 2020

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.

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

4 participants