souffle-lang / souffle

Soufflé is a variant of Datalog for tool designers crafting analyses in Horn clauses. Soufflé synthesizes a native parallel C++ program from a logic specification.
http://souffle-lang.github.io/
Universal Permissive License v1.0
916 stars 207 forks source link

sign-compare error in cmake build on MacOS #2128

Closed tlogan closed 2 years ago

tlogan commented 2 years ago

After running cmake -S . -B build, I run into an error with cmake --build build on MacOS 12.0.1

...
[ 65%] Building CXX object src/CMakeFiles/libsouffle.dir/ram/utility/NodeMapper.cpp.o
[ 66%] Building CXX object src/CMakeFiles/libsouffle.dir/reports/DebugReport.cpp.o
[ 66%] Building CXX object src/CMakeFiles/libsouffle.dir/synthesiser/Synthesiser.cpp.o
[ 66%] Building CXX object src/CMakeFiles/libsouffle.dir/synthesiser/Relation.cpp.o
[ 67%] Building CXX object src/CMakeFiles/libsouffle.dir/parser/scanner.cc.o
/Users/thomas/souffle/build/src/parser/scanner.cc:2018:41: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare]
        if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/libsouffle.dir/parser/scanner.cc.o] Error 1
make[1]: *** [src/CMakeFiles/libsouffle.dir/all] Error 2
make: *** [all] Error 2

I've tried setting various flag variables including export CXXFLAGS = "-Wno-error=sign-compare", but none seems to affect the compilation.

tlogan commented 2 years ago

The issue is resolved when I build from the release 2.1 instead of the master branch.

remysucre commented 2 years ago

Still an issue on master, so this should remain open

b-scholz commented 2 years ago

The problem is that source code was produced by the scanner. Can you try setting the flag in the CMakelist.txt.

set(CMAKE_CXX_FLAGS "-Wno-error=sign-compare")
remysucre commented 2 years ago

It compiles now, but I'm failing a lot of tests (958). Is that expected?

b-scholz commented 2 years ago

Which test is this?

b-scholz commented 2 years ago

What are you working on? Send me an email Bernhard.Scholz@sydney.edu.au.

remysucre commented 2 years ago

Moving the discussion on test failures to #2170 per email discussion with Bernhard.