how to build gst-rtsp-server on windows? - meson-build

i got source code form https://github.com/GStreamer/gst-rtsp-server,
then i follow https://mesonbuild.com/Getting-meson.html to Installing Meson and Ninja with the MSI installer.
but when i run build it seems like not correct.
D:\>cd gst-rtsp-server-master
D:\gst-rtsp-server-master>meson build
The Meson build system
Version: 0.56.0
Source dir: D:\gst-rtsp-server-master
Build dir: D:\gst-rtsp-server-master\build
Build type: native build
Project name: gst-rtsp-server
Project version: 1.19.0.1
C compiler for the host machine: clang (clang 8.0.0 "clang version 8.0.0 (tags/RELEASE_800/final)")
C linker for the host machine: clang link 14.16.27042.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports link arguments -Wl,-Bsymbolic-functions: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Message: Disabling deprecated GLib API
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wredundant-decls: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wwrite-strings: YES
Compiler for C supports arguments -Wformat: YES
Compiler for C supports arguments -Wformat-nonliteral: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Waggregate-return: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Waddress: YES
Compiler for C supports arguments -Wno-multichar: YES
Compiler for C supports arguments -Wdeclaration-after-statement: YES
Compiler for C supports arguments -Wvla: YES
Compiler for C supports arguments -Wpointer-arith: YES
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency glib-2.0 found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency glib-2.0
meson.build:136:0: ERROR: Neither a subproject directory nor a glib.wrap file was found.
A full log can be found at D:\gst-rtsp-server-master\build\meson-logs\meson-log.txt
i am totaly confused.please help...

This is not really trivial on windows. I performed the following steps to pull this off:
Install visual studio 2019
Install gstreamer vs2019 edition with developer headers
Install Ninja-build
Install meson: python -m pip install meson
Open a x64 visual studio command shell
Update your path variable in this shell: set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH% (note that pkg-config is included in the installation of gstreamer).
cd to your path where you cloned gst-rtsp-server
Run meson setup: meson setup build
Compile the rtsp code meson compile -C build
Run build\examples\test-readme.exe
Connect to the rtsp stream using VLC

Related

How to change compiler, which is detected by meson?

On my pc I have compiler gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.
I would like to compile gstreamer source code, where is meson.build.
In meson.build, there is line:
cc = meson.get_compiler('c')
In user's path I set CC to gcc. When I start meson using command:
meson /path/to/directory I see that meson select gcc (gcc 8.1.0 "gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0"). How can I change that?
I tried cc=gcc too.
My cpu is AMD 64bit.

Couldn't find LibSSH on msys2 even the libssh-devel has installed with pacman

I'm trying to compile the libnetconf2 with msys2 environment on Windows 10 OS. But I get a wired(I guess) issue about libssh.
I have installed libssh libssh2 libssh-devel libssh2-devel and the pkg-config also find the location of libssh:
$ pkg-config --list-all
autoopts AutoOpts - A semi-automated generated/library option parser
form formw - ncurses 6.2 add-on library
formw formw - ncurses 6.2 add-on library
libalpm libalpm - Arch Linux package management library
libcrypto OpenSSL-libcrypto - OpenSSL cryptography library
libmagic libmagic - Magic number recognition library
libpcre libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libpcre16 libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support
libpcre2-16 libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support
libpcre2-32 libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support
libpcre2-8 libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support
libpcre2-posix libpcre2-posix - Posix compatible interface to libpcre2-8
libpcre32 libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support
libpcrecpp libpcrecpp - PCRECPP - C++ wrapper for PCRE
libpcreposix libpcreposix - PCREPosix - Posix compatible interface to libpcre
libpkgconf libpkgconf - a library for accessing and manipulating development framework configuration
libssh libssh - The SSH Library
libssh2 libssh2 - Library for SSH-based communication
libssl OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
$ pkg-config --modversion libssh
0.9.6
And then run the command "cmake .." in
libnetconf2/build
, which gives the error:
$ cmake ..
CMake Warning at CMakeLists.txt:171 (message):
valgrind executable not found! Disabling memory leaks tests.
-- Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) (Required is at least version "1.0.1")
-- Disabling tests because of missing CMocka
-- Could NOT find Uncrustify (missing: UNCRUSTIFY) (Required is at least version "0.71")
-- OpenSSL found, required for TLS
CMake Error at /usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LibSSH (missing: LIBSSH_LIBRARIES) (Required is at least
version "0.7.1")
Call Stack (most recent call first):
/usr/share/cmake-3.21.3/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMakeModules/FindLibSSH.cmake:113 (find_package_handle_standard_args)
CMakeLists.txt:239 (find_package)
-- Configuring incomplete, errors occurred!
And then I try to compile libssh from source code, after compiling and installation, the cmake still can't find the correct libssh (Below is the log for libssh compile and install):
$ make install
Consolidate compiler generated dependencies of target ssh
[ 58%] Built target ssh
Consolidate compiler generated dependencies of target libssh_scp
[ 63%] Built target libssh_scp
Consolidate compiler generated dependencies of target sshnetcat
[ 68%] Built target sshnetcat
Consolidate compiler generated dependencies of target ssh-client
[ 73%] Built target ssh-client
Consolidate compiler generated dependencies of target scp_download
[ 78%] Built target scp_download
[ 80%] Built target libsshpp
Consolidate compiler generated dependencies of target samplesshd-cb
[ 82%] Built target samplesshd-cb
Consolidate compiler generated dependencies of target senddata
[ 87%] Built target senddata
Consolidate compiler generated dependencies of target exec
[ 92%] Built target exec
Consolidate compiler generated dependencies of target libsshpp_noexcept
[ 94%] Built target libsshpp_noexcept
Consolidate compiler generated dependencies of target keygen
[ 96%] Built target keygen
Consolidate compiler generated dependencies of target samplesftp
[100%] Built target samplesftp
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/pkgconfig/libssh.pc
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-version.cmake
-- Installing: /usr/local/include/libssh/callbacks.h
-- Installing: /usr/local/include/libssh/libssh.h
-- Installing: /usr/local/include/libssh/ssh2.h
-- Installing: /usr/local/include/libssh/legacy.h
-- Installing: /usr/local/include/libssh/libsshpp.hpp
-- Installing: /usr/local/include/libssh/sftp.h
-- Installing: /usr/local/include/libssh/server.h
-- Installing: /usr/local/include/libssh/libssh_version.h
-- Installing: /usr/local/lib/libssh.dll.a
-- Installing: /usr/local/bin/msys-ssh-4.dll
-- Installing: /usr/local/lib/cmake/libssh/libssh-config.cmake
-- Installing: /usr/local/lib/cmake/libssh/libssh-config-noconfig.cmake
BTW, the LD_LIBRARY_PATH has added:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
I have resolved this issue as the link:
Libgit2 and libssh2 CMake package 'libssh2' not found
/usr/local is the prefix path that I compiled and installed the libssh from source code.
cmake -DLIBSSH_INCLUDE_DIRS=/usr/local/include/libssh -DLIBSSH_LIBRARIES=/usr/local/lib/ ..

Packaged build environment as build_requires of profiles, system compiler is used instead

I will try to describe my setup first:
conan 1.29.2
Official cmake/3.18.2 package
Custom gcc package with package_info including its bin directory in PATH and setting the CC and CXX env variables:
def package(self):
autotools = AutoToolsBuildEnvironment(self)
autotools.make(target='install-strip')
def package_info(self):
bin_folder = os.path.join(self.package_folder, 'bin')
self.env_info.path.append(bin_folder)
self.env_info.CXX = os.path.join(bin_folder, 'g++')
self.env_info.CC = os.path.join(bin_folder, 'gcc')
linux-x86_64 conan profile representing Linux 64 bit environment as follows:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
linux-x86_64-Debug conan profile representing Linux 64 bit Release environment as follows:
include(linux-x86_64)
[settings]
build_type=Debug
gcc-10.1.0 conan profile to build packages using my gcc package:
[settings]
compiler=gcc
compiler.version=10.1
compiler.libcxx=libstdc++11
[build_requires]
gcc/10.1.0
cmake-3.18.2 conan profile to build packages using official cmake package:
[build_requires]
cmake/3.18.2
default conan profile with gcc 7
If I try to build a package as follows:
$ conan create . foo/version --build=missing -pr linux-x86_64-Debug -pr cmake-3.18.2 -pr gcc-10.1.0
the resulting config is:
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=10.1
os=Linux
os_build=Linux
[options]
[build_requires]
*: gcc/10.1.0, cmake/3.18.2
[env]
which looks right to me...
and then conan starts building cmake package for the gcc 10.1 x86_64 config:
cmake/3.18.2: WARN: Build folder is dirty, removing it: /home/manuel/.conan/data/cmake/3.18.2/_/_/build/46c0026dddc0e0537a797652343e8e1e9d0e39e7
cmake/3.18.2: Copying sources to build folder
cmake/3.18.2: Building your package in /home/manuel/.conan/data/cmake/3.18.2/_/_/build/46c0026dddc0e0537a797652343e8e1e9d0e39e7
cmake/3.18.2: Generator cmake created conanbuildinfo.cmake
cmake/3.18.2: Calling build()
But then build fails because the cmake package cmake config is using the system compiler:
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Compiler GCC>=5, checking major version 10.1
-- Conan: Checking correct version: 7.4
CMake Error at ../conanbuildinfo.cmake:510 (message):
Detected a mismatch for the compiler version between your conan profile
settings and CMake:
Compiler version specified in your conan profile: 10.1
Compiler version detected in CMake: 7.4
Please check your conan profile settings (conan profile show
[default|your_profile_name])
P.S. You may set CONAN_DISABLE_CHECK_COMPILER CMake variable in order to
disable this check.
Call Stack (most recent call first):
../conanbuildinfo.cmake:592 (conan_error_compiler_version)
../conanbuildinfo.cmake:695 (check_compiler_version)
../conanbuildinfo.cmake:249 (conan_check_compiler)
CMakeLists.txt:9 (conan_basic_setup)
This looks very similar to https://github.com/conan-io/conan/issues/1842, but that issue is from 3 years ago.
Conan learned some versions ago about host and build contexts and is able to manage different configurations for those contexts. This is preferred over the old os_build and arch_build settings and packages in ConanCenter are moving towards this new feature.
In your scenario, you are trying to build a library using packages gcc and cmake as build-requires. You are building library for the host machine and using package gcc and cmake that provide tools that should run in the build machine. Even if you are not cross-compiling, we can agree that native building is just a specific use-case where host and build are the same machine and, hence, they use the same Conan configuration.
Back to your example. You need your profiles for the host platform, the one you want to generate your library for. These are all the profiles you have listed in your question. But you also need a profile for the build context, the profile that Conan will use to build (or retrieve) the gcc and cmake packages. For example, you might want to use a profile linux-x86_64-Debug to compile your library in debug mode, while using gcc and cmake in Release.
Typically, the profile for your build context can be the default profile detected by Conan.
Try this command instead of yours (note the --profile:build=default):
conan create <library/conanfile.py> foo/version --build=missing --profile:host linux-x86_64-Debug --profile:host cmake-3.18.2 --profile:host gcc-10.1.0 --profile:build=default
Now Conan will use the new feature and assign the package to the corresponding contexts:
library and all its dependencies will be assigned to the host context and will use information from all the --profile:host profiles: your Debug build and Conan will add cmake and gcc as build-requires.
gcc and cmake, as they are build-requires in this command, will be assigned to the build context and will use the information from the --profile:build. If Conan needs to build these packages it will use the settings from that profile, not the settings for the host profiles.
With this setup you can build all packages in a cross-building scenario in a single run: packages in the host context will use your build-requires gcc to build, while packages in the build context will use the tools defined in the --profile:build.
Yes, in this scenario, packages in the build context will use the compiler from your system.... unless you declare [build_requires] inside the --profile:build.

How to make cmake identify correct version in centos 6 terminal?

After a very long and lengthy process of trying to get Emscripten going. I'm stuck trying to build fastcomp.
cmake .. -DCMAKE_BUILD_TYPE=Release
-DLLVM_TARGETS_TO_BUILD="X86;JSBackend" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_INCLUDE_TESTS=OFF
It gives this error:
CMake Error at cmake/modules/CheckCompilerVersion.cmake:12 (message):
Host GCC version must be at least 4.8!
I've installed devtools 2 and actiavted the toolset.
gcc --version reads as using gcc 4.8.2, but it just won't go.
I've also tried:
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
What am I doing wrong?
I had this same problem until I recompiled a recent version of cmake with the newer version of gcc already "activated".
Then, with the CC, CXX and CPP environment variables also set to the appropriate paths, cmake then stopped giving that "Host GCC version must be at least 4.8!" error.

CMAKE_SYSTEM_NAME blank?

I am trying to compile for Linux (with Generator Eclipse CDT4 - Ninja) but when I am checking for ${CMAKE_SYSTEM_NAME} in CMakeLists.txt, all I get is blank.
In which scenarios is using this variable valid?
Using cmake 3.02 from Debian Testing.
You need to place CMAKE_SYSTEM_NAME after project command:
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
project(Foo)
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
Result:
CMAKE_SYSTEM_NAME:
-- The C compiler identification is GNU 4.9.1
...
-- Detecting CXX compiler ABI info - done
CMAKE_SYSTEM_NAME: Linux
I have the same issue, and work it out.
All i want to do is cross compile on Linux server with aarch64-himix100-linux, and compile with the default toolchain on Darwin system.
I use CMAKE_HOST_SYSTEM_NAME instead of CMAKE_SYSTEM_NAME.
The value of CMAKE_HOST_SYSTEM_NAME is equal to the output of uname -s.
For example,
cmake_minimum_required(VERSION 3.8)
if (NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/Toolchain-aarch64-himix100-linux.cmake")
endif ()
project(phoenix)