Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error in Mac #2404

Closed
siscia opened this issue Mar 4, 2023 · 2 comments
Closed

Compilation error in Mac #2404

siscia opened this issue Mar 4, 2023 · 2 comments

Comments

@siscia
Copy link

siscia commented Mar 4, 2023

I got a compilation error while trying to compile on my mac.

The error is:

[ 21%] Building CXX object src/CMakeFiles/libsouffle.dir/parser/scanner.cc.o
/Users/siscia/personal/souffle/build/src/parser/scanner.cc:2406: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) {
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I "solved" it with:

siscia@b0be83766127 souffle % git diff
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 15761d4a6..779acc5bf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -175,7 +175,7 @@ flex_target(scanner parser/scanner.ll ${CMAKE_CURRENT_BINARY_DIR}/parser/scanner
   COMPILE_FLAGS "${SCANNER_COMPILE_FLAGS} -d")

 bison_target(parser parser/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/parser/parser.cc
-             COMPILE_FLAGS "-Wall -Werror -Wno-error=deprecated -Wno-error=other -v -d")
+             COMPILE_FLAGS "-Wall -Wno-error=deprecated -Wno-error=other -v -d")
 add_flex_bison_dependency(scanner parser)


@@ -229,7 +229,7 @@ set_target_properties(compiled PROPERTIES CXX_EXTENSIONS OFF)
 set_target_properties(compiled PROPERTIES POSITION_INDEPENDENT_CODE ON)

 if (NOT MSVC)
-  target_compile_options(libsouffle PUBLIC -Wall -Wextra -Werror -fwrapv)
+  target_compile_options(libsouffle PUBLIC -Wall -Wextra -fwrapv)
 else ()
   target_compile_options(libsouffle PUBLIC /W3 /WX)
 endif ()

And then rebuilding the cmake and compiling again.

I was using bison 3.8.2 and gcc 12.2.

I don't think the patch is good enough for a PR, however I open anyway to help fellow souffle users that might don't know what to do.

If you need anything else, please let me know here.

@quentin
Copy link
Member

quentin commented Apr 25, 2023

Probably fixed by #2299. Please reopen otherwise.

@quentin quentin closed this as completed Apr 25, 2023
@qkmaosjtu
Copy link

image
Although the last commit removed -Werror, I still received the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants