QBox configuration error: unable to find "cc" - configuration

I am trying to build QBox
https://git.greensocs.com/qemu/qbox
For Configuration, I am using
./configure --target-list=arm-softmmu --library --qbox --with-tlm2c=/proj/user/tlm2c --prefix=/proj/user/Qbox --disable-pie --extra-cflags=--ftls-model=initial-exec
But I am getting the following error while configuration:
ERROR: "cc" either does not exist or does not work
I tried to set the flag --cc=gcc but still getting the same error. I am using gcc version 4.7.2.

It is missing gcc, so run the below command to resolve it
$ sudo apt-get install gcc

Related

MySQL atomic library missing error during MyChem installation using cmake

I'm trying to install a tool (MyChem) using cmake on our Ubuntu EC2 instance, the tool I'm installing should utilize mysql so I installed it first. But when I tried to install the tool its says mysql atomic library is missing. What is atomic library? Anybody knows why or how to solve this?
I installed mysql first as follows:
$ sudo apt upgrade
$ sudo apt-get install build-essential
$ sudo apt-get install mysql-server mysql-client
$ sudo apt-get install libmysqlclient-dev
And the followings are the error messages:
$ cmake ..
-- The build type is RelWithDebInfo
-- Test module disabled
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Using mysql-config: /usr/bin/mysql_config
-- MySQL Version: 5.7.29
-- MySQL Plugin Dir: /usr/lib/mysql/plugin
-- Found MySQL 5.7.29: /usr/include/mysql, /usr/lib/x86_64-linux-gnu/libmysqlclient.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;MYSQL_LIBRARIES_atomic-NOTFOUND;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libdl.so
-- Mychem installation directory: /usr/lib/mysql/plugin
-- Defining dlhandler source files
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIBRARIES_atomic
linked by target "mychem-lib" in directory /home/ubuntu/mychem-1.0.0/src
linked by target "modification_test" in directory /home/ubuntu/mychem-1.0.0/tests
...
-- Configuring incomplete, errors occurred!
From above, around in the middle, you should be able to see the error messages such as MYSQL_LIBRARIES_atomic-NOTFOUND and also
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: MYSQL_LIBRARIES_atomic
at the bottom.

How to link mysql-client installed from Homebrew with diesel-cli?

I have been trying to install the Rust Diesel CLI tool using cargo install diesel_cli, but the installation fails with a linking error
ld: library not found for -lmysqlclient
clang: error: linker command failed with exit code 1
(use -v to see invocation)
I installed the MySQL client using Homebrew: brew install mysql-client. During installation I got the following warning:
mysql-client is keg-only, which means it was not symlinked into /usr/local,
because conflicts with mysql.
If you need to have mysql-client first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
For compilers to find mysql-client you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql-client/lib"
export CPPFLAGS="-I/usr/local/opt/mysql-client/includeā€¯
I set the PATH and flags as in that warning message, but I still get the above linking error when trying to install the diesel-cli tool. I am unfamiliar with how to do linking in Rust - are there extra steps I need to do here to link mysqlclient directly?
Cargo ignores LDFLAGS and CPPFLAGS, you should set RUSTFLAGS instead. Something like this untested invocation:
RUSTFLAGS="-L/your_lib -I/your_include" cargo install diesel_cli
Relevant documentation.
On my side, I did not make it work with a mysql-client only. I had to install mysql with
brew install mysql
In the end, what matters is that you have a version of the mysqlclient dynamic lib.
Mines where installed here :
/usr/local/lib/libmysqlclient.21.dylib
/usr/local/Cellar/mysql/8.0.15/lib/libmysqlclient.21.dylib
And it worked.

mysql_config not found with mysql-community on CentOS 7

