get_property could not find TARGET, from ExternalProject - c++

I'm running into a CMake issue that I am a little stumped by. It involves a CMake project that builds dependencies for an application I develop at work. I now have to add a new dependency, libnest2d, which itself also has three dependencies, of which some are also new.
To get libnest2d to build I have this ExternalProject_Add call:
ExternalProject_Add(libnest2d
GIT_REPOSITORY https://github.com/tamasmeszaros/libnest2d.git
GIT_TAG da4782500da4eb8cb6e38e5e3f10164ec5a59778
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
DEPENDS BoostHeaders nlopt Clipper
)
This project depends on the Boost Headers, NLopt and Clipper. Those Boost headers and Clipper are fine, but it somehow complains about NLopt with the following errors:
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2962 (get_property):
get_property could not find TARGET nlopt. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:3239 (_ep_add_configure_command)
projects/libnest2d.cmake:5 (ExternalProject_Add)
CMakeLists.txt:61 (include)
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2964 (get_property):
get_property could not find TARGET nlopt. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:3239 (_ep_add_configure_command)
projects/libnest2d.cmake:5 (ExternalProject_Add)
CMakeLists.txt:61 (include)
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:1783 (get_property):
get_property could not find TARGET nlopt. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:2064 (ExternalProject_Get_Property)
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:2966 (_ep_get_step_stampfile)
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:3239 (_ep_add_configure_command)
projects/libnest2d.cmake:5 (ExternalProject_Add)
CMakeLists.txt:61 (include)
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:1785 (message):
External project "nlopt" has no stamp_dir
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:2064 (ExternalProject_Get_Property)
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:2966 (_ep_get_step_stampfile)
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:3239 (_ep_add_configure_command)
projects/libnest2d.cmake:5 (ExternalProject_Add)
CMakeLists.txt:61 (include)
So it states that the nlopt target is not defined. However that target is defined using another ExternalProject_Add call, the same as the other two dependencies:
ExternalProject_Add(nlopt
GIT_REPOSITORY https://github.com/stevengj/nlopt.git
GIT_TAG v2.6.2
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
)
ExternalProject_Add(BoostHeaders
URL http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2
URL_HASH SHA1=694ae3f4f899d1a80eb7a3b31b33be73c423c1ae
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/BoostHeaders-prefix/src/BoostHeaders/boost" "${CMAKE_INSTALL_PREFIX}/include/boost"
)
ExternalProject_Add(Clipper
URL https://sourceforge.net/projects/polyclipping/files/clipper_ver6.4.2.zip
URL_HASH SHA1=b05c1f454c22576f867fc633b11337d053e9ea33
SOURCE_SUBDIR cpp
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
)
Without the NLopt dependency, libnest2d builds fine (since I still have the dependency installed on my local system), but there is no guarantee that NLopt is built and installed before starting on libnest2d, and indeed this goes wrong if I execute this build in a VM with multiple threads.
If I temporarily remove the nlopt dependency and call cmake .. && make help then I see that nlopt is one of the available targets. I can also call make nlopt and it starts building NLopt as expected.
You can view my entire source code here: https://github.com/Ultimaker/cura-build-environment/tree/CURA-7259_pynest2d . As of this writing I'm on commit 39298d203d115b60d7093f0a801be1bad0ba7842.
Other problems I've found have not been the same and don't provide a solution for me:
This related question has the same error but it seems to be caused by a tool that OP was using, which I'm not using.
This question and this bug report were a problem with a target that was disabled by a build option, which is not the case for me. The target clearly exists and I made no option to disable it.
There was an old bug that caused this but it was fixed in CMake 2.8. I'm using CMake 3.16.3.
So to summarize, how can I cause the libnest2d external project to depend on NLopt? Why are two dependencies accepted, but one isn't?

Related

Using conan packages in CMake: Library 'mylibrary.a' not found in package

