Caffe2: make ops fails when installing densepose - caffe2

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/

Related

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.

get_property could not find TARGET, from ExternalProject

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?

Mapbox GL Native doesn't build ubuntu18

I'm trying to build Mapbox GL Native using cmake .. so I cloned the repository from GitHub:
$ git clone https://github.com/mapbox/mapbox-gl-native.git
$ cd mapbox-gl-native
$ mkdir build && cd build
$ cmake ./
then it returns this with the erros:
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-57" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
I need heeeelp, I've been here trying to fix this but I don't know what could be the problem..
Thanks guys!
If your OpenGL library path installation is defined in your ENV path,
you want to set up your CMAKE_PREFIX_PATH to your OpenGL installation path (you could set it in your top level CMakeList.txt).

Issue building Tensorflow using Bazel (Windows) => to use Tensorflow C++ API

My initial goal was simply to use Tensorflow's C++ API to read a ".pb" frozen model and make predictions with it. Was using Keras to prototype it, managed to freeze the model and try it with Tensorflow on Python ; everything goes smoothly.
So i basically JUST need the C++ API to work.
I'm using an i5-8400T computer, no GPU, 8GB ram. All versions of bazel and tensorflow were downloaded today (27/08/2019).
First thing I did was to follow tensorflow's guide of course. Ran the little bazel run -c opt //tensorflow/cc/example:example, and that... several times.
First time, needed to downgrade my bazel version to 0.26.1 to make tensorflow's configure.py happy.
Then I had the same problem as a few people had apparently, which is an error fetching io_bazel_rules_docker, which then stops the rest of the build of course. (what follows is what i got as an output here)
bazel : INFO: Options provided by the client:
Au caractère Ligne:1 : 1
+ bazel run -c opt //tensorflow/cc/example:example > error.txt 2>&1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (INFO: Options provided by the client::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Options provided by the client:
Inherited 'build' options: --python_path=C:/Users/IMEDSYS/AppData/Local/Programs/Python/Python37/python.exe
INFO: Reading rc options for 'run' from c:\users\imedsys\bin\tensorflow\.bazelrc:
Inherited 'build' options: --apple_platform_type=macos --define framework_shared_object=true --define
open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true
--spawn_strategy=standalone --strategy=Genrule=standalone -c opt --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
--announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib
--define=INCLUDEDIR=$(PREFIX)/include
INFO: Reading rc options for 'run' from c:\users\imedsys\bin\tensorflow\.tf_configure.bazelrc:
Inherited 'build' options: --action_env
PYTHON_BIN_PATH=C:/Users/IMEDSYS/AppData/Local/Programs/Python/Python37/python.exe --action_env
PYTHON_LIB_PATH=C:/Users/IMEDSYS/AppData/Local/Programs/Python/Python37/lib/site-packages
--python_path=C:/Users/IMEDSYS/AppData/Local/Programs/Python/Python37/python.exe --config monolithic --copt=-w
--host_copt=-w --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI
--verbose_failures --distinct_host_configuration=false --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:monolithic in file c:\users\imedsys\bin\tensorflow\.bazelrc: --define
framework_shared_object=false
Loading:
Loading: 0 packages loaded
INFO: Call stack for the definition of repository 'io_bazel_rules_docker' which is a git_repository (rule definition
at C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/bazel_tools/tools/build_defs/repo/git.bzl:252:18):
- C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/bazel_toolchains/repositories/repositories.bzl:37:9
- C:/users/imedsys/bin/tensorflow/WORKSPACE:35:1
ERROR: An error occurred during the fetch of repository 'io_bazel_rules_docker':
Traceback (most recent call last):
File "C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/bazel_tools/tools/build_defs/repo/git.bzl", line 234
_clone_or_update(ctx)
File "C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/bazel_tools/tools/build_defs/repo/git.bzl", line 74, in
_clone_or_update
fail(("error cloning %s:\n%s" % (ctx....)))
error cloning io_bazel_rules_docker:
fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
/bin/bash: line 1: cd: C:/users/imedsys/_bazel_imedsys/wmdtvioi/external: No such file or directory
+ cd C:/users/imedsys/_bazel_imedsys/wmdtvioi/external
/bin/bash: line 3: cd: C:/users/imedsys/_bazel_imedsys/wmdtvioi/external: No such file or directory
+ git -C C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker reset --hard
251f6a68b439744094faff800cd029798edf9faa
fatal: cannot change to 'C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker': No such file or
directory
+ git -C C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker fetch '' origin
251f6a68b439744094faff800cd029798edf9faa:251f6a68b439744094faff800cd029798edf9faa
fatal: cannot change to 'C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker': No such file or
directory
+ git -C C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker fetch origin
251f6a68b439744094faff800cd029798edf9faa:251f6a68b439744094faff800cd029798edf9faa
fatal: cannot change to 'C:/users/imedsys/_bazel_imedsys/wmdtvioi/external/io_bazel_rules_docker': No such file or
directory
ERROR: ... *idem*
ERROR: ... *idem*
INFO: Elapsed time: 2.346s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully (0 packages loaded)
***
I so tried applying what this issue was offering, which involves going to the rules_docker repository and replace targets with the latest ones.
The thing is even after this you get the same kind of errors with the protobuf targets, which I get hash errors for if i apply the same strategy.
I then tried to do it with CMake as many were saying last year that bazel building on windows was not yet usable. I used two similar guides, one of them here, and so tried to build with
cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DSWIG_EXECUTABLE=C:\swigwin-3.0.12\swig.exe -DPYTHON_EXECUTABLE=C:\Anaconda3\envs\tensorflow\python.exe -DPYTHON_LIBRARIES=C:\Anaconda3\envs\tensorflow\libs\python35.lib
at first, and then with
`cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DSWIG_EXECUTABLE=C:\swigwin-3.0.12\swig.exe -DPYTHON_EXECUTABLE=C:\Anaconda3\envs\tensorflow\python.exe -DPYTHON_LIBRARIES=C:\Anaconda3\envs\tensorflow\libs\python35.lib -Dtensorflow_BUILD_PYTHON_BINDINGS=OFF -Dtensorflow_ENABLE_GRPC_SUPPORT=OFF -Dtensorflow_BUILD_SHARED_LIB=ON`
and i get those errors :
cmake : CMake Warning at CMakeLists.txt:9 (message):
Au caractère Ligne:1 : 1
+ cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DSWIG_EXECUTABLE=C:\Users ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (CMake Warning a...xt:9 (message)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Your current cmake generator is set to use 32 bit toolset architecture.
This may cause "compiler out of heap space" errors when building. Consider
using the flag -Thost=x64 when running cmake. Ignore this if you are on
CMake GUI.
-- Selecting Windows SDK version to target Windows 10.0.17763.
-- C:/Users/IMEDSYS/bin/tensorflow/tensorflow/contrib/cmake/build/abseil_cpp/src/abseil_cpp_build
-- Configuring done
CMake Error at tf_core_ops.cmake:77 (add_library):
Cannot find source file:
C:/Users/IMEDSYS/bin/tensorflow/tensorflow/contrib/factorization/ops/clustering_ops.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
tf_core_ops.cmake:95 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
Cannot find source file:
C:/Users/IMEDSYS/bin/tensorflow/tensorflow/contrib/rnn/ops/gru_ops.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
tf_core_ops.cmake:107 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
Cannot find source file:
C:/Users/IMEDSYS/bin/tensorflow/tensorflow/contrib/rnn/ops/lstm_ops.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
tf_core_ops.cmake:108 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_kernels.cmake:205 (add_library):
Cannot find source file:
C:/Users/IMEDSYS/bin/tensorflow/tensorflow/contrib/factorization/kernels/clustering_ops.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
Call Stack (most recent call first):
CMakeLists.txt:596 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
No SOURCES given to target: tf_contrib_factorization_clustering_ops
Call Stack (most recent call first):
tf_core_ops.cmake:95 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
No SOURCES given to target: tf_contrib_rnn_gru_ops
Call Stack (most recent call first):
tf_core_ops.cmake:107 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
No SOURCES given to target: tf_contrib_rnn_lstm_ops
Call Stack (most recent call first):
tf_core_ops.cmake:108 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_ops.cmake:77 (add_library):
No SOURCES given to target: tf_contrib_tpu_ops
Call Stack (most recent call first):
tf_core_ops.cmake:115 (GENERATE_CONTRIB_OP_LIBRARY)
CMakeLists.txt:594 (include)
CMake Error at tf_core_kernels.cmake:205 (add_library):
No SOURCES given to target: tf_core_kernels
Call Stack (most recent call first):
CMakeLists.txt:596 (include)
CMake Generate step failed. Build files cannot be regenerated correctly.
This time i feel like it's simply that CMake looks for files that are either depreciated, either relocated.
SO,
my questions is rather simple :
does someone has 2 version numbers of both bazel and tensorflow that actually work together (because it seems that it does work for some people => I consider trying voodoo)?
does someone has a very straightforward solution to use Tensorflow's c_api or C++ API ?
does someone knows another way to make a prediction with either Keras or Tensorflow outputs (.hdf5 or .pb) from a C++ built software, without doing as disgusting as "system("python predict.py")"?
Thank you in advance for your quick answers! :)
I had done similar work building older Tensorflow version (not 2.) for VS 2017 using Cmake.
Cuda 9 . Tensorflow 1.14 VS 2017 .

Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE ""