I need to install mysqlclient module for python3.6 on my CentOS server via pip.
The instalation breaks with following error: OSError: mysql_config not found.
I've found a solution, to install mysql-devel package, but unfortunately it breaks with following error:
Error: mariadb101u-config conflicts with mysql-community-server-8.0.4-0.1.rc.el7.x86_64
Error: mariadb101u-libs conflicts with mysql-community-libs-8.0.4-0.1.rc.el7.x86_64
Error: mariadb101u-libs conflicts with mysql-community-libs-compat-8.0.4-0.1.rc.el7.x86_64
Error: mariadb101u-common conflicts with mysql-community-common-8.0.4-0.1.rc.el7.x86_64
I cannot remove the mysql-community packages, because the server is running MySQL database based on that.
Is there any way to fix it without removing conflicting packets?
Ok, found an answer:
yum install mariadb-devel gcc python36u-devel
Solution by #Djent worked for me.
But I kept on receiving time out error while installing through yum. If you are having the same problem. You can manually download the package and install it!
On CentOS
wget https://archive.mariadb.org/mariadb-10.1.39/yum/centos7-amd64/rpms/MariaDB-10.1.38-centos73-x86_64-devel.rpm
rpm -i MariaDB-10.1.38-centos73-x86_64-devel.rpm
For other linux OS, you can find mariadb-devel at https://pkgs.org/download/mariadb-devel
First run the command (take note of python version):
sudo yum install python36-devel
Then install mysqlclient using pip.

fatal error: 'mysql/mysql.h' file not found

I have installed mysql using
brew install mysql
Then compiled using
gcc -I/usr/include mydb.c
However it gives me the error:
fatal error: 'mysql/mysql.h' file not found
What am I doing wrong here? Am on macosx 10.12
edit: tried gcc -I/usr/local/include/mysql/ mydb.c still broken
On ubuntu16.04,mysql.h locates in /usr/include/mysql.
You can find it after install libmysqlclient20 or libmysqlclient-dev.
Verify at where are install mysql, for this, using the command for see the file list of directory
ls
and using
cd
The installation, in my example, are is in directory:
/usr/local/mysql-<version_my_mysql>/include/
second step is indicate the directory everytime compiller:
gcc my_program_code_file.c -I /usr/local/mysql-5.7.9-osx10.9-x86_64/include/ -o my_program_executable
the includers in code are:
#include <mysql.h>

configure: error: invalid MySQL root directory

I've a problem installing sphinx with percona 5.6 on centos 6.4.
I'm getting the following error while building from source:
******************************************************************************
ERROR: cannot find MySQL include files.
Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.
If include files are installed on your system, but you are still getting
this message, you should do one of the following:
1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
your PATH environment variable.
To disable MySQL support, use --without-mysql option.
******************************************************************************
Percona-Server-devel is installed:
rpm -qa | grep -i percona
percona-release-0.0-1.x86_64
Percona-Server-server-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-client-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-devel-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-shared-56-5.6.16-rel64.2.el6.x86_64
What I've tried:
locate "libmysql"
/usr/lib64/libmysqlclient.so.18
/usr/lib64/libmysqlclient.so.18.0.0
/usr/lib64/libmysqlclient_r.so.18
/usr/lib64/libmysqlclient_r.so.18.0.0
/usr/lib64/mysql/libmysqlclient.so.16
/usr/lib64/mysql/libmysqlclient.so.16.0.0
/usr/lib64/mysql/libmysqlclient_r.so.16
/usr/lib64/mysql/libmysqlclient_r.so.16.0.0
/usr/lib64/mysql/libmysqlservices.a
than:
./configure --with-mysql=/usr/lib64/mysql --with-mysql-libs=/usr/lib64/mysql
./configure --with-mysql=/usr/lib64 --with-mysql-libs=/usr/lib64
./configure --with-mysql=/usr/bin/mysql --with-mysql-libs=/usr/bin/mysql
./configure --with-mysql=/usr
configure: error: invalid MySQL root directory '/usr/lib64/mysql';
neither bin/mysql_config, nor include/ and lib/ were found there
which mysql_config
/usr/bin/mysql_config
Have you tried installing mysql-devel ?
sudo yum install mysql-devel
If properly setup, try as suggested in the error message to point to these libs manually using a command like the following one (to be adapted to your environment)
./configure --with-mysql-includes=/usr/local/src/mysql-XXX/include