I am using cmake to build my project. I have a library, mylibrary, which is a dependency of my project. mylibrary is packaged with conan. I use the conan CMakeDeps and CMakeToolchain Generators when packaging mylibrary. This is the package_info function of mylibrary's conanfile:
def package_info(self):
self.cpp_info.set_property("cmake_find_mode", "config")
self.cpp_info.set_property("cmake_file_name", "Mylibrary")
self.cpp_info.components["libmylibrary"].set_property("cmake_target_name", "Mylibrary::Mylibrary")
self.cpp_info.components["libmylibrary"].libs = ["mylibrary.a"]
self.cpp_info.components["libmylibrary"].requires = ["gtest::gtest"]
My library is a shared library with the file name libmylibrary.a.I can package the library without having any problems. The find_package call in my projects CMakeLists.txt file looks like this:
find_package(Mylibrary REQUIRED HINTS ${LLIB_DIR})
When I build my project, CMake does declare my library's target, which is mylibrary::mylibrary. But right I run cmake, I get this error:
CMake Error at MyProject/cmakedeps_macros.cmake:4 (message):
Library 'mylibrary.a' not found in package. If 'mylibrary.a' is a system library,
declare it with 'cpp_info.system_libs' property
Call Stack (most recent call first):
MyProjectLibs/cmakedeps_macros.cmake:48 (conan_message)
MyProjectLibs/Mylibrary-Target-release.cmake:21 (conan_package_library_targets)
MyProjectLibs/MylibraryTargets.cmake:28 (include)
MyProjectLibs/MylibraryConfig.cmake:11 (include)
CMakeLists.txt:196 (find_package)
I am new to cmake's targets and I don't know what to do. I tried using uppercases or lowercases names when calling find_library, but it is not working. I suspect that I wrote something wrong in the package_info method.
So, I did it. I don't understand why or how, but to solve my problem, I had to change this line:
self.cpp_info.components["libmylibrary"].libs = ["mylibrary.a"]
to this:
self.cpp_info.components["libmylibrary"].libs = ["mylibrary"]

CMake: FetchContent_Declare leads to target name conflict

I am trying to automate the fetch a few dependencies in CMakeList.txt, using FetchContent_Declare and FetchContent_MakeAvailable.
However I found the following error when running cmake
CMake Error at build/_deps/hermes-src/cmake/modules/Hermes.cmake:123 (add_library):
add_library cannot create target "gtest" because another target with the
same name already exists. The existing target is a static library created
in source directory
"/path/to/build/_deps/googletest-src/googletest". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
build/_deps/hermes-src/external/llvh/utils/unittest/CMakeLists.txt:53 (add_hermes_library)
CMake Error at build/_deps/hermes-src/cmake/modules/Hermes.cmake:123 (add_library):
add_library cannot create target "gtest_main" because another target with
the same name already exists. The existing target is a static library
created in source directory
"path/to/build/_deps/googletest-src/googletest". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
build/_deps/hermes-src/external/llvh/utils/unittest/UnitTestMain/CMakeLists.txt:1 (add_hermes_library)
This is the CMakeLists.txt to reproduce
cmake_minimum_required(VERSION 3.13)
project(pytorch_live_cxx)
set(CMAKE_CXX_STANDARD 14)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
hermes
URL https://github.com/facebook/hermes/archive/d63feeb46d26fe0ca7e789fc793f409e5158b27f.zip
)
FetchContent_MakeAvailable(hermes)
My questions:
does that mean hermes has googletest as dependencies? If so, I can just call target_link_libraries(myexec, gtest) without calling fetching googletest?
Is there any better practice to avoid target name conflict like this? This is an example in my imagination: we have package A which builds target a and b, and package B which builds targets b and c. What should I do if I want to links to all a, b and c?
Thanks

CMake cannot find packages within Qt6 installation

