avogadro icon indicating copy to clipboard operation
avogadro copied to clipboard

Fails to build with gcc-6/boost-1.61

Open mbanck opened this issue 7 years ago • 4 comments

I am getting build failures on Debian unstable due to (apparently) boost-1.61:

[  7%] Generating moc_pythonengine_p.cxx
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libavogadro/src && /usr/lib/x86_64-linux-gnu/qt4/bin/moc @/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libavogadro/src/moc_pythonengine_p.cxx_parameters
usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"
libavogadro/src/CMakeFiles/avogadro.dir/build.make:220: recipe for target 'libavogadro/src/moc_pythonengine_p.cxx' failed
make[3]: *** [libavogadro/src/moc_pythonengine_p.cxx] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:154: recipe for target 'libavogadro/src/CMakeFiles/avogadro.dir/all' failed
make[2]: *** [libavogadro/src/CMakeFiles/avogadro.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'

mbanck avatar Sep 23 '16 15:09 mbanck

Debian bug (for 1.0, but I tried with 1.2.0): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833770

mbanck avatar Sep 23 '16 15:09 mbanck

Curiously the debian experimental autobuilders build 1.1.1 successfully with gcc6/boost1.61

plugwash avatar Sep 24 '16 00:09 plugwash

@plugwash thanks for the hint, I've compared the source and patches for both. Seems parts of Debian's boost148.patch were applied in 1.2.0 since 1.1.1, namely the following hunks:

+#ifdef Q_MOC_RUN
+#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
+#endif

However, the following hunks have not been applied yet:

+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif

If I use this patch Avogadro-1.2.0 keeps building past this build failure for me:

--- avogadro-1.2.0.orig/libavogadro/src/pythonengine_p.h
+++ avogadro-1.2.0/libavogadro/src/pythonengine_p.h
@@ -31,7 +31,9 @@

 #include <avogadro/global.h>
 #include <avogadro/engine.h>
+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif

 namespace Avogadro {

--- avogadro-1.2.0.orig/libavogadro/src/pythonextension_p.h
+++ avogadro-1.2.0/libavogadro/src/pythonextension_p.h
@@ -33,7 +33,9 @@
 #include <avogadro/extension.h>
 #include <avogadro/primitive.h>
 #include <avogadro/glwidget.h>
+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif

 #include <QWidget>
 #include <QList>
--- avogadro-1.2.0.orig/libavogadro/src/pythontool_p.h
+++ avogadro-1.2.0/libavogadro/src/pythontool_p.h
@@ -31,7 +31,9 @@

 #include <avogadro/global.h>
 #include <avogadro/tool.h>
+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif

 #include <QObject>
 #include <QAction>

mbanck avatar Sep 24 '16 10:09 mbanck

The following two additional hunks are needed, as the pythonterminal extension includes them:

--- ./libavogadro/src/pythoninterpreter.h.orig  2016-09-24 12:22:39.039637527 +0200
+++ ./libavogadro/src/pythoninterpreter.h       2016-09-24 12:23:01.747636759 +0200
@@ -26,7 +26,9 @@
 #define PYTHONINTERPRETER_H

 #include <avogadro/global.h>
+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif
 #include <avogadro/primitive.h>
 #include <QString>

--- ./libavogadro/src/pythonscript.h.orig       2016-09-24 12:22:44.335637348 +0200
+++ ./libavogadro/src/pythonscript.h    2016-09-24 12:23:08.103636544 +0200
@@ -27,7 +27,9 @@
 #define PYTHONSCRIPT_H

 #include <avogadro/global.h>
+#ifndef Q_MOC_RUN
 #include <boost/python.hpp>
+#endif

 #include "pythonerror.h"

mbanck avatar Sep 24 '16 10:09 mbanck