webkitgtk build ( WebP libraries were not found when I have installed the webp library) - cmake

when I build the webkitgtk-2.34.6 on Ubuntu 20.04.3 LTS, using the following command:(Follow the official documentation)[https://trac.webkit.org/wiki/BuildingGtk]
cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
"WebP libraries were not found" error appear:
-- The CMake build type is: RelWithDebInfo
-- Could NOT find Ruby (missing: RUBY_INCLUDE_DIR RUBY_LIBRARY RUBY_CONFIG_INCLUDE_DIR) (found suitable version "2.7.0", minimum required is "1.9")
-- Enabling ccache: Couldn't find ccache program. Not enabling it.
-- Performing Test C_COMPILER_SUPPORTS_-fdiagnostics-color=always
-- Performing Test C_COMPILER_SUPPORTS_-fdiagnostics-color=always - Success
-- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always
-- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always - Success
-- Found the following HarfBuzz libraries:
-- HarfBuzz (required): /usr/lib/x86_64-linux-gnu/libharfbuzz.so
-- ICU (required): /usr/lib/x86_64-linux-gnu/libharfbuzz-icu.so
-- Found the following ICU libraries:
-- data (required)
-- i18n (required)
-- uc (required)
-- The following WebP libraries were not found:
-- WebP (required)
-- demux (required)
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find WebP (missing: WebP_INCLUDE_DIR WebP_LIBRARY
_WebP_REQUIRED_LIBS_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
Source/cmake/FindWebP.cmake:133 (find_package_handle_standard_args)
Source/cmake/WebKitFindPackage.cmake:105 (_find_package)
Source/cmake/OptionsGTK.cmake:25 (find_package)
Source/cmake/WebKitCommon.cmake:220 (include)
CMakeLists.txt:20 (include)
-- Configuring incomplete, errors occurred!
See also "/home/crz/SerialscreenWebkit/CMakeFiles/CMakeOutput.log".
See also "/home/crz/SerialscreenWebkit/CMakeFiles/CMakeError.log".
but I have installed the webp library using the following command
sudo apt-get install -y webp
Reading package lists... Done
Building dependency tree
Reading state information... Done
webp is already the newest version (0.6.1-2ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.

use this command
sudo apt install libwebp-dev

Related

How to force CMake to use a special version of Protobuf installed on system?

I want to set Protobuf_INCLUDE_DIRS to a directory of my choosing, however, I am not sure how to do that.
$ locate FindProtobuf.cmake
/usr/share/cmake-3.16/Modules/FindProtobuf.cmake
I can see that in FindProtobuf.cmake, we have these:
if(Protobuf_FOUND)
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
endif()
I want it to be set to the second option here:
$ which -a protoc
/home/mona/anaconda3/bin/protoc
/usr/local/bin/protoc
However, it is set to the first option /home/mona/anaconda3/bin/protoc despite forcing it in ~/.bashrc to second option: /usr/local/bin/protoc using below command: alias protoc=/usr/local/bin/protoc
The version that my program requires is 3.6.1 and alias protoc=/usr/local/bin/protoc assures that. However, ProtobufCMake forces the path to be /home/mona/anaconda3/bin/protoc and that version is 3.13.0.
A bit about the problem I am facing. I am using openpose and for installing it in Ubuntu 20.04, I am using CMake. It requires the protobuf version to be 3.6.1.
More on here https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1817
Here are the messages:
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:469 (file):
file STRINGS file "/usr/include/google/protobuf/stubs/common.h" cannot be
read.
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:475 (math):
math cannot parse the expression: " / 1000000": syntax error, unexpected
exp_DIVIDE (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:476 (math):
math cannot parse the expression: " / 1000 % 1000": syntax error,
unexpected exp_DIVIDE (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:477 (math):
math cannot parse the expression: " % 1000": syntax error, unexpected
exp_MOD (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Warning at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:499 (message):
Protobuf compiler version 3.13.0 doesn't match library version
ERROR.ERROR.ERROR
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
Not sure how exactly do what I wanted to do above, but a hack to get CMake work for OpenPose is using Python venv and comment the anaconda python activation lines in ~/.bashrc:
Now, cmake-gui .. throws no error:
GCC detected, adding compile flags
GCC detected, adding compile flags
Building with CUDA.
CUDA detected: 10.1
Added CUDA NVCC flags for: sm_75
cuDNN not found
Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
Caffe will be downloaded from source now. NOTE: This process might take several minutes depending
on your internet connection.
Caffe has already been downloaded.
HEAD is now at 1807aada Added Ampere arch's (CUDA11)
Caffe will be built from source now.
Download the models.
Downloading BODY_25 model...
Model already exists.
Not downloading body (COCO) model
Not downloading body (MPI) model
Downloading face model...
Model already exists.
Downloading hand model...
Model already exists.
Models Downloaded.
Configuring done
I have this in ~/.bashrc:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
##__conda_setup="$('/home/mona/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
##if [ $? -eq 0 ]; then
## eval "$__conda_setup"
##else
## if [ -f "/home/mona/anaconda3/etc/profile.d/conda.sh" ]; then
## . "/home/mona/anaconda3/etc/profile.d/conda.sh"
## else
## export PATH="/home/mona/anaconda3/bin:$PATH"
## fi
##fi
and installed the following in Ubuntu 20.04:
$ sudo apt-get install python3
$ sudo apt-get install python3-venv
also, do this in ~/.bashrc and source it: alias python=python3
$ python -m venv ~/venv/openpose
$ source ~/venv/openpose/bin/activate

Cmake when building LLVM

Trying to build llvm project LLVM Project with CMake, it gives me an error that I can't solve by my own.
For doing this, I am using an Ubuntu Virtual Machine (version 18.04) and I am trying to build the project with "ninja".
I have tried to build this with the following commands (which the LLVM Builder Guide says to use, https://llvm.org/docs/GettingStarted.html)
git clone https://github.com/llvm/llvm-project.git
cd llvm-project/
mkdir build && cd build
cmake -DLLVM_ENABLE_PROJECTS='all' -DCMAKE_BUILD_TYPE=Release -G 'Ninja' ../llvm
At the last command, I use the first flag to download all the projects and the second because I do not need the Debug tools.
The last command gives me the following error several times with different targets:
CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:219 (add_libgo_variant)
And this library error:
-- LLD version: 10.0.0
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LibEdit (missing: libedit_INCLUDE_DIRS libedit_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/FindLibEdit.cmake:54 (find_package_handle_standard_args)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/LLDBConfig.cmake:104 (find_package)
/home/enrique/Escritorio/llvm-project/lldb/CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeOutput.log".
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeError.log".
I had the same issue, tried uninstalling the golang compiler (because I don't need llvm support for go); to no avail. I'm not an LLVM expert so this might not be the canonical solution but here's how I solved it:
I replaced
-DLLVM_ENABLE_PROJECTS='all'
by
-DLLVM_ENABLE_PROJECTS="proj1;proj2;proj3"
where I built the list "proj1;proj2;proj3" by grepping project is enabled$ in cmake output and removed the llgo project. I got a list like:
-- clang project is enabled
-- clang-tools-extra project is enabled
-- compiler-rt project is enabled
-- debuginfo-tests project is enabled
-- libclc project is enabled
-- libcxx project is enabled
-- libcxxabi project is enabled
-- libunwind project is enabled
-- lld project is enabled
-- lldb project is enabled
-- llgo project is enabled
-- openmp project is enabled
-- parallel-libs project is enabled
-- polly project is enabled
-- pstl project is enabled
and then built the following list with some vim macros/whatever you master (note: no llgo in there):
clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;openmp;parallel-libs;polly;pstl
Then compiling llvm succeeded \o/

The following ICU libraries were not found: -- i18n (required)

I have to build miktex source code. I install source code from github they give me link to build it: https://miktex.org/howto/build-mac.
I follow the steps given in the link. When I run
cmake ../source
I got error:
INFOfribidi libs: /usr/local/Cellar/fribidi/1.0.5/lib/libfribidi.dylib
INFOfribidi incs:
/usr/local/Cellar/fribidi/1.0.5/include/fribidi;/usr/local/Cellar/fribidi/1.0.5/include
-- The following ICU libraries were not found:
-- i18n (required)
-- uc (required)
CMake Error at /usr/local/Cellar/cmake/3.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY _ICU_REQUIRED_LIBS_FOUND)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.12.2/share/cmake/Modules/FindICU.cmake:317 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:1032 (find_package)
-- Configuring incomplete, errors occurred! See also "/Users/afnisaeed/Desktop/CMakeFiles/CMakeOutput.log".
Extra information:
echo $CMAKE_PREFIX_PATH
/opt/icu4c:/opt/openssl:/opt/icu4c:/opt/qt:$ {brewprefix}/opt/icu4c:/opt/openssl:/opt/icu4c:/opt/qt:/usr/local/Cellar/qt5/5.7.0/
I know nothing at all about miktex or fribidi so this may not be of any assistance at all, however your build system seems to be having difficulty finding something to do with ICU - whatever that is.
If you run:
brew info icu4c
it tells you a whole load of stuff about the package being "keg-only" which means the stuff it provides (headers and libraries) is installed, but not where any other package will find it. Then it gives you the following specific advice:
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
So, I suspect you have not done the last 2 sections, and you need to do something like:
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/icu4c/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/icu4c/include"
export PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:"$PKG_CONFIG_PATH"
I had the same error while trying to use find_package(ICU ...) on my Mac (installed ICU via brew). This error seems to be related to the fact the Mac already has ICU preinstalled (however not all of it's components) - that's why CMake complaints that some components are missing (ICU_INCLUDE_DIR, ICU_LIBRARY, ...).
The solution for me was to manually specify the ICU_ROOT variable in CMakeLists.txt (which targets CMake to the brew-installed ICU version instead of MacOS preinstalled version):
set (ICU_ROOT /usr/local/Cellar/icu4c/67.1)
I solved this issue by installing the missing Debian package libicu-dev via:
apt-get install libicu-dev
Please note that this might also work for Ubuntu and its derivates.

CMake: Could NOT find CSharp in Ubuntu

CMake newbie here!
I'm trying to build Malmo project on my linux machine (Ubuntu 16.04) following https://github.com/Microsoft/malmo/blob/master/doc/build_linux.md
However I'm stuck at cmake command: cmake -DCMAKE_BUILD_TYPE=Debug ..
The error that I'm getting is Could NOT find CSharp (missing: CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER). Below is the full error message.
aerin#aerin-HP-Z230-Tower-Workstation:~/MalmoPlatform/build$ cmake -DCMAKE_BUILD_TYPE=Debug ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- chrono
-- date_time
-- filesystem
-- iostreams
-- program_options
-- python
-- regex
-- system
-- thread
-- atomic
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find CSharp (missing: CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/FindCSharp.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:121 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/aerin/MalmoPlatform/build/CMakeFiles/CMakeOutput.log".
See also "/home/aerin/MalmoPlatform/build/CMakeFiles/CMakeError.log".
How do I make cmake to find Csharp here?
I followed #Beefster advice. Installing mono resolved the issue.
Add the Mono repository to your system
(Ubuntu 16.04)
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
Install Mono
sudo apt-get install mono-devel

Errors when downloading emscripten

I want to download emscripten on ubuntu 12.04.I downloaded Cmake 3.3.0 then I download esmscripten_portable and I run these commands:
# Fetch the latest registry of available tools.
./emsdk update
# Download and install the latest SDK tools.
./emsdk install latest
I got these error messages:
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
CMake Error at cmake/modules/HandleLLVMOptions.cmake:17 (message):
Host GCC version must be at least 4.7!
Call Stack (most recent call first):
CMakeLists.txt:378 (include)
-- Configuring incomplete, errors occurred!
See also "/home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/build_tag-e1.34.3_32/CMakeFiles/CMakeOutput.log".
See also "/home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/build_tag-e1.34.3_32/CMakeFiles/CMakeError.log".
CMake invocation failed due to exception!
Working directory: /home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/build_tag-e1.34.3_32
Command '['cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DPYTHON_EXECUTABLE=/usr/bin/python', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '/home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/src']' returned non-zero exit status 1
Installation failed!
I installed all these libraries very well but when I run this command:./emsdk activate latest.I got this message:The Emscripten configuration file /home/slim/.emscripten has been rewritten with the following contents:
import os
SPIDERMONKEY_ENGINE = ''
NODE_JS = 'node'
LLVM_ROOT='/home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/build_tag-e1.34.3_32/bin'
EMSCRIPTEN_ROOT='/home/slim/Bureau/emsdk_portable/emscripten/tag-1.34.3'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/slim/Bureau/emsdk_portable/emscripten/tag-1.34.3_32bit_optimizer/optimizer'
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
To conveniently access the selected set of tools from the command line, consider adding the following directories to PATH, or call 'source ./emsdk_env.sh' to do this for you.
/home/slim/Bureau/emsdk_portable:/home/slim/Bureau/emsdk_portable/clang/tag-e1.34.3/build_tag-e1.34.3_32/bin:/home/slim/Bureau/emsdk_portable/emscripten/tag-1.34.3
I run :
source ./emsdk_env.sh
But when I run the command :
./emcc v
I got :
bash: ./emcc: No such file or directory