I am in the process of trying to build a project through CMake and I set environmental variable Qt6_DIR to the directory containing Qt6Config.cmake. However the build doesn't seem to be able to find any of the other dependencies it needs within the Qt6 installation & I'm not sure what needs to be done next. I see references to other possible environmental variables like "Qt6CoreTools_DIR" and I'm wondering if I really need to set each of these independently or if there's a toolchain containing this information that needs to be properly linked to.
-- GUI Frontend: Qt6
CMake Warning at C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
By not providing "FindQt6CoreTools.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt6CoreTools", but CMake did not find one.
Could not find a package configuration file provided by "Qt6CoreTools"
(requested version 6.2.3) with any of the following names:
Qt6CoreToolsConfig.cmake
qt6coretools-config.cmake
Add the installation prefix of "Qt6CoreTools" to CMAKE_PREFIX_PATH or set
"Qt6CoreTools_DIR" to a directory containing one of the above files. If
"Qt6CoreTools" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsDependencies.cmake:9 (find_dependency)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsConfig.cmake:34 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:71 (find_package)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:40 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package)
src/CMakeLists.txt:22 (find_package)
CMake Warning at C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:71 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsConfig.cmake
but it set Qt6WidgetsTools_FOUND to FALSE so package "Qt6WidgetsTools" is
considered to be NOT FOUND. Reason given by package:
Qt6WidgetsTools could not be found because dependency Qt6CoreTools could
not be found.
Call Stack (most recent call first):
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:40 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package)
src/CMakeLists.txt:22 (find_package)
CMake Warning at C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake
but it set Qt6Widgets_FOUND to FALSE so package "Qt6Widgets" is considered
to be NOT FOUND. Reason given by package:
Target "Qt6::Widgets" was not found.
Call Stack (most recent call first):
src/CMakeLists.txt:22 (find_package)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find Qt6CoreTools (missing: Qt6CoreTools_DIR)
CMake Warning at C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
NOT FOUND. Reason given by package:
Target "Qt6::Core" was not found.
Call Stack (most recent call first):
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:14 (find_dependency)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLDependencies.cmake:91 (_qt_internal_find_dependencies)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLConfig.cmake:40 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package)
src/CMakeLists.txt:22 (find_package)
CMake Warning at C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLConfig.cmake
but it set Qt6OpenGL_FOUND to FALSE so package "Qt6OpenGL" is considered to
be NOT FOUND. Reason given by package:
Qt6OpenGL could not be found because dependency Qt6Core could not be found.
Call Stack (most recent call first):
src/CMakeLists.txt:22 (find_package)
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
-- Could NOT find Qt6CoreTools (missing: Qt6CoreTools_DIR)
CMake Warning at C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
NOT FOUND. Reason given by package:
Target "Qt6::Core" was not found.
Call Stack (most recent call first):
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:14 (find_dependency)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLDependencies.cmake:91 (_qt_internal_find_dependencies)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLConfig.cmake:40 (include)
C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:14 (find_dependency)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsDependencies.cmake:91 (_qt_internal_find_dependencies)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsConfig.cmake:40 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package)
src/CMakeLists.txt:22 (find_package)
CMake Warning at C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLConfig.cmake
but it set Qt6OpenGL_FOUND to FALSE so package "Qt6OpenGL" is considered to
be NOT FOUND. Reason given by package:
Qt6OpenGL could not be found because dependency Qt6Core could not be found.
Call Stack (most recent call first):
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:14 (find_dependency)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsDependencies.cmake:91 (_qt_internal_find_dependencies)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsConfig.cmake:40 (include)
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package)
src/CMakeLists.txt:22 (find_package)
CMake Warning at C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:177 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsConfig.cmake
but it set Qt6OpenGLWidgets_FOUND to FALSE so package "Qt6OpenGLWidgets" is
considered to be NOT FOUND. Reason given by package:
Qt6OpenGLWidgets could not be found because dependency Qt6OpenGL could not
be found.
Call Stack (most recent call first):
src/CMakeLists.txt:22 (find_package)
CMake Error at src/CMakeLists.txt:22 (find_package):
Found package configuration file:
C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6/Qt6Config.cmake
but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
FOUND. Reason given by package:
Failed to find Qt component "Widgets".
Expected Config file at
"C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake" exists
Failed to find Qt component "OpenGL".
Expected Config file at
"C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGL/Qt6OpenGLConfig.cmake" exists
Failed to find Qt component "OpenGLWidgets".
Expected Config file at
"C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6OpenGLWidgets/Qt6OpenGLWidgetsConfig.cmake"
exists
According to QTBUG-97615 the proper support of configuring the build with single Qt6_DIR isn't supported (yet?), and the 'official' way to configure your application build is to use CMAKE_PREFIX_PATH (as suggested in other answers).
However if your tools don't support such appoach easily (like VisualStudio/VSCode), there is a workaround for such case (I've discovered it while digging the messy cmake-scripts of Qt6).
You can use QT_ADDITIONAL_PACKAGES_PREFIX_PATH to specify the Qt root (along with Qt6_DIR to hook it initially).
And the command line will look as follows (just to illustrate the approach):
cmake -DQt6_DIR:PATH=C:/Qt6/6.2.3/mingw_64/lib/cmake/Qt6 -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH=C:/Qt6/6.2.3/mingw_64 ..
Both these variables are easily configurable through UI in VisualStudio/VSCode.
Happy building! :)
Add this to your root cmake.
list(APPEND CMAKE_PREFIX_PATH "~/Qt/6.3.0/gcc_64")
Change the path as needed.
Alternatively You can set it as env var.
export PATH="~/Qt/6.3.0/gcc_64/:$PATH"
Since I see some people in the comments asking specifically for VS(-Code) settings/configuration, the following worked for me on Windows:
I set CMAKE_PREFIX_PATH to C:/Qt/6.4.2/msvc2019_64 (substitute C:/Qt/6.4.2 with your Qt installation path and version).
Note: with Qt 5, you could use [..]/msvc2019_64/lib/cmake, this doesn't work for Qt 6 anymore. If you need multiple paths in CMAKE_PREFIX_PATH, join them with a semicolon (;).
An example .vscode/settings.json could look like this:
{
"cmake.configureSettings": {
"CMAKE_PREFIX_PATH": "C:/Qt/6.4.2/msvc2019_64"
}
}
From Qt Documentation:
There are different ways you can tell CMake about Qt, but the most common and recommended approach is to set the CMake cache variable CMAKE_PREFIX_PATH to include the Qt 6 installation prefix.
So you shoud add C:/Qt6/6.2.3/mingw_64/ to the CMAKE_PREFIX_PATH semicolon-separated list.
You could check whether CMAKE_PREFIX_PATH is set or modified by one of the cmake scripts supplied by the project.
I had the same problem with a different project on Linux OS and what seemed to work in the end was setting a project specific variable named QT_PREFIX to /opt/Qt/6.2.4/gcc_64/.
By looking at the project's file CMakeLists_Dependencies.cmake I noticed that CMAKE_PREFIX_PATH was being set by the script like this:
set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake").
My guess is, that this statement shadowed my definition of CMAKE_PREFIX_PATH from the command line.
I checked it by inserting the statement message(CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}") right below set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake").
When not setting QT_PREFIX, the output was CMAKE_PREFIX_PATH="/lib/cmake", no matter whether I included -DCMAKE_PREFIX_PATH=… on the command line or not. (/lib/cmake/ was not a valid path in my case.)
If QT_DIR was set as described above, the output was CMAKE_PREFIX_PATH="/opt/Qt/6.2.4/gcc_64//lib/cmake", which enabled cmake to find the directory, even despite the double slash.