I'm trying to compile cryptonotecoinwallet repo using CMake with VS2010 compiler (according to the comments I got for this question)
I tried to add the below line to the CMake file and the cache file, but no luck.
set (CMAKE_PREFIX_PATH "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64")
I tried to compile it using the command line, but got the same error.
D:\My Documents\Fiverr\C++ and Qt\FitsoCoin\cryptonotewallet>cmake.exe -DBOOST_ROOT=C:\\boost_1_66_0 -DBOOST_LIBRARYDIR=C:\\boost_1_66_0\\lib32-msvc-1
0.0:C:\\boost_1_66_0\\libs -G "Visual Studio 10 2010" .
CMake Error at C:/Qt/Qt5.2.0/5.2.0/msvc2010_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16 (message):
Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
Call Stack (most recent call first):
C:/Qt/Qt5.2.0/5.2.0/msvc2010_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:52 (_qt5gui_find_extra_libs)
C:/Qt/Qt5.2.0/5.2.0/msvc2010_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:152 (include)
CMakeLists.txt:19 (find_package)
Any ideas how to fix this?
Thanks.
If you want to point CMake (and Find* scripts) to directory with a libraries, set CMAKE_LIBRARY_PATH variable:
set(CMAKE_LIBRARY_PATH "C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64")
Variable CMAKE_PREFIX_PATH, which you are trying to set, is expected to point to installation prefix. This prefix is used when search a library, but only with subdirectories like lib/ appended to it.