votca / ctp

charge transport module
https://gitlab.mpcdf.mpg.de/votca/votca
7 stars 11 forks source link

Build error with gcc-8 #99

Closed junghans closed 6 years ago

junghans commented 6 years ago

Following up on https://github.com/votca/ctp/commit/91f6e4aaa9ea23b4984cc912d525e1cc40247702#commitcomment-28912652

when undoing:

--- a/src/libctp/job.cc
+++ b/src/libctp/job.cc
@@ -109,7 +109,7 @@ void Job::Reset() {
 }

-void Job::ToStream(ofstream &ofs, string fileformat) {
+void Job::ToStream(std::ofstream &ofs, string fileformat) {

     votca::tools::PropertyIOManipulator iomXML(votca::tools::PropertyIOManipulator::XML, 0, "\t\t");

@@ -147,9 +147,9 @@ void Job::ToStream(ofstream &ofs, string fileformat) {
         string host = _host;
         if (!_has_host) host = "__:__";
         string status = ConvertStatus(_status);
-        ofs << (format("%4$10s %5$20s %6$10s %1$5d %2$10s %3$30s %7$s %8$s\n")
-            % _id % _tag % _input % status % host
-            % time % _error % _output).str();
+        ofs << (format("%4$10s %5$20s %1$5d %2$10s %3$30s %7$s\n")
+            % _id % _tag % status % host
+            % time % _error).str();
     }
     else {
         assert(false);

gcc-8 fails with:

[ 46%] Building CXX object ctp/src/libctp/CMakeFiles/votca_ctp.dir/job.cc.o
In file included from /usr/include/boost/format.hpp:49,
                 from /home/junghans/votca/tools/include/votca/tools/property.h:28,
                 from /home/junghans/votca/tools/include/votca/tools/propertyiomanipulator.h:23,
                 from /home/junghans/votca/ctp/src/libctp/job.cc:1:
In file included from /usr/include/boost/format.hpp:49,
                 from /home/junghans/votca/tools/include/votca/tools/property.h:28,
                 from /home/junghans/votca/tools/include/votca/tools/propertyiomanipulator.h:23,
                 from /home/junghans/votca/ctp/src/libctp/job.cc:1:
/usr/include/boost/format/feed_args.hpp:99:12: note:   cannot convert ‘x’ (type ‘const votca::tools::Property’) to type ‘const boost::io::detail::group0&’
         os << x ;
         ~~~^~~~

So we need to add a way to convert votca::tools::Property into a string.

junghans commented 6 years ago

That piece got reverted in 9fb1189234e1f9299b73b2e166519ea8f6ed04e1, so master is now broken with gcc-8!

crionez commented 6 years ago

Ubuntu will have gcc-8 only in July (unless I force the LTS upgrade now). Debian we have at work is gcc-6. Why to rush so much?

junghans commented 6 years ago

Fedora 28 has it now.

junghans commented 6 years ago

And OpenSuse Leap 15.0 has it, too!

Anyhow the VOTCA docker container is Fedora based and hence:

docker run -it votca/votca /bin/bash

cannot contain the latest version of ctp until fixed!

junghans commented 6 years ago

Build error fixed in 0b9dd083a0153ce34f2a07973f8408ca1b236b70

junghans commented 6 years ago

CI passed, thanks, closing!