Building and installing from source on CentOS 7

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building and installing from source on CentOS 7

ralenhlaalo
I had previously managed to build and install CGAL 4.7 on a Vagrant-provisioned Ubuntu box. Now I need to recompile my application on CentOS 7, so I'm translating my provisioning script to run on CentOS. I was hoping it was just a matter of replacing apt-get with yum and finding out what all the packages are called. When running make, I get a ton of compilation errors.

Here is what I run on a clean CentOS 7 machine:

#!/usr/bin/env bash

yum install -y gcc-c++
yum install -y cmake
yum install -y git
yum install -y wget
yum install -y boost-devel
yum install -y epel-release
yum install -y python34-devel
yum install -y gmp-devel
yum install -y mpfr-devel
yum install -y qt5-qtbase-devel
yum install -y qt5-qtscript-devel

wget https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py

pip3 install virtualenv
pip3 install virtualenvwrapper

echo 'export WORKON_HOME="/home/vagrant/python_envs"' >> /home/vagrant/.bash_profile
echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' >> /home/vagrant/.bash_profile
echo 'source /usr/bin/virtualenvwrapper.sh' >> /home/vagrant/.bash_profile

echo 'export PATH="$PATH:/usr/lib64/qt5/bin"' >> /home/vagrant/.bash_profile

source /home/vagrant/.bash_profile

mkvirtualenv fb

pip install fontTools
pip install pyinstaller==3.1.1

cd /tmp
wget http://downloads.sourceforge.net/project/pyqt/sip/sip-4.17/sip-4.17.tar.gz
tar xzf ./sip-4.17.tar.gz
cd sip-4.17
python configure.py
make -j4 && make install

cd /tmp
git clone https://github.com/google/brotli.git
cd brotli
python setup.py install

cd /tmp
wget http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-5.5.1/PyQt-gpl-5.5.1.tar.gz
tar xzf ./PyQt-gpl-5.5.1.tar.gz
cd PyQt-gpl-5.5.1
python configure.py --confirm-license
make -j4 && make install

cd /tmp
wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.7/CGAL-4.7.tar.gz
tar xzf ./CGAL-4.7.tar.gz
mkdir CGAL-4.7/build && cd $_
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
make -j4 && make install

chown vagrant:vagrant -R /home/vagrant

ldconfig

# TODO: Web stuff

The errors are as follows:

(fb) [vagrant@localhost build]$ make
Scanning dependencies of target CGAL
[ 33%] Building CXX object src/CGAL/CMakeFiles/CGAL.dir/all_files.cpp.o
In file included from /tmp/CGAL-4.7/include/CGAL/Gmp_coercion_traits.h:32:0,
                 from /tmp/CGAL-4.7/include/CGAL/Gmpz.h:33,
                 from /tmp/CGAL-4.7/include/CGAL/Gmpq.h:25,
                 from /tmp/CGAL-4.7/include/CGAL/Polynomial/basic.h:50,
                 from /tmp/CGAL-4.7/include/CGAL/Polynomial/internal/numeric_solvers_support.h:23,
                 from /tmp/CGAL-4.7/src/CGAL/Turkowski_numeric_solver.cpp:21,
                 from /tmp/CGAL-4.7/build/src/CGAL/all_files.cpp:4:
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:812:59: error: missing binary operator before token "("
 #if(defined(MPFR_VERSION)&&(MPFR_VERSION>=MPFR_VERSION_NUM(2,3,0)))
                                                           ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:33:17: error: ‘mp_rnd_t’ does not name a type
         typedef mp_rnd_t mpfr_rnd_t;
                 ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:34:17: error: ‘mp_prec_t’ does not name a type
         typedef mp_prec_t mpfr_prec_t;
                 ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:77:9: error: ‘mpfr_t’ does not name a type
         mpfr_t floating_point_number;
         ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h: In destructor ‘CGAL::Gmpfr_rep::~Gmpfr_rep()’:
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:82:36: error: ‘floating_point_number’ was not declared in this scope
                         mpfr_clear(floating_point_number);
                                    ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:82:57: error: ‘mpfr_clear’ was not declared in this scope
                         mpfr_clear(floating_point_number);
                                                         ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h: At global scope:
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:88:30: error: ‘mpfr_rnd_t’ was not declared in this scope
         struct Minmax_traits<mpfr_rnd_t>{
                              ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:88:40: error: template argument 1 is invalid
         struct Minmax_traits<mpfr_rnd_t>{
                                        ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:126:26: error: ‘mpfr_rnd_t’ was not declared in this scope
         static Uncertain<mpfr_rnd_t> _gmp_rnd(std::float_round_style r){
                          ^
/tmp/CGAL-4.7/include/CGAL/GMP/Gmpfr_type.h:126:36: error: template argument 1 is invalid
         static Uncertain<mpfr_rnd_t> _gmp_rnd(std::float_round_style r){

...

Here is the script that works fine on Ubuntu (trusty):

#!/usr/bin/env bash

apt-get update
apt-get install -y g++
apt-get install -y cmake
apt-get install -y git
apt-get install -y libboost-dev
apt-get install -y libboost-thread-dev
apt-get install -y libboost-filesystem-dev
apt-get install -y libpython3.4-dev
apt-get install -y libboost-python-dev
apt-get install -y libgmp-dev
apt-get install -y libmpfr-dev
apt-get install -y qtbase5-dev
apt-get install -y qtscript5-dev
apt-get install -y qt5-default
apt-get install -y python3-pip

pip3 install virtualenv
pip3 install virtualenvwrapper

echo 'export WORKON_HOME="/home/vagrant/python_envs"' >> /home/vagrant/.bash_profile
echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' >> /home/vagrant/.bash_profile
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> /home/vagrant/.bash_profile

source /home/vagrant/.bash_profile

mkvirtualenv fb

pip install fontTools
pip install pyinstaller==3.1.1

cd /tmp
wget http://downloads.sourceforge.net/project/pyqt/sip/sip-4.17/sip-4.17.tar.gz
tar xzf ./sip-4.17.tar.gz
cd sip-4.17
python configure.py
make -j4 && make install

cd /tmp
git clone https://github.com/google/brotli.git
cd brotli
python setup.py install

cd /tmp
wget http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-5.5.1/PyQt-gpl-5.5.1.tar.gz
tar xzf ./PyQt-gpl-5.5.1.tar.gz
cd PyQt-gpl-5.5.1
python configure.py --confirm-license
make -j4 && make install

cd /tmp
wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.7/CGAL-4.7.tar.gz
tar xzf ./CGAL-4.7.tar.gz
mkdir CGAL-4.7/build && cd $_
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
make -j4 && make install

chown vagrant:vagrant -R /home/vagrant

ldconfig

apt-get -y install apache2 libapache2-mod-php5 curl

a2enmod php5
a2enmod rewrite

rm -rf /var/www
ln -fs /vagrant/FontBuilder/php_demo/www /var/www
cp /vagrant/FontBuilder/php_demo/apache-config.conf /etc/apache2/sites-enabled/000-default.conf

apt-get install -y npm
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

apt-get install -y npm nodejs-legacy
npm update -g npm
npm install -g grunt-cli

I'd appreciate any help. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Building and installing from source on CentOS 7

ralenhlaalo
I resolved the problem by using this Docker file as an example: https://github.com/CGAL/cgal-testsuite-dockerfiles/blob/master/CentOS-7/Dockerfile

Still not sure exactly what the problem was.
Reply | Threaded
Open this post in threaded view
|

Re: Building and installing from source on CentOS 7

Daniel Duque
Hi,

I can't see any of your examples. Anyway, I have just compiled CGAL-4.9 on CentOS 7.2.1511. I had to install a number of third-party packages, but other than that it wasn't so painful.

If you provide the errors I can point out the packages I had to install. Off the top of my head, these were needed for sure:

boost-thread-devel
boost-system
lapack-devel
cmake
gmpr-devel
mpfr-devel

Best,

Daniel


On 18 November 2016 at 04:07, ralenhlaalo <[hidden email]> wrote:
I resolved the problem by using this Docker file as an example:
https://github.com/CGAL/cgal-testsuite-dockerfiles/blob/master/CentOS-7/Dockerfile

Still not sure exactly what the problem was.



--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Building-and-installing-from-source-on-CentOS-7-tp4662365p4662367.html
Sent from the cgal-discuss mailing list archive at Nabble.com.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss