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

[ build_usd.py ] /bin/ld: cannot find -lGL #578

Closed
Jewel-A opened this issue Aug 4, 2018 · 3 comments
Closed

[ build_usd.py ] /bin/ld: cannot find -lGL #578

Jewel-A opened this issue Aug 4, 2018 · 3 comments

Comments

@Jewel-A
Copy link

Jewel-A commented Aug 4, 2018

Description of Issue

Hi!
I am trying to compile USD with build_usd.py.
I have an essue with "Installing GLEW" step all the time.
Also I did pip install PyOpenGL PyOpenGL_accelerate but it wasn't help to install USD with build_usd.py.

Cmake doesn't help too.
Result: CMake Error at cmake/modules/FindOpenEXR.cmake.

How to fix it?
Please Help

Thank you in advance

Steps to Reproduce (with build_usd.py)

  1. Run from root:
    sudo python USD/build_scripts/build_usd.py --alembic --ptex --hdf5 --python --usd-imaging --docs --tests /usr/local/USD

  2. Result:

  ...
  CMake generator               Default
  Downloader                    curl

  Building                      Shared libraries
    Imaging                     On
      Ptex support:             On
    UsdImaging                  On
    Python support              On
    Documentation               On
    Tests                       On
    Alembic Plugin              On
      HDF5 support:             On
    Maya Plugin                 Off
    Katana Plugin               Off
    Houdini Plugin              Off

    Dependencies                boost, TBB, HDF5, OpenEXR, Alembic, Ptex, JPEG, TIFF, PNG, GLEW, OpenImageIO, OpenSubdiv

STATUS: Installing boost...
STATUS: Installing TBB...
STATUS: Installing HDF5...
STATUS: Installing OpenEXR...
STATUS: Installing Alembic...
STATUS: Installing Ptex...
STATUS: Installing JPEG...
STATUS: Installing TIFF...
STATUS: Installing PNG...
STATUS: Installing GLEW...
2018-08-04 12:30
make GLEW_DEST="/usr/local/USD" -j56 install
install -d -m 0755 "/usr/local/USD/include/GL"
sed \
	-e "s|@prefix@|/usr|g" \
	-e "s|@libdir@|/usr/local/USD/lib64|g" \
	-e "s|@exec_prefix@|/usr/local/USD/bin|g" \
	-e "s|@includedir@|/usr/local/USD/include/GL|g" \
	-e "s|@version@|2.0.0|g" \
	-e "s|@cflags@||g" \
	-e "s|@libname@|GLEW|g" \
	-e "s|@requireslib@|glu|g" \
	< glew.pc.in > glew.pc
cc -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -fPIC -Wcast-qual -ansi -pedantic -fno-stack-protector  -o tmp/linux/default/shared/glew.o -c src/glew.c
cc -DGLEW_NO_GLU -DGLEW_STATIC -O2 -Wall -W -Iinclude -fPIC -Wcast-qual -ansi -pedantic -fno-stack-protector  -o tmp/linux/default/static/glew.o -c src/glew.c
install -m 0644 include/GL/wglew.h "/usr/local/USD/include/GL/"
install -d -m 0755 "/usr/local/USD/lib/pkgconfig"
install -d -m 0755 "/usr/local/USD/lib/pkgconfig"
install -m 0644 include/GL/glew.h "/usr/local/USD/include/GL/"
install -m 0644 glew.pc "/usr/local/USD/lib/pkgconfig/"
install -m 0644 include/GL/glxew.h "/usr/local/USD/include/GL/"
cc -shared -Wl,-soname=libGLEW.so.2.0 -o lib/libGLEW.so.2.0.0 tmp/linux/default/shared/glew.o -L/usr/X11R6/lib64 -L/usr/lib64 -lGL -lX11 
/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
/bin/ld: skipping incompatible //lib/libGL.so when searching for -lGL
/bin/ld: skipping incompatible //usr/lib/libGL.so when searching for -lGL
/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [lib/libGLEW.so.2.0.0] Error 1
make: *** Waiting for unfinished jobs....

ERROR: Failed to run 'make GLEW_DEST="/usr/local/USD" -j56 install'
See /usr/local/USD/src/glew-2.0.0/log.txt for more details.


Try cmake

  1. cd USD
  2. mkdir build && cd build
  3. make ..
    4 Result:
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   python
--   regex
--   system
-- Found Jinja2
-- Using default system allocator because PXR_MALLOC_LIBRARY is unspecified
CMake Error at cmake/modules/FindOpenEXR.cmake:49 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cmake/defaults/Packages.cmake:106 (find_package)
  CMakeLists.txt:33 (include)


CMake Error at cmake/modules/FindOpenEXR.cmake:55 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  cmake/defaults/Packages.cmake:106 (find_package)
  CMakeLists.txt:33 (include)

-- Found PySide: with /usr/bin/python2.7, will use /usr/bin/pyside-uic for pyside-uic binary
-- Found PyOpenGL
-- C++ namespace configured to (external) pxr, (internal) pxrInternal_v0_8
-- Skipping validation of gf generated code because PXR_VALIDATE_GENERATED_CODE=OFF
-- Skipping validation of sdf generated code because PXR_VALIDATE_GENERATED_CODE=OFF
-- Skipping alembic-based usddiff tests because PXR_BUILD_ALEMBIC_PLUGIN=OFF
-- Enable houdini plugin
-- Configuring incomplete, errors occurred!

System Information (OS, Hardware)

64-bit Centos 7,
Kernel 3.10.0-862.3.3.el7.x86_64,
Gnome 3.22.2,
Nvidia GTX, Driver version 390.67

Package Versions

USD master v0.8.5a (committed on May 22)
USD dev (Latest commit b83807d)

Python 2.7.5
gcc (GCC) 4.8.5 20150623
cmake version 3.11.0
all dependencies, and dependencies of dependencies installed from PIP and YUM

Build Flags

sudo python USD/build_scripts/build_usd.py --alembic --ptex --hdf5 --python --usd-imaging --docs --tests /usr/local/USD

@sunyab
Copy link
Contributor

sunyab commented Aug 10, 2018

Hi @Jewel-A, based on the below error messages, my guess is that you do not have a 64-bit version of libGL installed on your system. Can you check if you've installed the 64-bit version of the OpenGL driver for your graphics card?

/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
/bin/ld: skipping incompatible //lib/libGL.so when searching for -lGL
/bin/ld: skipping incompatible //usr/lib/libGL.so when searching for -lGL
/bin/ld: cannot find -lGL

@Jewel-A
Copy link
Author

Jewel-A commented Aug 11, 2018

Hi @sunyab ,
Thank you for your answer)

I have 64-bit version of Nvidia driver, (from Nvidia website).
I found libGL.so in /usr/lib and /usr/lib64/
Also I check:

$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  390.67  Fri Jun  1 04:04:27 PDT 2018
GCC version:  gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) 

$ glxinfo | grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 390.67

@Jewel-A
Copy link
Author

Jewel-A commented Aug 11, 2018

Maybe it does not search in /usr/lib64, is it posible?

@Jewel-A Jewel-A closed this as completed Aug 24, 2018
AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
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

2 participants