Skip to content

CentOS 7

Current state

CMake: (requires patch for VTK) https://pastebin.com/eAtVXLds

build:

  • boost: package version (1.51) is too old, newer version (1.68) is required
  • CGAL: gcc-10 is required
  • FlowEngine: https://pastebin.com/XTeaQHum

Steps so far

yum -y install epel-release centos-release-scl
yum -y install alabaster babel bzip2-devel curl devtoolset-10 docutils dpkg-dev eigen3-devel fakeroot \
freeglut-devel future gcc gcc-c++ git glib2-devel gmp-devel gnuplot help2man imagesize Jinja2 js-jquery \
kernel-devel libjpeg-turbo-devel libXmu-devel make metis-devel mpfr-devel netpbm-devel openblas-devel \
openmpi-devel packaging Pygments pyparsing python36-future python36-pygraphviz python36-tkinter python3-devel \
qt5* requests setuptools snowballstemmer sphinxcontrib-applehelp sphinxcontrib-devhelp sphinxcontrib-htmlhelp \
sphinxcontrib-jsmath sphinxcontrib-qthelp sphinxcontrib-serializinghtml sqlite-devel vtk-devel wget zlib zlib-devel

source /opt/rh/devtoolset-10/enable

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar xf cmake-3.12.3.tar.gz
cd cmake-3.12.3
./bootstrap --prefix=/usr/local
make
make install
cd ..

wget https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.gz
tar xf boost_1_68_0.tar.gz
cd boost_1_68_0
./bootstrap.sh --prefix=/opt/boost --with-python=/usr/bin/python3
wget https://gist.githubusercontent.com/g0mb4/cc913fdb70088b08e47e7828aa5f3bbe/raw/89f836f0b0bd9cafad7b256684bb19ba82b96433/centos7.boost.python36.patch
patch < centos7.boost.python36.patch
./b2 install --prefix=/opt/boost --with=all
cd ..

export BOOST_ROOT=/opt/boost
export BOOST_INCLUDEDIR=/opt/boost/include
export BOOST_LIBRARYDIR=/opt/boost/lib

wget -O /usr/include/mpreal.h https://raw.githubusercontent.com/advanpix/mpreal/master/mpreal.h

wget "https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8/CGAL-4.8.tar.xz"
tar xf CGAL-4.8.tar.xz
cd CGAL-4.8/
cmake .
make
make install
cd ..

wget --no-check-certificate https://copr-be.cloud.fedoraproject.org/results/johnellson/gts/epel-7-x86_64/00463945-gts/gts-0.7.6-21.20111025.el7.centos.x86_64.rpm
rpm -i gts-0.7.6-21.20111025.el7.centos.x86_64.rpm
wget --no-check-certificate https://copr-be.cloud.fedoraproject.org/results/johnellson/gts/epel-7-x86_64/00463945-gts/gts-devel-0.7.6-21.20111025.el7.centos.x86_64.rpm
rpm -i gts-devel-0.7.6-21.20111025.el7.centos.x86_64.rpm

wget --no-check-certificate -O loki-0.1.7.tar.gz "https://downloads.sourceforge.net/project/loki-lib/Loki/Loki%200.1.7/loki-0.1.7.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Floki-lib%2Ffiles%2FLoki%2FLoki%25200.1.7%2F&ts=1499401735&use_mirror=svwh"
tar xf loki-0.1.7.tar.gz
cd loki-0.1.7
CXX=/usr/bin/g++ LD=/usr/bin/gcc make
make install
cd ..

cd /etc/yum.repos.d/
curl -s -SLO https://copr.fedoraproject.org/coprs/rineau/libQGLViewer-qt5/repo/epel-7/rineau-libQGLViewer-qt5-epel-7.repo
cd ~
rpm --import https://copr-be.cloud.fedoraproject.org/results/rineau/libQGLViewer-qt5/pubkey.gpg
yum -y install libQGLViewer-qt5-devel.x86_64
yum clean all
cd ~

pip3 install bibtexparser GitPython ipython matplotlib mpmath numpy pillow sphinx xlib
pip3 install PyQt5
CC=/usr/lib64/openmpi/bin/mpicc pip3 install mpi4py

mkdir yade
cd yade
mkdir build install
git clone --recursive https://gitlab.com/yade-dev/trunk.git
cd trunk

wget -O cMake/GetDistro.cmake https://gist.githubusercontent.com/g0mb4/19f82e3327203eceb2feba8c62072684/raw/a16304a097274f64e8943b1950d90f130c169e06/GetDistro.cmake

wget https://gist.githubusercontent.com/g0mb4/182dc043a64a91899da584a970885c67/raw/bebf48ce9c96e1ea60ed3dcc0d4ac1ccb0fa6960/centos7.cmake.patch
patch < centos7.cmake.patch

cd ../build

export PATH=$PATH:/usr/lib64/openmpi/bin
source /opt/rh/devtoolset-10/enable

cmake -DBOOST_ROOT=/opt/boost \
 -DBOOST_INCLUDEDIR=/opt/boost/include \
 -DBOOST_LIBRARYDIR=/opt/boost/lib \
 -DENABLE_USEFUL_ERRORS=OFF \
 -DCMAKE_INSTALL_PREFIX=../install ../trunk
make install

Explanation

The new file cMake/GetDistro.cmake contains the GET_DISTRO function that can extract the name and the version of the current linux distribution, e.g. "centos7", "ubuntu20.04".

FUNCTION(GET_DISTRO ARG_DISTRO_INFO)
        EXECUTE_PROCESS (
                COMMAND bash -c "awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '\n' | tr -d '\"'"
                OUTPUT_VARIABLE DISTRO_ID
        )

        EXECUTE_PROCESS (
                COMMAND bash -c "awk -F= '/^VERSION_ID=/{print $2}' /etc/os-release | tr -d '\n' | tr -d '\"'"
                OUTPUT_VARIABLE DISTRO_VERSION
        )

        SET(${ARG_DISTRO_INFO} ${DISTRO_ID}${DISTRO_VERSION} PARENT_SCOPE)
ENDFUNCTION()

The required patch that allows cmake to identify the "vtk" libraries.

--- CMakeLists.txt	2022-03-25 14:18:03.030063107 +0100
+++ CMakeLists-centos7.txt	2022-03-25 14:17:57.604004875 +0100
@@ -135,6 +135,7 @@
 
 INCLUDE(GetVersion)
 INCLUDE(GNUInstallDirs)
+INCLUDE(GetDistro)
 
 INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR})
 
@@ -819,7 +820,14 @@
 		BREAK()
 	ENDIF()
   ENDFOREACH()
-  
+
+  SET(DISTRO_INFO "")
+  GET_DISTRO(DISTRO_INFO)
+
+  IF(NOT VTK_FOUND AND "${DISTRO_INFO}" STREQUAL "centos7")
+        FIND_PACKAGE(VTK REQUIRED)
+  ENDIF()
+
   IF(VTK_FOUND)
     INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
     LINK_DIRECTORIES( ${VTK_LIBRARY_DIRS} )

Compilation

We need /usr/lib64/openmpi/bin to be in the PATH and we want to use gcc-10.

Environment setup

export PATH=$PATH:/usr/lib64/openmpi/bin
export BOOST_ROOT=/opt/boost
export BOOST_INCLUDEDIR=/opt/boost/include
export BOOST_LIBRARYDIR=/opt/boost/lib
source /opt/rh/devtoolset-10/enable

Compilation

Compilation based on https://yade-dem.org/doc/installation.html#compilation

cmake -DBOOST_ROOT=/opt/boost \
 -DBOOST_INCLUDEDIR=/opt/boost/include \
 -DBOOST_LIBRARYDIR=/opt/boost/lib \
 -DENABLE_USEFUL_ERRORS=OFF \
 -DCMAKE_INSTALL_PREFIX=../install ../trunk
make install

Packages

Older post on this topic: https://answers.launchpad.net/yade/+question/643703

Debian packages: https://packages.debian.org/

CentOS packages: https://centos.pkgs.org/

You need to run yum install epel-release in order to install epel packages.

You need to run yum install centos-release-scl in order to install scl packages.

gcc-10 is required, see g++.

Required packages: wget curl qt5*

Package status:

  • ? - not sure if needed
  • - error at install
  • ? - installed, but not sure if needed / working
  • - installed, but problem at compilation / cmake error
  • - installed and works

Yade packages:

