How to use Facebook Wangle in Windows with vcpkg - c++

When I install Wangle with vcpkg install wangle I see the below message:
The following packages are already installed:
wangle[core]:x64-windows
Starting package 1/1: wangle:x64-windows
Package wangle:x64-windows is already installed
Elapsed time for package wangle:x64-windows: 3.573 ms
Total elapsed time: 4.733 ms
The package wangle:x64-windows provides CMake targets:
find_package(wangle CONFIG REQUIRED)
target_link_libraries(main PRIVATE wangle::wangle)
But when I write my own CMakeLists.txt and write find_package(wangle CONFIG REQUIRED) . and run with
cmake .. -DCMAKE_TOOLCHAIN_FILE='C:\Users\sooro\Documents\vcpkg\vcpkg\scripts\buildsystems\vcpkg.cmake'
I see the below error:
CMake Error at C:/Users/sooro/Documents/vcpkg/vcpkg/installed/x64-windows/share/wangle/wangle-config.cmake:22 (message):
File or directory
C:/Users/sooro/Documents/vcpkg/vcpkg/installed/x64-windows/lib/cmake/wangle
referenced by variable WANGLE_CMAKE_DIR does not exist !
Call Stack (most recent call first):
C:/Users/sooro/Documents/vcpkg/vcpkg/installed/x64-windows/share/wangle/wangle-config.cmake:39 (set_and_check)
C:/Users/sooro/Documents/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake:258 (_find_package)
CMakeLists.txt:35 (find_package)
-- Configuring incomplete, errors occurred!

As you can see in [wangle] find_package(wangle) failed issue on vcpkg, this problem is for bug on port, and after this bug was resolved, the above error (WANGLE_CMAKE_DIR does not exist) was resolved, and the library worked properly.
So as you can see in the install message below, the command is working correctly for using Wangle in Windows with vcpkg in all CMake base projects.
find_package(wangle CONFIG REQUIRED)
target_link_libraries(main PRIVATE wangle::wangle)

Related

How to use CMake to compile SharkML library? [duplicate]

I am trying to build ripple by following the build guide on GitHub, but boost is continuously throwing some unknown error. Boost is installed and running. I installed boost_1_71_0 as described by the build guide.
/home/usman/Downloads/clion-2020.1.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/usman/Desktop/ripple/rippled
-- Using 4 cores for ExternalProject builds.
-- rippled version: 1.6.0
-- NIH-EP cache path: /home/usman/Desktop/ripple/rippled/.nih_c/unix_makefiles/GNU_9.3.0/Debug
-- using [01bd5a2646cda78ee09d2067c287c8f89872736d] as build container tag...
-- docker local user id: 1000
-- docker local group id: 1000
-- BOOST_ROOT: /usr/local
-- BOOST_LIBRARYDIR: /usr/local/lib/
CMake Error at /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
Found package configuration file:
/usr/local/lib/cmake/boost_chrono-1.71.0/boost_chrono-config.cmake
but it set boost_chrono_FOUND to FALSE so package "boost_chrono" is
considered to be NOT FOUND. Reason given by package:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
Call Stack (most recent call first):
/usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
Builds/CMake/deps/FindBoost.cmake:273 (find_package)
Builds/CMake/deps/Boost.cmake:50 (find_package)
CMakeLists.txt:43 (include)
-- Configuring incomplete, errors occurred!
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeError.log".
[Finished]
There is a similar question here, but your issue appears to be the opposite case.
The important section of the error is here:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
It shows you what libraries were found, and even gives the reason why they were rejected. All of the libraries found on your machine are shared libraries. However, your CMake configuration indicates you do not want to use shared libraries (Boost_USE_STATIC_LIBS=ON and Boost_USE_STATIC_RUNTIME=ON). To fix the error, you have two options:
Set Boost_USE_STATIC_LIBS to OFF and Boost_USE_STATIC_RUNTIME to OFF:
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost ... )
Build the static Boost libraries also, so not only the shared libraries are available on your machine.

problem with eclipse build cmake espidf Error: could not find CMAKE_PROJECT_NAME in Cache

I have a problem with the eclipse IDE with ESP-IDF, every time that i build a project i get this massage-
Building in: C:\Users\eclipse-workspace06\blynk\build
Configuring in: C:\Users\eclipse-workspace06\blynk\build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=D:\espidfeclipse\esp-idf-v5.0\tools\cmake\toolchain-esp32.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCCACHE_ENABLE=1 -DIDF_TARGET=esp32 C:\Users\eclipse-workspace06\blynk
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.28.0.windows.1")
CMake Error at D:/espidfeclipse/esp-idf-v5.0/tools/cmake/build.cmake:181 (file):
file FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be called with
-- Configuring incomplete, errors occurred!
exactly three arguments.
Call Stack (most recent call first):
D:/espidfeclipse/esp-idf-v5.0/tools/cmake/idf.cmake:53 (__build_init)
D:/espidfeclipse/esp-idf-v5.0/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:5 (include)
CMake Error at D:/espidfeclipse/esp-idf-v5.0/tools/cmake/project.cmake:18 (message):
Internal error, PYTHON build property not set correctly.
Call Stack (most recent call first):
CMakeLists.txt:5 (include)
cmake --build . -- -v
Error: could not find CMAKE_PROJECT_NAME in Cache
Build complete (1 errors, 0 warnings): C:\Users\eclipse-workspace06\blynk\build
Total time taken to build the project: 246 ms
The code is an example code that works on VScode and Arduino, i installed and reinstalled every thing 100 times already. ( and if i build regular c++ it works alright)
I will be grateful for any help i can get.
Thank you #drescherjm and #Tsyvarev for putting me on the right path.
I solved the problem and the solution is very odd. what i did was to delete all the python instances from the different environment variables and it worked for some bizarre reason.

How to avoid update checks with CMake FetchContent?

all.
I decided to use the new cmake macro to download external dependencies.
I took the sample code from the documentation for the Catch2 library.
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.4
)
FetchContent_GetProperties(Catch2)
if(NOT Catch2_POPULATED)
FetchContent_Populate(Catch2)
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
endif()
The solution works great, except for the ability to restart the cmake when I am offline (no wifi and mobile network only me and my laptop).
I get the following error:
[0/7] Performing update step for 'catch2-populate'
fatal: «https://github.com/catchorg/Catch2.git/» недоступно: Could not resolve host: github.com
CMake Error at /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-subbuild/catch2-populate-prefix/tmp/catch2-populate-gitupdate.cmake:97 (execute_process):
execute_process failed command indexes:
1: "Child return code: 128"
FAILED: catch2-populate-prefix/src/catch2-populate-stamp/catch2-populate-update
cd /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-src && /usr/local/Cellar/cmake/3.20.1/bin/cmake -P /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-subbuild/catch2-populate-prefix/tmp/catch2-populate-gitupdate.cmake
ninja: build stopped: subcommand failed.
CMake Error at /usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1012 (message):
Build step for catch2 failed: 1
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1141:EVAL:2 (__FetchContent_directPopulate)
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1141 (cmake_language)
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1184 (FetchContent_Populate)
.cmake/icmake.cmake:46 (FetchContent_MakeAvailable)
CMakeLists.txt:10 (include)
-- Configuring incomplete, errors occurred!
Is it possible to download dependency one time, check revision and don't try to connect each time to remote server?
The documentation for FetchContent_Populate says you can get exactly what you want with the FETCHCONTENT_UPDATES_DISCONNECTED cache variable:
FETCHCONTENT_UPDATES_DISCONNECTED
... This ... disables the
update stage. Therefore, if content has not been downloaded
previously, it will still be downloaded when this option is enabled.
This can speed up the configure stage... It is OFF by default.
So set this one to ON globally, or for Catch2 only, set the variable FETCHCONTENT_UPDATES_DISCONNECTED_Catch2 to ON.

Install BLAS DLLs separately or there is a full package or another soloution

I am configuring a project via CMAKE 3.10.1 with MinGW.also I installed BLAS from sources(compiled with CMAKE) .I got Two DLL files. libblas.dll and liblapack.dll.I see only BLAS_blas_LIBRARY is pointed to C:/Windows/System32/libblas.dll. others not.such as :
BLAS_Accelerate_LIBRARY-NOTFOUND
BLAS_acml_LIBRARY-NOTFOUND
BLAS_acml_mp_LIBRARY-NOTFOUND
BLAS_complib.sgimath_LIBRARY-NOTFOUND
BLAS_cxml_LIBRARY-NOTFOUND
BLAS_dxml_LIBRARY-NOTFOUND
BLAS_essl_LIBRARY-NOTFOUND
BLAS_f77blas_LIBRARY-NOTFOUND
BLAS_goto2_LIBRARY-NOTFOUND
BLAS_mkl_intel_c_dll_LIBRARY-NOTFOUND
BLAS_mkl_intel_lp64_dll_LIBRARY-NOTFOUND
BLAS_openblas_LIBRARY-NOTFOUND
BLAS_scsl_LIBRARY-NOTFOUND
BLAS_sgemm_LIBRARY-NOTFOUND
BLAS_sunperf_LIBRARY-NOTFOUND
BLAS_vecLib_LIBRARY-NOTFOUND
only
BLAS_blas_LIBRARY C:/Windows/System32/libblas.dll
The CMake stop at this error :
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBLAS.cmake:699 (message):
A required library with BLAS API not found. Please specify library
location.
Call Stack (most recent call first):
CMakeLists.txt:155 (FIND_PACKAGE)
so I should install all of those DLLs separately(I searched and googled a lot,there are not integrated) or there is a full BLAS package?or problem is with something else.
here is :
my Cmake snapshot
here is :
all my instruction