Caffe2: make ops fails when installing densepose

I am trying to install DensePose but run into problems when executing make ops.
First I get error Caffe2Config.cmake not found, but after following the instructions here Caffe2 build from source the Caffe2Config.cmake ends up under the build directory.
Adding the path to the build folder gives then the following error:
CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:14 (include):
include could not find load file:
/home/erikbylow/Code/LocalLibs/pytorch/build/public/utils.cmake
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)
CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:17 (include):
include could not find load file:
/home/erikbylow/Code/LocalLibs/pytorch/build/public/threads.cmake
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)
CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:88 (include):
include could not find load file:
/home/erikbylow/Code/LocalLibs/pytorch/build/public/cuda.cmake
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)
The paths are clearly wrong since the requested cmake-files are under pytorch/cmake/public instead of pytorch/build/public.
How can one resolve that? I have just followed the instructions and the tests one makes along the way works. It seems to be the installation of Caffe2 that causes the problem?
In my case, setting the environment variable Caffe2_DIR to the directory of the missing files solved the problem.
As you mentioned, these files are in the pytorch/cmake/public directory instead of pytorch/build/public. To define the path of Caffe2 manually, open the CMakeLists.txt in the densepose folder, add one line in the beginning:
set(Caffe2_DIR "/home/erikbylow/Code/LocalLibs/pytorch/cmake/")
Run make ops again and the issue should be solved. If not, also try
set(Caffe2_DIR "/home/erikbylow/Code/LocalLibs/pytorch/torch/share/cmake/Caffe2/")
Also, after DensePose is successfully installed, remember to append its path to PYTHONPATH:
export PYTHONPATH=$PYTHONPATH:/path/to/densepose/

Could NOT find HDF5 during compilation (server)

I was able to compile perfectly a code using HDF5 in my computer but now I would like to compile it in a server.
In the server, HDF5 is well installed in the following path:
/usr/local/HDF_Group/HDF5/1.8.17/lib/
But I got this error during the compilation using CMake:
CMake Error at
/usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148
(message): Could NOT find HDF5 (missing: HDF5_LIBRARIES
HDF5_INCLUDE_DIRS HDF5_HL_LIBRARIES) Call Stack (most recent call
first):
/usr/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388
(_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.6/Modules/FindHDF5.cmake:690
(find_package_handle_standard_args) CMakeLists.txt:4 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
The beginning of my CMakeList.txt
FIND_PACKAGE(HDF5 REQUIRED)
find_package (HDF5 NAMES hdf5 COMPONENTS C static)
INCLUDE_DIRECTORIES
(${HDF5_INCLUDE_DIR}) message(STATUS ${HDF5_INCLUDE_DIR})
set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
include_directories(/usr/local/HDF_Group/)
link_directories(/usr/local/HDF_Group/HDF5/1.8.17/lib/)
link_directories(/usr/local/lib)
Could you please help me ?As I'm not well familiar with CMake, Maybe I did not link it properly...
Thank in advance,
EDIT: SOLVED
I solved my issue by doing this:
export HDF5_DIR=/usr/local/HDF_Group/HDF5/1.8.17/share/cmake
And I added it into my /home/user/.bashrc so that I don't have to do this command line each time.