Open yurivict opened 2 years ago
Filed as internal issue #USD-7058
I think this is caused by X11_FOUND
is false.
This bug is still here on 24.08.
@VVD If you can repro, could you try adding a final else() clause in this conditional in garch/CMakelists.txt?
if(APPLE)
set(GARCH_GLPLATFORMCONTEXT glPlatformContextDarwin)
set(GARCH_GLPLATFORMDEBUGWINDOW glPlatformDebugWindowDarwin)
set(GARCH_SOURCE_EXTENSION mm)
set(GARCH_PLATFORM_LIBRARIES "-framework AppKit")
elseif(X11_FOUND)
set(GARCH_GLPLATFORMCONTEXT glPlatformContextGLX)
set(GARCH_GLPLATFORMDEBUGWINDOW glPlatformDebugWindowGLX)
set(GARCH_SOURCE_EXTENSION cpp)
elseif(WIN32)
set(GARCH_GLPLATFORMCONTEXT glPlatformContextWindows)
set(GARCH_GLPLATFORMDEBUGWINDOW glPlatformDebugWindowWindows)
set(GARCH_SOURCE_EXTENSION cpp)
endif()
something like
if(UNIX AND NOT APPLE)
message(STATUS
"Skipping ${PXR_PACKAGE} because X11 is not available.")
else()
message(STATUS
"Skipping ${PXR_PACKAGE} because OpenGL is not available.")
endif()
and let us know if that resolves it for you?
-- Skipping Python program usdstitch, Python modules required
-- Skipping Python program usdstitchclips, Python modules required
-- Skipping Python program usdzip, Python modules required
-- Skipping garch because X11 is not available.
-- Skipping hgiMetal because PXR_BUILD_GPU_SUPPORT or PXR_ENABLE_METAL_SUPPORT is OFF
-- Skipping hgiVulkan because PXR_BUILD_GPU_SUPPORT or PXR_ENABLE_VULKAN_SUPPORT is OFF
-- Skipping building hdGenSchema, Python modules required.
-- Skipping Python program usdrecord, Python modules required
-- Configuring done (1.6s)
CMake Error at cmake/macros/Private.cmake:1239 (add_library):
Cannot find source file:
/tmp/work/usr/ports/misc/openusd/work/OpenUSD-24.08/pxr/imaging/garch/.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
Call Stack (most recent call first):
cmake/macros/Public.cmake:321 (_pxr_library)
pxr/imaging/garch/CMakeLists.txt:33 (pxr_library)
CMake Error at cmake/macros/Private.cmake:1239 (add_library):
No SOURCES given to target: garch
Call Stack (most recent call first):
cmake/macros/Public.cmake:321 (_pxr_library)
pxr/imaging/garch/CMakeLists.txt:33 (pxr_library)
Added this line: -- Skipping garch because X11 is not available.
Maybe that's enough to help people debug the problem if they encounter it?
I don't know if people have suggestions for better reporting, but at least there's some diagnostic output to explain the failure in trying to build garch. Maybe there could be an earlier test, that if imaging is requested, and you are on linux, and X11 is not found, it could error out at that point.
We are on FreeBSD and X11 is installed. (I am writing this message now on FreeBSD+KDE5+xorg+Firefox.)
got it. We test for X11_FOUND
, which should have been set by
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(X11)
endif()
around line 276 in Packages.cmake.
Does this fix it? I suspect the SYSTEM_NAME might be the problem.
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
find_package(X11)
endif()
Thanks. This work! Maybe better something like this:
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "Windows"))
find_package(X11)
endif()
For support other BSDs.
But I got this error (fixed in patches above):
FAILED: pxr/base/arch/CMakeFiles/arch.dir/assumptions.cpp.o
/usr/bin/c++ -DARCH_EXPORTS=1 -DBOOST_NO_CXX98_FUNCTION_BASE -DBOOST_PYTHON_NO_PY_SIGNATURES -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DMFB_ALT_PACKAGE_NAME=arch -DMFB_PACKAGE_MODULE=Arch -DMFB_PACKAGE_NAME=arch -DPXR_BUILD_LOCATION=usd -DPXR_GL_SUPPORT_ENABLED -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -Darch_EXPORTS -I/tmp/work/usr/ports/misc/openusd/work/.build/include -Wall -Wformat-security -pthread -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -Wno-unused-command-line-argument -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -DNDEBUG -std=c++17 -fPIC -MD -MT pxr/base/arch/CMakeFiles/arch.dir/assumptions.cpp.o -MF pxr/base/arch/CMakeFiles/arch.dir/assumptions.cpp.o.d -o pxr/base/arch/CMakeFiles/arch.dir/assumptions.cpp.o -c /tmp/work/usr/ports/misc/openusd/work/OpenUSD-24.08/pxr/base/arch/assumptions.cpp
/tmp/work/usr/ports/misc/openusd/work/OpenUSD-24.08/pxr/base/arch/assumptions.cpp:37:20: error: use of undeclared identifier '_SC_LEVEL1_DCACHE_LINESIZE'
37 | return sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
| ^
1 error generated.
One more "hack" is coming:
#if defined(ARCH_OS_LINUX) && !defined(ARCH_OS_FREEBSD)
return sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#elif defined(ARCH_OS_FREEBSD)
return 64;
#elif defined(ARCH_OS_DARWIN)
That's cool :) Are you interested in submitting that as a PR? Those patches represent investigation and bug fixed worth tracking together.
@meshula, you can submitting if you can and want, but for now it's set of "hacks".
Correct way is define ARCH_OS_POSIX
(or ARCH_OS_UNIX
or ARCH_OS_UNIX_NOT_DARWIN
) for both Linux and FreeBSD (may be for Darwin too?), replace all #if defined(ARCH_OS_LINUX)
with #if defined(ARCH_OS_POSIX)
and all #if defined(ARCH_OS_LINUX) && !defined(ARCH_OS_FREEBSD)
with just #if defined(ARCH_OS_LINUX)
.
But it's a lot of work:
$ grep -R ARCH_OS_LINUX OpenUSD-24.08 | wc -l
164
P.S. Post with patches (hacks) for FreeBSD support updated.
Thanks for putting together this set of hacks and patches, it should unblock others experiencing this issue for now!
Thanks for putting together this set of hacks and patches, it should unblock others experiencing this issue for now!
https://github.com/PixarAnimationStudios/OpenUSD/pull/1961 but for old version…
Description of Issue
cmake is called with these arguments:
Failure: