conan SDL install is mistaken about my xcode version - sdl

My conan install is failing reporting that my xcode version is 12, but I'm using 13.
I'm using the following conanfile.txt:
[requires]
sdl/2.0.20
boost/1.78.0
[generators]
cmake
When I run the conan install command, I get the following output:
conanfile.txt: Installing package
Requirements
boost/1.78.0 from 'conancenter' - Cache
bzip2/1.0.8 from 'conan-center' - Cache
libbacktrace/cci.20210118 from 'conancenter' - Cache
libiconv/1.16 from 'conan-center' - Cache
sdl/2.0.20 from 'conancenter' - Cache
zlib/1.2.11 from 'conan-center' - Cache
Packages
boost/1.78.0:c4194498ccd62223a5ff00fea57b4a976343c0a7 - Cache
bzip2/1.0.8:32bef4803d4b079e983ecb27f105881e778bc5a7 - Cache
libbacktrace/cci.20210118:f74366f76f700cc6e991285892ad7a23c30e6d47 - Cache
libiconv/1.16:f74366f76f700cc6e991285892ad7a23c30e6d47 - Cache
sdl/2.0.20:INVALID - Invalid
zlib/1.2.11:f74366f76f700cc6e991285892ad7a23c30e6d47 - Cache
Installing (downloading, building) binaries...
ERROR: There are invalid packages (packages that cannot exist for this configuration):
sdl/2.0.20: Invalid ID: sdl/2.0.20 requires xcode 12 or higher
I'm using the following versions:
macOs Monterey (12.2.1)
XCode 13.2.1
conan 1.45.0
Python 3.8.2
cmake 3.17.0
I have looked at the recipe on the conan site:
https://conan.io/center/sdl?tab=recipe&os=Macos
But I am not able to see how it's getting the xcode version wrong, and I don't know where to begin.
And I see the check in the recipe only applies to SDL > 2.0.16. Conan install works fine with 2.0.16 but I need the newer version.
If anyone has any help in getting started in tracking this down I would really be grateful.

Related

Cmake and PugiXML in Github Actions

