Build cgru3.0.0 on CentOS 7

Manual project build issues.
Post Reply
mpb88
Posts: 3
Joined: Fri Sep 18, 2020 8:17 pm

Build cgru3.0.0 on CentOS 7

Post by mpb88 »

Hi,

I'm trying to build cgru.3.0.0 on an updated CentOS7 with previuosly sucessfully installed the required libraries (install_depends_devel.sh) but I'm getting these errors:

Code: Select all

./build.sh
CGRU_VERSION 3.0.0 : '/root/cgru'
CGRU_REVISION 7caf6627fd8f7e25207ecb327e7539a2e542e32f
Detecting UNIX distribution...
CentOS 7 x86_64
Building on 'CentOS'
PostgreSQL found. Building with SQL.
Using POSIX-EXTENDED regular expressions.
-- Qt version 5.9.7
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   filesystem
--   system
--   python
-- Configuring done
-- Generating done
-- Build files have been written to: /root/cgru/afanasy/src/project.cmake
[  0%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/root/cgru/afanasy/src/libafanasy/address.cpp.o
...
[ 38%] Building CXX object server/CMakeFiles/afserver.dir/root/cgru/afanasy/src/server/jobaf.cpp.o
/root/cgru/afanasy/src/server/jobaf.cpp: In member function ‘void JobAf::tryTaskNext(bool, int, int)’:
/root/cgru/afanasy/src/server/jobaf.cpp:960:34: error: no matching function for call to ‘std::vector<int>::erase(std::vector<int>::const_iterator&)’
    m_try_this_tasks_num.erase(tIt);
                                  ^
/root/cgru/afanasy/src/server/jobaf.cpp:960:34: note: candidates are:
In file included from /usr/include/c++/4.8.2/vector:69:0,
                 from /usr/include/c++/4.8.2/bits/random.h:34,
                 from /usr/include/c++/4.8.2/random:50,
                 from /usr/include/c++/4.8.2/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from /root/cgru/afanasy/src/server/../libafanasy/name_af.h:18,
                 from /root/cgru/afanasy/src/server/jobaf.h:3,
                 from /root/cgru/afanasy/src/server/jobaf.cpp:16:
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note:   no known conversion for argument 1 from ‘std::vector<int>::const_iterator {aka __gnu_cxx::__normal_iterator<const int*, std::vector<int> >}’ to ‘std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}’
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note:   candidate expects 2 arguments, 1 provided
/root/cgru/afanasy/src/server/jobaf.cpp:961:35: error: no matching function for call to ‘std::vector<int>::erase(std::vector<int>::const_iterator&)’
    m_try_this_blocks_num.erase(bIt);
                                   ^
/root/cgru/afanasy/src/server/jobaf.cpp:961:35: note: candidates are:
In file included from /usr/include/c++/4.8.2/vector:69:0,
                 from /usr/include/c++/4.8.2/bits/random.h:34,
                 from /usr/include/c++/4.8.2/random:50,
                 from /usr/include/c++/4.8.2/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from /root/cgru/afanasy/src/server/../libafanasy/name_af.h:18,
                 from /root/cgru/afanasy/src/server/jobaf.h:3,
                 from /root/cgru/afanasy/src/server/jobaf.cpp:16:
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/vector.tcc:134:5: note:   no known conversion for argument 1 from ‘std::vector<int>::const_iterator {aka __gnu_cxx::__normal_iterator<const int*, std::vector<int> >}’ to ‘std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}’
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
     vector<_Tp, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/vector.tcc:146:5: note:   candidate expects 2 arguments, 1 provided
make[2]: *** [server/CMakeFiles/afserver.dir/root/cgru/afanasy/src/server/jobaf.cpp.o] Error 1
make[1]: *** [server/CMakeFiles/afserver.dir/all] Error 2
make: *** [all] Error 2
Used GCC 4.8.5 and with GCC 8.3.1 I'm getting the same errors.

Thanks in advance!
User avatar
timurhai
Site Admin
Posts: 661
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Build cgru3.0.0 on CentOS 7

Post by timurhai »

Hi!
Hm..
iterator erase( const_iterator pos );
https://en.cppreference.com/w/cpp/conta ... ctor/erase
(since C++11)
- should works

It seems, that you gcc do not supports ++11 standards, but it should:
https://github.com/CGRU/cgru/blob/maste ... ild.sh#L73

Bad, temporary solution:
- try to delete

Code: Select all

const
from code.
Timur Hairulin
CGRU 3.0.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).
mpb88
Posts: 3
Joined: Fri Sep 18, 2020 8:17 pm

Re: Build cgru3.0.0 on CentOS 7

Post by mpb88 »

timurhai wrote: Sat Sep 19, 2020 8:00 am Bad, temporary solution:
- try to delete

Code: Select all

const
from code.
Hi!

It works, build successfully!

Thanks you for your help!
User avatar
timurhai
Site Admin
Posts: 661
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Build cgru3.0.0 on CentOS 7

Post by timurhai »

Fixed in the code:
https://github.com/CGRU/cgru/commit/41e ... 56ac4e688e

It seems that CentOS 7 has a lack of c++11 support.
Some time new code can really need it.

Also RPM packages tests python code for CentOS 7 with a python2 syntax checker.
Some CGRU scripts can begin contain such Python 3 code that cause even syntax on a Python 2 syntax checker.
Blender addon already removed from CentOS 7 RPMs for this reason.

So, sooner or later CentOS 7 support will be dropped.
Timur Hairulin
CGRU 3.0.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).
mpb88
Posts: 3
Joined: Fri Sep 18, 2020 8:17 pm

Re: Build cgru3.0.0 on CentOS 7

Post by mpb88 »

thanks for the update and the RPM package, I had to remove the blender too to be able to create the RPM packages!

We are not ready to live without CentOS7 because of Maya, Nuke and RV/Shotgun. They only provide support on linux to CentOS7
Post Reply