Compilation error on CentOS

I downloaded the tarball avogadro-1.2.0.tar.gz to my CentOS 7.3 desktop, made a build directory and ran cmake inside it, however it did not manage to complete due to an error. This are the contents of the error log file:

Performing C++ SOURCE FILE Test COMPILES_WITHOUT_FPERMISSIVE failed with the following output:
Change Dir: /home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" “cmTC_6f062/fast”
/usr/bin/gmake -f CMakeFiles/cmTC_6f062.dir/build.make CMakeFiles/cmTC_6f062.dir/build
gmake[1]: Entering directory /home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_6f062.dir/src.cxx.o /usr/bin/c++ -fvisibility=hidden -fvisibility-inlines-hidden -DCOMPILES_WITHOUT_FPERMISSIVE -o CMakeFiles/cmTC_6f062.dir/src.cxx.o -c /home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp/src.cxx /home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp/src.cxx:6:26: error: declaration of ‘auto_ptr<_Tp> counted_ptr<_Tp>::auto_ptr()’ [-fpermissive] auto_ptr<_Tp> auto_ptr(); ^ /home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp/src.cxx:2:28: error: changes meaning of ‘auto_ptr’ from ‘class auto_ptr<_Tp>’ [-fpermissive] template <class _Tp> class auto_ptr {}; ^ gmake[1]: *** [CMakeFiles/cmTC_6f062.dir/src.cxx.o] Error 1 gmake[1]: Leaving directory/home/username/Downloads/avogadro-1.2.0/build/CMakeFiles/CMakeTmp’
gmake: *** [cmTC_6f062/fast] Error 2

Source file was:

template class auto_ptr {};
struct counted_ptr
auto_ptr<_Tp> auto_ptr();
int main() {return 0;}

Could you recommend how I should proceed in order to install Avogadro? Thank you.

This is part of a CMake test. There’s no problem if the test fails. This is not part of Avogadro, the script is simply trying to figure out features of your compiler and development environment.

  • What version of CMake are you using?
  • What version of GCC are you using?
  • Can you compile other C++ programs?


This is the output at stdout after giving the cmake … command:

CMake Error at /usr/local/share/cmake-3.8/Modules/FindQt4.cmake:1318 (message):
Found unsuitable Qt version “5.6.2” from /home/suzanka/anaconda2/bin/qmake,
this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:226 (find_package)

No build files are generated in the directory. I have cmake version 3.8.0 and gcc 4.8.5 20150623 (Red Hat 4.8.5-11).

I have not compiled other programs using cmake so far. It is a clean installation from several days ago, so there is barely any software yet.

Your problem is clear from the log:

this code requires Qt 4.x

You’ll need to install the Qt 4.x development packages for Avogadro 1.x.

Thank you, that error was fixed. I came across another issue, this time with openbabel. I did not manage to fix it but I will continue tomorrow.