jangreen / rat

RAT: Relational Algebra (with) Tableaus
0 stars 0 forks source link

Cannot build current master #5

Open hernanponcedeleon opened 1 week ago

hernanponcedeleon commented 1 week ago

Commit id: dedec4655ee906af5d84d19a05eeb993e62b31dd

Compiler version: Ubuntu clang version 14.0.6

Problem:

In file included from /home/ponce/git/rat/src/Stats.cpp:1:
/home/ponce/git/rat/src/Stats.h:2:10: fatal error: 'format' file not found
#include <format>
         ^~~~~~~~
/home/ponce/git/rat/src/basic/Set.cpp:1:10: fatal error: 'boost/unordered/unordered_node_set.hpp' file not found
#include <boost/unordered/unordered_node_set.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:166: CMakeFiles/rat.dir/src/Stats.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /home/ponce/git/rat/src/basic/Relation.cpp:6:
/home/ponce/git/rat/src/basic/../Stats.h:2:10: fatal error: 'format' file not found
#include <format>
         ^~~~~~~~
In file included from /home/ponce/git/rat/src/basic/Renaming.cpp:1:
/home/ponce/git/rat/src/basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:236: CMakeFiles/rat.dir/src/basic/Renaming.cpp.o] Error 1
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:222: CMakeFiles/rat.dir/src/basic/Relation.cpp.o] Error 1
In file included from /home/ponce/git/rat/src/Assumption.cpp:1:
In file included from /home/ponce/git/rat/src/Assumption.h:8:
In file included from /home/ponce/git/rat/src/basic/Set.h:7:
/home/ponce/git/rat/src/basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
In file included from /home/ponce/git/rat/src/basic/Annotated.cpp:1:
In file included from /home/ponce/git/rat/src/basic/Annotated.h:6:
In file included from /home/ponce/git/rat/src/basic/Set.h:7:
/home/ponce/git/rat/src/basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:180: CMakeFiles/rat.dir/src/basic/Annotated.cpp.o] Error 1
In file included from /home/ponce/git/rat/src/basic/Literal.cpp:1:
In file included from /home/ponce/git/rat/src/basic/Literal.h:6:
In file included from /home/ponce/git/rat/src/basic/Annotated.h:6:
In file included from /home/ponce/git/rat/src/basic/Set.h:7:
/home/ponce/git/rat/src/basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
In file included from /home/ponce/git/rat/src/regularTableau/RegularNode.cpp:1:
In file included from /home/ponce/git/rat/src/regularTableau/RegularNode.h:6:
In file included from /home/ponce/git/rat/src/regularTableau/../basic/Literal.h:6:
In file included from /home/ponce/git/rat/src/regularTableau/../basic/Annotated.h:6:
In file included from /home/ponce/git/rat/src/regularTableau/../basic/Set.h:7:
/home/ponce/git/rat/src/regularTableau/../basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
In file included from /home/ponce/git/rat/src/main.cpp:5:
In file included from /home/ponce/git/rat/src/Assumption.h:8:
In file included from /home/ponce/git/rat/src/basic/Set.h:7:
/home/ponce/git/rat/src/basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
1 error generated.
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:152: CMakeFiles/rat.dir/src/Assumption.cpp.o] Error 1
make[3]: *** [CMakeFiles/rat.dir/build.make:250: CMakeFiles/rat.dir/src/basic/Set.cpp.o] Error 1
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:292: CMakeFiles/rat.dir/src/regularTableau/RegularNode.cpp.o] Error 1
In file included from /home/ponce/git/rat/src/parsing/LogicVisitor.cpp:1:
In file included from /home/ponce/git/rat/src/parsing/LogicVisitor.h:11:
In file included from /home/ponce/git/rat/src/parsing/../basic/Literal.h:6:
In file included from /home/ponce/git/rat/src/parsing/../basic/Annotated.h:6:
In file included from /home/ponce/git/rat/src/parsing/../basic/Set.h:7:
/home/ponce/git/rat/src/parsing/../basic/Renaming.h:6:10: fatal error: 'ranges' file not found
#include <ranges>
         ^~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:208: CMakeFiles/rat.dir/src/basic/Literal.cpp.o] Error 1
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:138: CMakeFiles/rat.dir/src/main.cpp.o] Error 1
1 error generated.
make[3]: *** [CMakeFiles/rat.dir/build.make:278: CMakeFiles/rat.dir/src/parsing/LogicVisitor.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:164: CMakeFiles/rat.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:171: CMakeFiles/rat.dir/rule] Error 2
make: *** [Makefile:163: rat] Error 2
ThomasHaas commented 1 week ago

What are your requirements in terms of supported clang/libc++ versions? I think the code uses some modern features (C++20 and higher) that your library version does not support.

Interestingly, I cannot compile master either but for a different reason. It seems some code is missing.

ThomasHaas commented 1 week ago

I just tested it with the same version (clang 14) and got the same problems. However, it works if I use 15.0.0 version preinstalled on my Mac:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I'm not sure if this is really a problem of outdated Clang or an outdated libc++. Is it possible for you to test Clang 15?

hernanponcedeleon commented 1 week ago

The compiler does not seem to be the problem (I assume the warnings are harmless), maybe the library

> cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build
-- The CXX compiler identification is Clang 15.0.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- system: /usr/local;/usr;/;/usr;/usr/local;/usr/X11R6;/usr/pkg;/opt
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")  
-- Boost version: 1.74.0
-- Found ANTLR: /usr/local/lib/antlr-4.10.1-complete.jar (found version "4.1") 
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2251 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'antlr4_runtime' would depend on the targets for
  step(s) 'build_static' under policy CMP0114, but this is being left out for
  compatibility since the policy is not set.
Call Stack (most recent call first):
  cmake/ExternalAntlr4Cpp.cmake:132 (ExternalProject_Add_StepTargets)
  CMakeLists.txt:28 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2251 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'antlr4_runtime' would depend on the targets for
  step(s) 'build_shared' under policy CMP0114, but this is being left out for
  compatibility since the policy is not set.
Call Stack (most recent call first):
  cmake/ExternalAntlr4Cpp.cmake:149 (ExternalProject_Add_StepTargets)
  CMakeLists.txt:28 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/drc/git/rat/build
ThomasHaas commented 1 week ago

So it works now? At least there are no errors.

hernanponcedeleon commented 1 week ago

No ... The above shows the output of running cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build ... I.e. I have clang 15 now. However running cmake --build ./build --target rat -j 10 still fails due to e.g. "format file not found"

ThomasHaas commented 1 week ago

I see. I think on Linux, the compiler always uses libstdc++ as standard implementation which is not provided by Clang and thus upgrading Clang doesn't change anything. It seems to be not so trivial to upgrade libstdc++ without also upgrading the Ubuntu version though. However, Clang provides libc++ which you might be able to use by passing -stdlib=libc++ to the compiler (e.g., by adding it to CPPFLAGS).

hernanponcedeleon commented 1 day ago

This did not help much. After running cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build, I manually edited build/CMakeCache.txt and set CMAKE_CXX_FLAGS:STRING=-stdlib=libc++. But now It complains about several other things

In file included from :  /usr/include/spdlog/spdlog.h10/home/drc/git/rat/src/basic/Literal.hfatal error: ::fatal error: :fatal error: 12 fatal error: fatal error: 2:
:'optional' file not foundIn file included from 'optional' file not found10'optional' file not found/usr/include/spdlog/common.hfatal error: 'algorithm' file not found'format' file not found:

...

fatal error: 'atomic' file not found#include <optional>

...

/usr/include/boost/config/detail/select_stdlib_config.hpp:26:14: fatal error: 'cstddef' file not found