首页 > 解决方案 > 在 Conda 环境中构建时找不到 OpenGL

问题描述

我正在尝试从 conda 环境构建habitat-sim。

没有系统级别的 conda 环境,构建是成功的。但它无法访问 conda 环境中的 OpenGL 库。这是构建日志。

(habitat) vj@vj-TS:~/habitat-sim$ ./build.sh --bullet
    running build_ext
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working C compiler: /home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-cc
    -- Check for working C compiler: /home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-c++
    -- Check for working CXX compiler: /home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- The LIB_SUFFIX variable is not defined. It will be autodetected now.
    -- You can set it manually with -DLIB_SUFFIX=<value> (64 for example).
    -- LIB_SUFFIX autodetected as '', libraries will be installed into /usr/local/lib
    -- Found Git: /usr/bin/git (found version "2.17.1") 
    -- Found Corrade: /home/vj/habitat-sim/src/deps/corrade/src  found components:  Containers rc Utility 
    -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
    -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
    -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Looking for dlfcn.h
    -- Looking for dlfcn.h - found
    -- Looking for execinfo.h
    -- Looking for execinfo.h - found
    -- Looking for glob.h
    -- Looking for glob.h - found
    -- Looking for inttypes.h
    -- Looking for inttypes.h - found
    -- Looking for libunwind.h
    -- Looking for libunwind.h - not found
    -- Looking for memory.h
    -- Looking for memory.h - found
    -- Looking for pwd.h
    -- Looking for pwd.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stdlib.h
    -- Looking for stdlib.h - found
    -- Looking for string.h
    -- Looking for string.h - found
    -- Looking for strings.h
    -- Looking for strings.h - found
    -- Looking for sys/stat.h
    -- Looking for sys/stat.h - found
    -- Looking for sys/syscall.h
    -- Looking for sys/syscall.h - found
    -- Looking for sys/time.h
    -- Looking for sys/time.h - found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for sys/utsname.h
    -- Looking for sys/utsname.h - found
    -- Looking for syscall.h
    -- Looking for syscall.h - found
    -- Looking for syslog.h
    -- Looking for syslog.h - found
    -- Looking for ucontext.h
    -- Looking for ucontext.h - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- Looking for unwind.h
    -- Looking for unwind.h - found
    -- Looking for C++ include ext/hash_map
    -- Looking for C++ include ext/hash_map - found
    -- Looking for C++ include ext/hash_set
    -- Looking for C++ include ext/hash_set - found
    -- Looking for C++ include ext/slist
    -- Looking for C++ include ext/slist - found
    -- Looking for C++ include tr1/unordered_map
    -- Looking for C++ include tr1/unordered_map - found
    -- Looking for C++ include tr1/unordered_set
    -- Looking for C++ include tr1/unordered_set - found
    -- Looking for C++ include unordered_map
    -- Looking for C++ include unordered_map - found
    -- Looking for C++ include unordered_set
    -- Looking for C++ include unordered_set - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of unsigned __int16
    -- Check size of unsigned __int16 - failed
    -- Check size of u_int16_t
    -- Check size of u_int16_t - done
    -- Check size of uint16_t
    -- Check size of uint16_t - done
    -- Looking for dladdr
    -- Looking for dladdr - not found
    -- Looking for fcntl
    -- Looking for fcntl - found
    -- Looking for pread
    -- Looking for pread - found
    -- Looking for pwrite
    -- Looking for pwrite - found
    -- Looking for sigaction
    -- Looking for sigaction - found
    -- Looking for sigaltstack
    -- Looking for sigaltstack - found
    -- Performing Test HAVE_NO_DEPRECATED
    -- Performing Test HAVE_NO_DEPRECATED - Success
    -- Performing Test HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS
    -- Performing Test HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
    -- Looking for snprintf
    -- Looking for snprintf - found
    -- Looking for get_static_proc_name in unwind
    -- Looking for get_static_proc_name in unwind - not found
    -- Looking for UnDecorateSymbolName in dbghelp
    -- Looking for UnDecorateSymbolName in dbghelp - not found
    -- Performing Test HAVE___ATTRIBUTE__
    -- Performing Test HAVE___ATTRIBUTE__ - Success
    -- Performing Test HAVE___ATTRIBUTE__VISIBILITY_DEFAULT
    -- Performing Test HAVE___ATTRIBUTE__VISIBILITY_DEFAULT - Success
    -- Performing Test HAVE___ATTRIBUTE__VISIBILITY_HIDDEN
    -- Performing Test HAVE___ATTRIBUTE__VISIBILITY_HIDDEN - Success
    -- Performing Test HAVE___BUILTIN_EXPECT
    -- Performing Test HAVE___BUILTIN_EXPECT - Success
    -- Performing Test HAVE___SYNC_VAL_COMPARE_AND_SWAP
    -- Performing Test HAVE___SYNC_VAL_COMPARE_AND_SWAP - Success
    -- Performing Test HAVE_RWLOCK
    -- Performing Test HAVE_RWLOCK - Failed
    -- Performing Test HAVE___DECLSPEC
    -- Performing Test HAVE___DECLSPEC - Failed
    -- Performing Test STL_NO_NAMESPACE
    -- Performing Test STL_NO_NAMESPACE - Failed
    -- Performing Test STL_STD_NAMESPACE
    -- Performing Test STL_STD_NAMESPACE - Failed
    -- Performing Test HAVE_USING_OPERATOR
    -- Performing Test HAVE_USING_OPERATOR - Failed
    -- Performing Test HAVE_NAMESPACES
    -- Performing Test HAVE_NAMESPACES - Success
    -- Performing Test HAVE_GCC_TLS
    -- Performing Test HAVE_GCC_TLS - Success
    -- Performing Test HAVE_MSVC_TLS
    -- Performing Test HAVE_MSVC_TLS - Failed
    -- Performing Test HAVE_CXX11_TLS
    -- Performing Test HAVE_CXX11_TLS - Success
    -- Performing Test HAVE_ALIGNED_STORAGE
    -- Performing Test HAVE_ALIGNED_STORAGE - Success
    -- Performing Test HAVE_LOCALTIME_R
    -- Performing Test HAVE_LOCALTIME_R - Success
    -- Shared libraries disabled
    -- Looking for ZLIB...
    -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
    -- Checking for module 'zzip-zlib-config'
    --   No package 'zzip-zlib-config' found
    -- Found ZLIB: optimized;/home/vj/miniconda3/envs/habitat/lib/libz.so;debug;/home/vj/miniconda3/envs/habitat/lib/libz.so
    -- Checking for module 'minizip'
    --   No package 'minizip' found
    -- Build an import-only version of Assimp.
    -- Found rt: /home/vj/miniconda3/envs/habitat/x86_64-conda-linux-gnu/sysroot/usr/lib/librt.so  
    -- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD STEP
    -- Disabled importer formats:
    -- Enabled exporter formats:
    -- Disabled exporter formats: 3DS ASSBIN ASSXML COLLADA OBJ OPENGEX PLY FBX STL X X3D GLTF 3MF ASSJSON STEP
    -- Found Assimp: assimp  
    -- Found PythonInterp: /home/vj/miniconda3/envs/habitat/bin/python3 (found suitable version "3.6.13", minimum required is "3.6") 
    -- Bindings being generated for python at /home/vj/miniconda3/envs/habitat/bin/python3
    -- pybind11 v2.6.2 
    -- Found PythonInterp: /home/vj/miniconda3/envs/habitat/bin/python3 (found version "3.6.13") 
    -- Found PythonLibs: /home/vj/miniconda3/envs/habitat/lib/libpython3.6m.so
    -- Performing Test HAS_FLTO
    -- Performing Test HAS_FLTO - Success
    Linux
    -- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY) 
    OPENGL NOT FOUND
    -- Using X11 for window creation
    CMake Error at /home/vj/miniconda3/envs/habitat/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find X11 (missing: X11_X11_LIB)
    Call Stack (most recent call first):
      /home/vj/miniconda3/envs/habitat/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
      /home/vj/miniconda3/envs/habitat/share/cmake-3.14/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
      deps/glfw/CMakeLists.txt:196 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/vj/habitat-sim/build/CMakeFiles/CMakeOutput.log".
    See also "/home/vj/habitat-sim/build/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "setup.py", line 456, in <module>
        include_package_data=True,
      File "/home/vj/miniconda3/envs/habitat/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/home/vj/miniconda3/envs/habitat/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/vj/miniconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/home/vj/miniconda3/envs/habitat/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "setup.py", line 247, in run
        self.build_extension(ext)
      File "setup.py", line 337, in build_extension
        cwd=self.build_temp,
      File "/home/vj/miniconda3/envs/habitat/lib/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '-DBUILD_PYTHON_BINDINGS=ON', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/vj/habitat-sim/habitat_sim/_ext', '-DPYTHON_EXECUTABLE=/home/vj/miniconda3/envs/habitat/bin/python3', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DCMAKE_AR=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-ar', '-DCMAKE_CXX_COMPILER_AR=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-gcc-ar', '-DCMAKE_C_COMPILER_AR=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-gcc-ar', '-DCMAKE_RANLIB=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-ranlib', '-DCMAKE_CXX_COMPILER_RANLIB=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-gcc-ranlib', '-DCMAKE_C_COMPILER_RANLIB=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-gcc-ranlib', '-DCMAKE_LINKER=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-ld', '-DCMAKE_STRIP=/home/vj/miniconda3/envs/habitat/bin/x86_64-conda-linux-gnu-strip', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DBUILD_GUI_VIEWERS=ON', '-DTARGET_HEADLESS=OFF', '-DBUILD_TEST=OFF', '-DBUILD_WITH_BULLET=ON', '-DBUILD_WITH_VHACD=OFF', '-DBUILD_DATATOOL=OFF', '-DBUILD_WITH_CUDA=OFF', '-DBUILD_BASIS_COMPRESSOR=OFF', '/home/vj/habitat-sim/src']' returned non-zero exit status 1.

OpenGL 库安装为:

vj@vj-TS:~/habitat-sim$ glxinfo|grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3080/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 470.74
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 470.74
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 470.74
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

标签: openglcmakeconda

解决方案


推荐阅读