QiBuild/CMake cannot not find BOOST_FILESYSTEM

I'm trying to build the C++ examples from Aldebaran like helloworld and sayhelloworld, but qiBuild keeps saying it cannot not find BOOST_FILESYSTEM. Boost is installed and working, I tested it with some other projects in Visual Studio.
This is the error after running qibuild configure -c atom1145:
[WARN ]: Nested worktrees detected:
d:\ald_sdk\naoqi-sdk-1.14.5-win32-vs2010\doc\examples is already in a worktree
(in d:\ald_sdk)
Current build worktree: d:\ald_sdk\naoqi-sdk-1.14.5-win32-vs2010\doc\examples
Using toolchain: atom1145
Build type: Debug
* (1/1) Configuring sayhelloworld
-- Using qibuild 3.7.1
-- Binary: sayhelloworld
CMake Error at D:/Programs/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find BOOST_FILESYSTEM (missing: BOOST_FILESYSTEM_LIBRARIES)
Call Stack (most recent call first):
D:/Programs/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
d:/Programs/Python27/share/cmake/qibuild/find.cmake:361 (find_package_handle_standard_args)
d:/Programs/Python27/share/cmake/qibuild/find.cmake:269 (_qi_call_fphsa)
d:/Programs/Python27/share/cmake/qibuild/modules/boostutils.cmake:39 (export_lib)
d:/Programs/Python27/share/cmake/qibuild/modules/boost_filesystem-config.cmake:9 (boost_flib)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:80 (find_package)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:158 (_qi_use_lib_get_deps)
d:/Programs/Python27/share/cmake/qibuild/stage.cmake:246 (_qi_use_lib_internal)
CMakeLists.txt:17 (qi_use_lib)
-- Configuring incomplete, errors occurred!
See also "D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/doc/examples/core/sayhelloworld/build-atom1145/CMakeFiles/CMakeOutput.log".
See also "D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/doc/examples/core/sayhelloworld/build-atom1145/CMakeFiles/CMakeError.log".
[ERROR]: ConfigureFailed Error occurred when configuring project sayhelloworld
After Boost compiled, I got the following paths:
The following directory should be added to compiler include paths:
D:/Programs/boost_1_57_0
The following directory should be added to linker library paths:
D:\Programs\boost_1_57_0\stage\lib
These are not the default path's and I guess that's causing some problems.
In the CMakeCache.txt I found that the Boost entries were "cleared":
//The directory containing a CMake configuration file for BOOST.
BOOST_DIR:PATH=d:/Programs/Python27/share/cmake/qibuild/modules
//The directory containing a CMake configuration file for BOOST_FILESYSTEM.
BOOST_FILESYSTEM_DIR:PATH=d:/Programs/Python27/share/cmake/qibuild/modules
//Cleared.
BOOST_FILESYSTEM_EXECUTABLE:STRING=
//Cleared.
BOOST_FILESYSTEM_EXECUTABLE_DEBUG:STRING=
//Cleared.
Boost_DEFINITIONS:STRING=
//Cleared.
Boost_EXECUTABLE:STRING=
//Cleared.
Boost_EXECUTABLE_DEBUG:STRING=
//Boost filesystem library (debug)
Boost_FILESYSTEM_LIBRARY_DEBUG:FILEPATH=Boost_FILESYSTEM_LIBRARY_DEBUG-NOTFOUND
//Boost filesystem library (release)
Boost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=Boost_FILESYSTEM_LIBRARY_RELEASE-NOTFOUND
//Path to a file.
Boost_INCLUDE_DIR:PATH=D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/include
//Cleared.
Boost_INCLUDE_DIRS:STRING=
//Cleared.
Boost_LIBRARIES:STRING=
I tried to add some variables to the CMakeLists.txt like this, but it didn't help:
set(Boost_DEBUG true)
set(BOOST_ROOT "D:/Programs/boost_1_57_0")
set(BOOST_INCLUDEDIR "D:/Programs/boost_1_57_0/boost")
set(BOOST_LIBRARYDIR "D:/Programs/boost_1_57_0/stage/lib")
Any help would be really appreciated!
This was the solution from the Aldebaran support:
It seems to have some incompatibilty between the NAOqi 1.14.5 C++ SDK for windows and the latest version of qibuild.
On my side I have tested with the latest version of qibuild and it gave me the same error as yours.
I will let our team now to update the documentation.
In the mean time I can propose you a workaround, ie, uninstall qibuild by using
pip uninstall qibuild and reinstall a version that is working with the NAOqi 1.14.5 C++ SDK for windows
pip install qibuild==3.5.1
This one should be working.