i try to get pugixml running in github actions. And i would be happy with any solution that is working...
I added the download to the cmake.yml
run: sudo apt-get update && sudo apt-get install libsystemd-dev libpugixml-dev
Ubuntu inside github action is installing 1.10-1:
Get:1 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml1v5 amd64 1.10-1 [89.9 kB]
Get:2 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml-dev amd64 1.10-1 [105 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 libsystemd-dev amd64 245.4-4ubuntu3.11 [246 kB]
On my private machine i use Debian testing, where Version: 1.11.4-1 of pugixml is installed.
CMake now tells, that it could not find version 1.10 or higher. It looks like ubuntu's version tag is not correct (?). Is there a way to debug inside these github-actions?
CMake Deprecation Warning at plog/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Checking for module 'libsystemd'
-- Found libsystemd, version 245
CMake Error at CMakeLists.txt:20 (find_package):
Could not find a configuration file for package "pugixml" that is
-- Configuring incomplete, errors occurred!
compatible with requested version "1.10".
See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeOutput.log".
See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeError.log".
The following configuration files were considered but not accepted:
/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown
/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown
I solved it by using vcpkg to install pugixml:
- name: Install pugixml via vcpkg
run: sudo vcpkg install pugixml && sudo vcpkg integrate install
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

Issue Building C++ package with cmake: using Python .dylib, using 2.7 rather rather than 3.8, OS X

I'm trying to build a C++ "Plug-in" that is part of "Orthanc" (Open Source Project). I've been doing that on both UBUNTU and OS X, but I'm having trouble using a version of Python other than the system installed version (High Sierra, Python 2.7) on OS X. I've tried installing Python 3.8 using the OS X package from the Python website and also using HomeBrew. I'm not real familiar with compiling stuff of OS X, but a little better on UNIX.
The CMakeLists.txt file is fairly long, but the relevant parts are probably:
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
# The Python version cannot be controlled on OS X (yet)
set(PYTHON_VERSION "3.6" CACHE STRING "Version of Python to be used")
endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
find_package(PythonLibs)
if (NOT PYTHONLIBS_FOUND)
message(FATAL_ERROR "Cannot find the Python libraries")
endif()
message("Python library - Found version: ${PYTHONLIBS_VERSION_STRING}")
message("Python library - Path to include directory: ${PYTHON_INCLUDE_DIRS}")
message("Python library - Shared library: ${PYTHON_LIBRARIES}")
In the actual build there are a few lines of output about Python. The CLI for the build is:
cmake -DPYTHON_VERSION=3.8 -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../
although I've tried various things for the 3.8, but it always defaults back to 2.7.
-- Found PythonInterp: /usr/bin/python (found version "2.7.16")
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.16")
Python library - Found version: 2.7.16
Python library - Path to include directory: /usr/include/python2.7
Python library - Shared library: /usr/lib/libpython2.7.dylib
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
My .bash_profile is probably messed up, but this is the most recent version. I have installed both the 3.8 version using brew and the version from the .pkg on the Python website.
source ~/.profile
export NVM_DIR="/Users/sscotti/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
# The version installed with HomeBrew
# export PATH="/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/Cellar/python#3.8/3.8.5/bin:$PATH"
# The version installed with OS X installer
# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
##
# Homebrew bash completion
##
if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion
fi
Seems that maybe:
find_package(PythonLibs)
is not finding my other version of Python ?
Any suggestions appreciated.
Just getting started with Python, and it is a little confusing about how to set up a couple of different version of Python for development purposes. I don't know if the brew or .pkg version of Python have the "dev packages" included.
Just a follow up to my question. I found that if I explicitly defined that paths for -DPYTHON_LIBRARY= and -DPYTHON_INCLUDE_DIR in the cmake, then it compiles fine and I can use various versions of Python on OS X if I want. I would imagine there is another more elegant way, but this works pretty well.
cmake -DPYTHON_LIBRARY=/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8/ -DPYTHON_VERSION=3.8 -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../

Cannot install llvm-9 or clang-9 on Ubuntu 16.04

I have not been able to install either llvm version 9 or clang version 9 on Ubuntu. We have installed them on Windows.
I have tried a command and saw this response.
sudo apt-get install llvm-9
Reading package lists... Done
Building dependency tree
Reading state information...
Done E: Unable to locate package llvm-9
I have also tried and saw this response.
sudo apt-get install clang-9
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package clang-9
My /etc/apt/sources.list file contains
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9.0 main
I found the website and saw that the folder was llvm-toolchain-xenial-9. Trying that version did not work either.
What else can I do?
I have looked at downloading the binaries but am not sure what installation steps I might be missing. I am not interested in compiling source code.
The Clang/LLVM project provides Nightly build packages for Ubuntu and Debian.
See the https://apt.llvm.org
The goal is to provide Debian and Ubuntu [Clang and LLVM] packages ready to be installed with minimal impact on the distribution.
Packages are available for amd64 and i386 (except for recent Ubuntu) and for both the stable, old-stable and development branches (currently 8, 9 and 10).
Packages are built using stage2 and extremely similar to the one shipping in Debian & Ubuntu.
To use:
Add the appropriate repositories to the /etc/apt/sources.list file; there are distinct repos for different Debian and Ubuntu versions.
Add the apt key (shown in the link).
Run an apt update to refresh the cache.
Add packages with apt install clang-9 (or other package as desired).
If something "did not work" using the vetted package system, diagnose that issue directly. Xenial has Clang/LLVM 9 packages, and I've recently installed the packages into Disco.
The described symptom ("Unable to locate package") sounds as though one neglected to run apt update, in which case the packages from the newly-added sources would not be visible to apt. This is a tool-usage issue, not a lack of available packages.
LLVM INSTALLATION STEPS
-----------------------
LLVM Compiler Prerequisites:
OPERATING SYSTEM : Ubuntu 16.04 LTS
RAM : Minimum 16GB to 32GB
SWAP MEMORY : Minimum 10GB to 20GB
MEMORY NEEDED : Minimum 70GB
Install CMake version 3.5.1:
$sudo apt install cmake
LLVM Compiler Installation Steps
Step1:
#download llvm from https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz
#download clang from https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/cfe-8.0.1.src.tar.xz
#extract files into folders:
tar -xf cfe-8.0.1.src.tar.xz
tar -xf llvm-8.0.1.src.tar.xz
#change directory names to llvm8 and clang
mv cfe-8.0.1.src clang
mv llvm-8.0.1.src llvm8
Step2 : #change present working directory to llvm_source_directory here it is llvm8
$cd llvm8
##create build directory
$mkdir build
##change pwd to build directory
$cd build
#Build (PATH =/llvm8/build)
#execute following command in build directory:
$cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../
Step3: #execute make command in pwd:
/llvm8/build$ make
Step4 : #after 100% of linking process execute following command in build directory:
$sudo make install
$ sudo reboot
step5 : #after installation restart your system!
#for checking llvm installation type
$llvm-config --version #it shows 8.0.1
$clang --version #it shows 8.0.1
Here are the commands for LLVM 9:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get update
sudo apt-get install clang-9 libclang-9-dev llvm-9-dev

How to use latest boost version in Travis CI?

I tried to install boost 1.64 in Travis CI environment in several way. But none of them was succeeded.
In my first naive attempt I just added following line in travis script:
install:
- sudo apt-get install libboost1.64-all-dev
The result was error message: cannot find package libboost1.64-all-dev
In second attempt I specified repository with necessary boost version.
before_install:
- sudo add-apt-repository -y ppa:nschloe/boost-nightly
- sudo apt-get update -qq
install:
- sudo apt-get install libboost-all-dev
# - sudo apt-get install libboost1.64-all-dev (also tried)
In the first case default boost version (1.54) was installed.
In second case result was same error message: cannot find package libboost1.64-all-dev
In third attempt I manually typed instructions to install boost:
install:
- sudo wget -O boost_1_64_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.gz/download
- sudo tar xzvf boost_1_64_0.tar.gz
- cd boost_1_64_0/
- sudo ./bootstrap.sh --prefix=/usr/local
- sudo ./b2
- sudo ./b2 install
As result my script took more than 30 min then was terminated.
Is any simple (or just working) way to install other than default boost version to Travis CI?
To look which all packages are available (esp. when you add the extra repository), you can run the "apt-cache search" command, e.g.:
sudo apt-cache search libboost
Then you can see the available versions.
When building manually, by default it builds "everything" (all static/shared debug/release libs), which then takes a lot of time and therefore it might timeout.
You can try to build only the libraries you actually need, for examle:
./bootstrap.sh --with-libraries=program_options,filesystem,system
./b2 link=shared threading=multi variant=release
(see here for details: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html)
Precompiled Boost
Here are the steps I followed to get this to work:
Search on launchpad until I found a recent boost package build for the trusty environment. That was non trivial, but there is a currently maintained ppa from mhier called libboost-latest
I found configuring the .travis.yml correctly to use the ppa nontrivial, so I present a working snippet below which I hope will help anyone else struggling with the same problem.
The following works for clang and gcc:
language: cpp
dist: trusty
sudo: false
os: linux
matrix:
include:
- env: COMPILER=g++-6 BUILD=Debug STANDARD=14
compiler: gcc
addons:
apt:
update: true
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-6
- boost1.67
- env: COMPILER=g++-6 BUILD=Release STANDARD=14
compiler: gcc
addons:
apt:
update: true
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-6
- boost1.67
# the rest of your yaml file...
Hopefully mhier will keep this ppa running for a while, otherwise you'll have to go through step 1, or provide your own ppa. As the boost version numbers progress the package number will change, so check the ppa page to keep the package name up to date.
A complete working example can be found at the monstar github project.
Compiling boost from source
You can also compile boost from source within your travis build, although you run the risk of timing out. The instruction for this are found in item 12 of boost's best practice handbook
I've run into the same issue and limiting the informational output from the commands seemed to do the trick.
The three that flood the log:
- tar -xzf boost_1_64_0.tar.gz
- ./b2 -d0
- ./b2 install -d0

mysql connector c++ install on raspberryPi

I want to setup connector/c++ on my raspberry Pi to access a mysql db. At first I tried:
sudo apt-get install libmysqlcppconn-dev
which installed successfully, but the I got the error:
ERR: MySQL_Connection::setReadOnly() (MySQL error code: 0, SQLState: )
which comes with the version of cppconn I'm using, as its said here: MySQL Connector for C++ | MySQL_Connection::setReadOnly() exception on setSchema
And when I checked:
sudo apt-cache show libmysqlcppconn-dev
it said "version: 1.1.0-4"
So then I tried to install the latest package from source:
https://dev.mysql.com/downloads/connector/cpp/ which was under ->Source Code -> Generic Linux (Architecture Independent), Compressed TAR Archive
I downloaded it and did "tar xvzf mysql-...." and everything worked. But when I tried to build it with
cmake .
I got the error:
CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at
/home/pi/quadro/mysql-connector/CMakeLists.txt:114:24
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at
/home/pi/quadro/mysql-connector/CMakeLists.txt:114:54
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
-- mysql_config was found /etc/mysql
CMake Error at FindMySQL.cm:165 (MESSAGE):
mysql_config wasn't found, -DMYSQL_CONFIG_EXECUTABLE=...
Call Stack (most recent call first):
CMakeLists.txt:55 (INCLUDE)
CMake Error at FindMySQL.cm:167 (MESSAGE):
Cannot find MySQL. Include dir: MYSQL_INCLUDE_DIR-NOTFOUND library dir:
cxxflags:
Call Stack (most recent call first):
CMakeLists.txt:55 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "/home/pi/quadro/mysql-connector/CMakeFiles/CMakeOutput.log".
I know it means, it cant find the mysql_config, but neither do I know how to tell it where the file is, nor where the file actually is.
So please help me. I'm so sick of this.
Thanks alot.
EDIT:
I tried to install the latest packages manually, which I downloaded from:
https://packages.debian.org/jessie/armhf/libmysqlcppconn-dev/download
sudo dpkg -i libmysqlcppconn7_1.1.3-6_armhf.deb
sudo dpkg -i libmysqlcppconn-dev_1.1.3-6_armhf.deb
And now I get:
$ sudo apt-cache show libmysqlcppconn-dev
Package: libmysqlcppconn-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 3213
Maintainer: Debian MySQL Maintainers <pkg-mysql- maint#lists.alioth.debian.org>
Architecture: armhf
Source: mysql-connector-c++
Version: 1.1.3-6
Depends: libboost-dev, libmysqlcppconn7 (= 1.1.3-6)
Description: MySQL Connector for C++ (development files)
MySQL Connector/C++ is a MySQL database connector for C++.
.
It mimics the JDBC 4.0 API.
.
This package contains the development files (headers, static library).
Package: libmysqlcppconn-dev
Source: mysql-connector-c++
Version: 1.1.0-4
Architecture: armhf
Maintainer: Debian MySQL Maintainers <pkg-mysql- maint#lists.alioth.debian.org>
Installed-Size: 3382
Depends: libboost-dev, libmysqlcppconn5 (= 1.1.0-4)
Homepage: http://forge.mysql.com/wiki/Connector_C++
Priority: optional
Section: libdevel
Filename: pool/main/m/mysql-connector-c++/libmysqlcppconn-dev_1.1.0- 4_armhf.deb
Size: 602550
SHA256: 286b6bf2ef3eb05dc8660a31780dd9af65c06f7d0d675257636281b2de056e15
SHA1: e53eeb1cf70c7522f557bbb6cbf0a753c6788fbb
MD5sum: 8770d029c21d086a48279c1f6e92f4a6
Description: MySQL Connector for C++ (development files)
MySQL Connector/C++ is a MySQL database connector for C++.
.
It mimics the JDBC 4.0 API.
.
This package contains the development files (headers, static library).
Is this good or bad?
You need to install the MySQL client library development files:
apt-get install libmysqlclient-dev
An easier way to try and ensure you have all dependencies installed, is to ask apt to install all build dependencies for it's packaged version:
apt-get build-dep libmysqlcppconn-dev
The libmysqlclient-dev package doesn't exist anymore. I guess it was renamed. So to install the c++ connector there is this new package:
sudo apt install libmysql++-dev