Ubuntu 22.04 CentOS 7 Depends on (yum) Status Install method Notes
build-essential gcc gcc-c++ kernel-devel make yum
Cholmod ?
cmake from source see below
coinor-clp ?
coinor-libclp-dev ?
dpkg-dev dpkg-dev yum epel
fakeroot fakeroot ? yum epel
freeglut3-dev freeglut-devel yum
g++ devtoolset-10 yum scl, environment setup required after install: source /opt/rh/devtoolset-10/enable
git git yum
gnuplot gnuplot ? yum
gtk2-engines-pixbuf ?
help2man help2man ? yum
libboost-all-dev from source see below
libbz2-dev bzip2-devel yum
libcgal-dev gmp-devel mpfr-devel boost-devel qt5* from source see below
libeigen3-dev eigen3-devel yum epel
libglib2.0-dev glib2-devel yum
libgmp-dev gmp-devel yum
libgts-dev gts-devel glib2-devel netpbm rpm see below
libjs-jquery js-jquery ? yum epel
libloki-dev ? from source see below, requires old compiler
libmetis-dev metis-devel yum epel
libmpc-dev ?
libmpfr-dev mpfr-devel yum boost < 1.71 cannot use boost::multiprecision for ComplexHP: (1) complex128 (2) mpc_complex MPFR (3)
libmpfrc++-dev from source boost < 1.71 cannot use boost::multiprecision for ComplexHP: (1) complex128 (2) mpc_complex MPFR (3)
libopenblas-dev openblas-devel yum epel
libopenmpi-dev openmpi-devel yum
libqglviewer-dev-qt5 external repo + yum see below
libsqlite3-dev sqlite-devel ? yum
libsuitesparse-dev ?
libvtk6-dev vtk-devel yum epel, cmake patch is required
libxi-dev ?
libxmu-dev libXmu-devel ? yum
pyqt5-dev-tools ?
python3-bibtexparser bibtexparser future pyparsing ? pip3 epel
python3-dev python3-devel yum
python3-future python36-future yum epel
python3-git GitPython ? pip3
python3-ipython ipython pip3
python3-matplotlib matplotlib zlib libjpeg-turbo-devel pip3
python3-mpi4py mpi4py openmpi-devel pip3 CC=/usr/lib64/openmpi/bin/mpicc pip3 install mpi4py
python3-mpmath mpmath pip3
python3-numpy numpy pip3
python3-pil pillow ? pip3
python3-pygraphviz python36-pygraphviz yum epel
python3-pyqt5 PyQt5 pip3
python3-pyqt5.qtsvg ?
python3-pyqt5.qtwebkit ?
python3-sphinx sphinx sphinxcontrib-applehelp sphinxcontrib-devhelp sphinxcontrib-jsmath sphinxcontrib-htmlhelp sphinxcontrib-serializinghtml sphinxcontrib-qthelp Jinja2 Pygments docutils snowballstemmer babel alabaster imagesize requests setuptools packaging ? pip3
python3-tk python36-tkinter yum
python3-xlib xlib pip3
zlib1g-dev zlib-devel yum

cmake

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar xf cmake-3.12.3.tar.gz
cd cmake-3.12.3
./bootstrap --prefix=/usr/local
make
make install

MPFR C++

wget -O /usr/include/mpreal.h https://raw.githubusercontent.com/advanpix/mpreal/master/mpreal.h

boost

Required patch which must be aplied after the bootstrap.sh was run. The pach enables boost to pick up the right version of python. The include directory was obtained by running /usr/local/bin/python3.6m-config --includes.

--- project-config.jam	2022-03-24 10:15:53.885290488 +0100
+++ project-config-centos7.jam	2022-03-24 10:17:03.704963322 +0100
@@ -16,10 +16,7 @@
 
 # Python configuration
 import python ;
-if ! [ python.configured ]
-{
-    using python : 3.6 : /usr ;
-}
+using python : 3.6 : /usr/local/bin/python3 : /usr/include/python3.6m : /usr/lib64 ;
 
 # List of --with-<library> and --without-<library>
 # options. If left empty, all libraries will be built.
wget https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.gz
tar xf boost_1_68_0.tar.gz
cd boost_1_68_0
./bootstrap.sh --prefix=/opt/boost --with-python=/usr/bin/python3
wget https://gist.githubusercontent.com/g0mb4/cc913fdb70088b08e47e7828aa5f3bbe/raw/89f836f0b0bd9cafad7b256684bb19ba82b96433/centos7.boost.python36.patch
patch < centos7.boost.python36.patch
./b2 install --prefix=/opt/boost --with=all
cd ..

gts-devel

wget --no-check-certificate https://copr-be.cloud.fedoraproject.org/results/johnellson/gts/epel-7-x86_64/00463945-gts/gts-0.7.6-21.20111025.el7.centos.x86_64.rpm
rpm -i gts-0.7.6-21.20111025.el7.centos.x86_64.rpm
wget --no-check-certificate https://copr-be.cloud.fedoraproject.org/results/johnellson/gts/epel-7-x86_64/00463945-gts/gts-devel-0.7.6-21.20111025.el7.centos.x86_64.rpm
rpm -i gts-devel-0.7.6-21.20111025.el7.centos.x86_64.rpm

cgal

wget "https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.8/CGAL-4.8.tar.xz"
tar xf CGAL-4.8.tar.xz
cd CGAL-4.8/
cmake .
make
make install

loki

Must be compiled with the older version (4.x) of gcc, this can be bypassed by using different CXXFLAFS.

wget --no-check-certificate -O loki-0.1.7.tar.gz "https://downloads.sourceforge.net/project/loki-lib/Loki/Loki%200.1.7/loki-0.1.7.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Floki-lib%2Ffiles%2FLoki%2FLoki%25200.1.7%2F&ts=1499401735&use_mirror=svwh"
tar xf loki-0.1.7.tar.gz
cd loki-0.1.7
CXX=/usr/bin/g++ LD=/usr/bin/gcc  make
make install

libQGLViewer-qt5

cd /etc/yum.repos.d/
curl -s -SLO https://copr.fedoraproject.org/coprs/rineau/libQGLViewer-qt5/repo/epel-7/rineau-libQGLViewer-qt5-epel-7.repo
rpm --import https://copr-be.cloud.fedoraproject.org/results/rineau/libQGLViewer-qt5/pubkey.gpg
yum install libQGLViewer-qt5-devel.x86_64
yum clean all
Edited by Tóth János