antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
16.95k stars 3.26k forks source link

Error building regexParser.h file #4087

Open matheusPereiraAlmeida opened 1 year ago

matheusPereiraAlmeida commented 1 year ago

Hi,

I'm trying to build this repo approxProbTraceAlign and I'm using ubuntu-22.04.01. One of its dependencies is the antlr4, but i'm getting the following error when I use the comand make fuzzyStringMatching2:

[ 4%] Built target gvpp [ 19%] Built target yaml-cpp [ 76%] Built target antlr4_static [ 80%] Automatic MOC and UIC for target fuzzyStringMatching2 [ 80%] Built target fuzzyStringMatching2_autogen Consolidate compiler generated dependencies of target fuzzyStringMatching2 [ 80%] Building CXX object CMakeFiles/fuzzyStringMatching2.dir/antlr4/cpp/antlr4/regexBaseListener.cpp.o In file included from /home/matheus100/approxProbTraceAlign/antlr4/cpp/antlr4/regexListener.h:8, from /home/matheus100/approxProbTraceAlign/antlr4/cpp/antlr4/regexBaseListener.h:8, from /home/matheus100/approxProbTraceAlign/antlr4/cpp/antlr4/regexBaseListener.cpp:5: /home/matheus100/approxProbTraceAlign/antlr4/cpp/antlr4/regexParser.h:28:43: error: ‘virtual const std::vector<std::__cxx11::basic_string<char> >& regexParser::getTokenNames() const’ marked ‘override’, but does not override 28 | virtual const std::vector<std::string>& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead. | ^~~~~~~~~~~~~ make[3]: *** [CMakeFiles/fuzzyStringMatching2.dir/build.make:90: CMakeFiles/fuzzyStringMatching2.dir/antlr4/cpp/antlr4/regexBaseListener.cpp.o] Error 1 make[2]: *** [CMakeFiles/Makefile2:1272: CMakeFiles/fuzzyStringMatching2.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:1279: CMakeFiles/fuzzyStringMatching2.dir/rule] Error 2 make: *** [Makefile:190: fuzzyStringMatching2] Error 2

java --version openjdk 11.0.17 2022-10-18 OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04) OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)

Apache Maven 3.6.3 Maven home: /usr/share/maven Java version: 11.0.17, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-58-generic", arch: "amd64", family: "unix"

my python3 is Python 3.10.6

UPDATE

I found this issue here that seems to be related issue, then I tried to Set ANTLR4_TAG to e4c1a74 as mentioned there, but the error still is happening. I also tried to downgrade the c++ and gcc to 9 (I was using 10), but it didn`t solve the problem either =(

jklappenbach commented 1 year ago

For OSX: I'm having the same equivalent of this issue, too. It's with their code generation tools, and it's generating code for the target child class that doesn't exist (vmethod override). I also tried to rebuild the java jar for the tag, but that didn't help either. Older versions don't feature this issue, but have tons of warnings from deprecated C++ library invocations. Newer versions have this code generation issue.

Switching to Ubuntu, the tag e4c1a74, along with compiler version below appears to work. I guess I'll be working off of linux until they get their house in order.

Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.2.0-3ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-U8K4Qv/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-U8K4Qv/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1)

OldSkool42 commented 2 months ago

Hi matheusPereiraAlmeida, I saw your post. I am also trying to build a repo that requires gvpp executable, and I need to resolve that dependency on gvpp, which my shell cannot find, Do you happen to know what gvpp is? I looked it up on the web, however I did not find a satisfactory explanation. Thank you.