Git Product home page Git Product logo

Comments (12)

turol avatar turol commented on August 13, 2024 1

Single-parameter constructor should probably be marked explicit.

from pharos.

sei-eschwartz avatar sei-eschwartz commented on August 13, 2024

from pharos.

swoolbean avatar swoolbean commented on August 13, 2024

I want to say 7.2.4, but my host machine actually bricked itself this morning, so I won't be able to check for a few weeks until it's repaired 😅

If I have some time this coming week, I'll try getting it set up on a different PC.

from pharos.

sei-ccohen avatar sei-ccohen commented on August 13, 2024

I know that we've had to upgrade our compiler in the RedHat environment a couple of times. We're currently using devtoolset-11 in our build environment. I'm not certain what our minimum version requirement for the compiler is, but I know that we need C++14 support. I encourage you to upgrade the compiler for your next build.

from pharos.

sei-mwd avatar sei-mwd commented on August 13, 2024

C++14 is supposedly available from gcc 6.1 and up, but we haven't tested with versions of gcc that old in some time. It is possible that we accidentally have some code that is not C++14 compliant, but that compiles on later versions of gcc anyway. I could look at what is going on, but I would need more context from your original error message to trace down what is happening.

from pharos.

sei-mwd avatar sei-mwd commented on August 13, 2024

Did not mean to close this issue.

from pharos.

sei-eschwartz avatar sei-eschwartz commented on August 13, 2024

I was able to reproduce this with gcc 7.3.1 on centos 7 using the commands in this notebook: https://colab.research.google.com/drive/1RsbkTSUjuIlrdR4T73vo4mC-K0Adifq0?usp=sharing

But the notebook is slow because it uses udocker, so it's still catching up. This is from my machine:

[3/29] Building CXX object libpharos/CMakeFiles/pharos.dir/options.cpp.o
FAILED: libpharos/CMakeFiles/pharos.dir/options.cpp.o 
/opt/rh/devtoolset-7/root/usr/bin/c++ -Dpharos_EXPORTS -I/root/pharos/scripts/build/libpharos -isystem /usr/local/include/rose -isystem /usr/local/lib/swipl/include -pedantic -pedantic-errors -Wall -Wextra -Wshadow -Wstrict-aliasing -Wno-misleading-indentation -ftemplate-depth=1024 -ftrack-macro-expansion=0 -O3 -DNDEBUG -std=c++14 -fPIC -pthread -Winvalid-pch -include /root/pharos/scripts/build/libpharos/CMakeFiles/pharos.dir/cmake_pch.hxx -MD -MT libpharos/CMakeFiles/pharos.dir/options.cpp.o -MF libpharos/CMakeFiles/pharos.dir/options.cpp.o.d -o libpharos/CMakeFiles/pharos.dir/options.cpp.o -c /root/pharos/libpharos/options.cpp
In file included from /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/move.h:54:0,
                 from /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/nested_exception.h:40,
                 from /opt/rh/devtoolset-7/root/usr/include/c++/7/exception:143,
                 from /opt/rh/devtoolset-7/root/usr/include/c++/7/ios:39,
                 from /opt/rh/devtoolset-7/root/usr/include/c++/7/ostream:38,
                 from /usr/local/include/boost/system/error_code.hpp:19,
                 from /usr/local/include/boost/filesystem/path_traits.hpp:23,
                 from /usr/local/include/boost/filesystem/path.hpp:25,
                 from /usr/local/include/boost/filesystem.hpp:16,
                 from /usr/local/include/rose/sage3basic.h:42,
                 from /usr/local/include/rose/sage3basic.hhh:4,
                 from /usr/local/include/rose/rose.h:10,
                 from /root/pharos/scripts/build/libpharos/CMakeFiles/pharos.dir/cmake_pch.hxx:5,
                 from <command-line>:0:
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits: In substitution of 'template<class _Tp, class> static std::true_type std::__do_is_default_constructible_impl::__test(int) [with _Tp = pharos::PathFinder::SolverDeleter; <template-parameter-1-2> = <missing>]':
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:889:35:   required from 'struct std::__is_default_constructible_impl<pharos::PathFinder::SolverDeleter>'
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:143:12:   required from 'struct std::__and_<std::__not_<std::is_void<pharos::PathFinder::SolverDeleter> >, std::__is_default_constructible_impl<pharos::PathFinder::SolverDeleter> >'
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:893:12:   required from 'struct std::__is_default_constructible_atom<pharos::PathFinder::SolverDeleter>'
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:914:12:   required from 'struct std::__is_default_constructible_safe<pharos::PathFinder::SolverDeleter, false>'
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:920:12:   required from 'struct std::is_default_constructible<pharos::PathFinder::SolverDeleter>'
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:143:12:   required from 'struct std::__and_<std::__not_<std::is_pointer<pharos::PathFinder::SolverDeleter> >, std::is_default_constructible<pharos::PathFinder::SolverDeleter> >'
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/unique_ptr.h:135:47:   required from 'class std::__uniq_ptr_impl<pharos::PharosZ3Solver, pharos::PathFinder::SolverDeleter>'
/opt/rh/devtoolset-7/root/usr/include/c++/7/bits/unique_ptr.h:163:33:   required from 'class std::unique_ptr<pharos::PharosZ3Solver, pharos::PathFinder::SolverDeleter>'
/root/pharos/libpharos/path.hpp:303:0:   required from here
/opt/rh/devtoolset-7/root/usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'pharos::PathFinder::SolverDeleter::owned' has been parsed
     template<typename _Tp, typename = decltype(_Tp())>

from pharos.

sei-eschwartz avatar sei-eschwartz commented on August 13, 2024

https://stackoverflow.com/a/17436088

from pharos.

sei-eschwartz avatar sei-eschwartz commented on August 13, 2024

This fixed it for me, but @sei-mwd might have a more elegant solution:

[root@ed-Precision-7540 libpharos]# git diff
diff --git a/libpharos/path.hpp b/libpharos/path.hpp
index a89b20a..2b31766 100644
--- a/libpharos/path.hpp
+++ b/libpharos/path.hpp
@@ -297,6 +297,8 @@ class PathFinder : public Z3PathAnalyzer {
   struct SolverDeleter {
     bool owned = true;
     void operator()(PharosZ3Solver *s) const { if (owned) delete s; }
+    SolverDeleter() {}
+    explicit SolverDeleter(bool owned_) : owned(owned_) {}
   };
 
   // We will need Z3 for this analysis

The default constructor is needed for unique_ptr, and the second one is needed because we use SolverDeleter{false} somewhere.

from pharos.

sei-mwd avatar sei-mwd commented on August 13, 2024

Okay. This looks like a bug in the C++ standard library in that version of gcc. The fix that @sei-eschwartz posted is harmless, so I'll commit a variant of it shortly.

from pharos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.