How to build flann in windows 10 from source? - build

I was trying to build flann from source in Windows-10 using cmake. During the installation process it says it cannot find liblz4.
I tried two method :
1) So I downloaded the prebuild lz4 from here (https://github.com/lz4/lz4/releases) and placed the C:\XXXX\Downloads\lz4_v1_9_1_win64\dll to my env path.
2) I used vcpkg to install lz4 first. Then did
C:\source\flann\build> cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\XXXXXX\source\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 15 2017 Win64".
None of the above two method worked. I still get cannot find liblz4 error.
-- Found PkgConfig: C:/XXXXXX/Downloads/cmake-3.13.3-win64-x64/bin/pkg-config.exe (found version "0.26") -- Checking for module 'liblz4' -- No package 'liblz4' found CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPkgConfig.cmake:452 (message): A required package was not found Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.13/Modules/FindPkgConfig.cmake:622 (_pkg_check_modules_internal) CMakeLists.txt:150 (pkg_check_modules) -- Configuring incomplete, errors occurred! See also "C:/XXXXXXX/source/flann/build/CMakeFiles/CMakeOutput.log".

Did you try to do as follows?(https://github.com/lz4/lz4)
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install lz4

Related

Unable to setup amazon-kinesis-video-streams-producer-sdk-cpp in Windows

I am a newcomer and I am struggling to setup amazon-kinesis-video-streams-producer-sdk-cpp in my Windows laptop. I am running this command:
cmake .. -G "Visual Studio 17 2022" -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_JNI=TRUE
but getting an error:
-- Checking for module 'gstreamer-app-1.0'
--
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/FindPkgConfig.cmake:603 (message):
A required package was not found
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.23/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal)
CMakeLists.txt:199 (pkg_check_modules)
Though, I have installed both the gstreamer-1.0-msvc-x86_64-1.20.2 and gstreamer-1.0-devel-msvc-x86_64-1.20.2 and added the env variable GSTREAMER_1_0_ROOT_MSVC_X86_64.
https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/issues/715#issuecomment-924426526
This one worked for me.
If you use the recent gstreamer for mvsc, edit your CMakefile.txt and change "C:\gstreamer\1.0\x86_64" to "C:\gstreamer\1.0\msvc_x86_64" .

"TBB library cannot be found" CMake on MacOS

I'm trying to build PrusaSlicer from source on Mac. I don't have any experience with CMake. I'm following the instructions given here.
Every time I try to build dependencies. This command cmake ..gives me errors. Earlier it was saying "Boost cannot be found." I fixed that by installing boost with brew. Now it's stuck on TBB.
OS X SDK Path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk
OS X Deployment Target: (default)
-- Boost::boost exists
CMake Error at /opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
TBB library cannot be found. Consider set TBBROOT environment variable.
(missing: TBB_LIBRARIES) (found version "2020.3")
Call Stack (most recent call first):
/opt/local/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindTBB.cmake.in:286 (find_package_handle_standard_args)
cmake/modules/FindTBB.cmake:29 (include)
CMakeLists.txt:384 (find_package)
-- Configuring incomplete, errors occurred!
I have installed TBB. If you would notice even this error has the version listed.
Things I have tried:
Installing boost, cmake and tbb via brew.
Installing boost, cmake and tbb via macports.
Try the following
cmake .. -DTBB_LIBRARYDIR=/opt/intel/tbb/lib/intel64/gcc4.8 -DTBB_INCLUDEDIR=/opt/intel/tbb/include
Note the subtle differences in the CMake var names and the path to include, not include/tbb.Let me know how that goes

vcpkg using local install of boost instead of vcpkg install

I am trying to build with cmake and vcpkg. I installed some packages including boost (iostreams, serialization and system) with vcpkg. Additionally, I have a local install of boost without these components. When i try to build, I get the following error:
C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.20/Modules/FindBoost.cmake:2344 (find_package_handle_standard_args)
C:/dev/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:770 (include)
CMakeLists.txt:168 (FIND_PACKAGE)
The CMakeCache.txt has the following line:
//Path to a file.
Boost_INCLUDE_DIR:PATH=C:/boost/boost_1_66_0
which is the path to my local install. How can I get cmake to use the boost install from vcpkg?
EDIT:
To anoyone coming to this question in the future, I came across this PR where they apparently fixed the problem. However, I still get the same error when installing OpenMVS.

Error in compiling the examples of OpenGL 4 Shading Language Cookbook, 3rd Edition

I downloaded the source code of OpenGL 4 Shading Language Cookbook, 3rd Edition from PacktPublishing github
I have downloaded the glm source code version glm-0.9.9.3 and
I have downloaded the glfw source code version glfw-3.2.1.
I successfully compiled, built and installed both glm and glfw using the "cmake ."
To find the GLFW installation, I executed the below command in the src (examples) folder
cmake -D CMAKE_PREFIX_PATH=e:\mysrcpath\glfw-3.2.1\src .
I am getting the below error
-- Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error at E:/glfw-3.2.1/src/glfw3Config.cmake:1 (include):
include could not find load file:
E:/glfw-3.2.1/src/glfw3Targets.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (find_package)
-- Found OpenGL: opengl32
-- Configuring incomplete, errors occurred!
The glfw3Config.cmake is having the code
include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
The "CMAKE_CURRENT_LIST_DIR" is
E:/glfw-3.2.1/src/
But the glfw3Targets.cmake is located in
E:/glfw-3.2.1/CMakeFiles/Export/lib/cmake/glfw3/
The 'cmake' build is not able to find the glfw3Targets.cmake in the correct path.
How to fix this issue?
It seem like GLFW version 3.2.1 does not support using it directly from the build tree. You should install GLFW instead and add the directory to the cmake prefix paths.
in the glfw directory:
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=c:/local/ ..
cmake --build . --target install
Then when invoking cmake for your projects:
cmake -D CMAKE_PREFIX_PATH=c:/local/

qttorch Build Error Ubuntu 14.04

I'm trying to install qttorch package on Ubuntu 14.04,
but I get this error during installation:
CMake Warning at /usr/share/cmake-3.2/Modules/FindQt4.cmake:626 (message):
/usr/bin/qmake reported QT_INSTALL_LIBS as "/usr/lib/x86_64-linux-gnu" but
QtCore could not be found there. Qt is NOT installed correctly for the
target build environment.
Call Stack (most recent call first):
CMakeLists.txt:38 (FIND_PACKAGE)
CMake Error at /usr/share/cmake-3.2/Modules/FindQt4.cmake:634 (message):
Could NOT find QtCore. Check
/tmp/luarocks_qtlua-scm-1-2765/qtlua/build/CMakeFiles/CMakeError.log for
more details.
Call Stack (most recent call first):
CMakeLists.txt:38 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "/tmp/luarocks_qtlua-scm-1-2765/qtlua/build/CMakeFiles/CMakeOutput.log".
Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/qtlua-scm-1.rockspec - Build error: Failed building.
Is libqtcore4 the right package for QTCore? or is there another package that should be installed?
because it's already installed in "/usr/lib/x86_64-linux-gnu" as qmake reported!
I also tried reinstalling it, but still the same error!!
In most Linux distributions the packages are split between development and none-development parts. Usually the normal package only includes the shared library, data and executables while the dev package adds headers, static libraries and build tools like qmake. I assume this split is done to save space.
For ubuntu the dev packages usually has the -dev suffix. So try if a libqtcore4-dev package exists. Otherwise, libqt4-dev should include it.