Open blurgyy opened 2 years ago
I also have an Arch-based system (with /lib64
sym-linking to /usr/lib
) and OSPRay installed (config at /usr/lib/cmake/ospray-2.8.0/
), yet when compiling pcl
, CMake correctly finds OSPRay:
-- Found OSPRay: /usr
Could it be that you have /lib64
in CMAKE_MODULE_PATH
(before /usr/lib
)? Because CMake finds all dependencies (vtk, ...) in /lib64/cmake/
on your system (as opposed to /usr/lib64/cmake
on my system).
Hi @johguenther, thank you for your reply.
I don't think I have mangled with CMAKE_MODULE_PATH
before, and I just checked that it's neither in my shell environment nor in my cmake commands.
Nevertheless, when I tried to build pcl
(with code extracted from pcl-1.12.0.tar.gz), my CMake still finds OSPRay's cmake configs from /lib64
. The CMake command is:
$ cmake -S . -B build
The error still says it fails to find OSPRay headers (same as before):
I also tried with a single CMakeLists.txt in an empty directory, and the problem is reproduced on 3 of my Arch Linux machines. My CMakeLists.txt
has content as follows:
cmake_minimum_required(VERSION 3.22)
project(ospray-test)
message("CMAKE_MODULE_PATH is: ${CMAKE_MODULE_PATH}")
find_package(ospray REQUIRED)
With this CMakeLists.txt, here's the full error log:
If I specify CMAKE_MODULE_PATH
to be /usr/lib/cmake
, the problem persists:
If you have time, could you please try a cmake run with the above 4-line CMakeLists.txt
in an empty directory and see if my problem occurs on your system? My cmake
version is 3.22.1-5
, if it helps.
CMake version 3.22.1 here as well, yet all is found in /usr/...
. It seems to be a CMake issue (config? installation?); CMAKE_MODULE_PATH
was a guess, but when I set it to /lib64
it still finds the packages in /usr
. Puzzling.
Well, in my case, all is found in /lib64/...
by default and neither setting CMAKE_MODULE_PATH
to /usr/lib/cmake
nor setting it to /usr
made any differences. There is a workaround as mentioned in my initial description, though.
Thank you for your help @johguenther, I will update this if I get any clue in the future.
I just got a similar error on Arch (6.1.12-arch1-1
) with cmake=3.25.2, ospray=2.10.0
. CMAKE_MODULE_PATH
didn't work, only the symlink workaround.
The only difference is that it's not related to /lib64
but to /lib
:
CMake Error at /lib/cmake/ospray-2.10.0/osprayConfig.cmake:26 (message):
Failed to find OSPRay - OSPRay install root: /, determined from relative
path from osprayConfg.cmake install location: /lib/cmake/ospray-2.10.0,
does not contain OSPRay headers. Either the install directory was deleted,
or the install tree was only partially relocated outside of CMake after
OSPRay was built.
Hi, when I try to build pcl on Arch Linux, OSPRay dumps an error message saying:
It comes from these lines in my OSPRay installation at file
/usr/lib/cmake/ospray-2.8.0/osprayConfig.cmake
:Where the value of variable
CURRENT_CONFIG_INSTALL_DIR
is/lib64/cmake/ospray-2.8.0
, which I think the cmake config expects this to be/usr/lib64/cmake/ospray-2.8.0
. On default Arch Linux installations,/lib64
is a symlink to/usr/lib
, so I have to create another symlink at/include
to point to/usr/include
as a workaround, so thatcmake
can find the OSPRay headers. Is there a way that could solve this in the released CMake script from this repo? It seems that these lines are related:https://github.com/ospray/ospray/blob/fe4b3806f8626b22defbeda172609aa7c8c74a2e/cmake/ospray_cmake_config/osprayConfig.cmake.in#L47-L53
Thank you!