Antlr4 cpp runtime ver. 4.10.1 and 4.10 are in Conan repository now.

174 views
Skip to first unread message

Michal Widera

unread,
Apr 19, 2022, 8:45:47 AM4/19/22
to antlr-di...@googlegroups.com
Hi Antlr4 C++ users!

Antlr4 c++ runtime has been incorporated into Conan repository a while ago.
https://conan.io/center/antlr4-cppruntime
versions: 4.9.3, 4.10 and 4.10.1 are available now.
If someone has problems with C++ build just look into the build script
- https://github.com/conan-io/conan-center-index/blob/master/recipes/antlr4-cppruntime/all/conanfile.py
There are guidelines for specific compiler versions, pitfalls and
corner edges that you can hit during c++ building on different
platforms.
If there are people using ARM version of C++ compiler for Apple -
please step in - there is an build issue problem with uuidlib that I
cannot resolve easily - I don't have access to such hardware or
emulation
If someone is looking for how to use this exemple - here you are:
https://github.com/michalwidera/Antlr4ConanExample

Regards,
Michal Widera

Terence Parr

unread,
Apr 22, 2022, 3:17:12 PM4/22/22
to antlr-di...@googlegroups.com
Hi Michal, is there something I should add to the download page of antlr.org?
Ter

Dictation in use. Please excuse homophones, malapropisms, and nonsense.


On Apr 19, 2022 at 5:44:56 AM, Michal Widera <michal...@gmail.com> wrote:
https://conan.io/center/antlr4-cppruntime

Michal Widera

unread,
Apr 22, 2022, 4:08:44 PM4/22/22
to antlr-di...@googlegroups.com
Hi Terence,

It's up to you - conan is a project led by an open source community
and supported by jfrog company.
In my opinion - it will be the next game changer in C++ environment in
the long term.
But anyone can make changes here. I'm not an important person here.
I've just taken it - created a python script that compiles it on
various platforms linux/macos/windows and puts it into community
review.
Looks like the community was waiting for that.
Someone tried to do it two years ago and failed - I've done it
correctly recently.
I think that mention about available compiled binaries for c++ could
appear on your page - C++ Developers do not need to compile everything
anymore - but it is your decision.

I'm just a bare client of your project - actually I'm creating
retractordb - https://github.com/michalwidera/retractordb and my minor
goal was to kick off Boost::Spirit grammar and use something better.
My scientific colleagues (Phd's, Profs, etc...) did some queries
across - and they pointed - take Antlr4 :-) So - here we are. Your
product has a good opinion in the DSL community.
RetractorDB is my main project - and here I'm lonely-sole-important
person here - nowhere else.
With a small number of people that understand what I'm doing I'm
developing with no wide public audience something important - I hope.
(Finally two years ago my lead profesor (Dissertation in process over
10 years) caught what was about this stuff - Prof. Stefan Kozielski
from Silesian University of Technology)

Conan and Antlr4 stuff was just a small step in this process ...

Regards,
Michal
> --
> You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/antlr-discussion/CAOS7Tu0ONuKDWkYh7sOTVHkJ_vUcy7Bpcj6TcF2y37G%2ByUUFVA%40mail.gmail.com.

Terence Parr

unread,
Apr 22, 2022, 5:19:45 PM4/22/22
to antlr-di...@googlegroups.com
cool. Added note to https://www.antlr.org/download.html and it’s propagating .
Ter
Dictation in use. Please excuse homophones, malapropisms, and nonsense.


Michal Widera

unread,
Apr 22, 2022, 6:04:31 PM4/22/22
to antlr-di...@googlegroups.com

Chris Miner

unread,
Apr 23, 2022, 9:28:12 AM4/23/22
to antlr-discussion
Thanks for putting this up.  This looks much easier that building the cpp runtime in source, which is what I've done previously.

I walked through the example, and ran into some road blocks.  I'm on osx, and new to conan and cmake.  I see you have conan packages available for osx, but for compiler version 12 (I have 13).  Also, the conan install process wants to change the libcxx setting to libstdc++11, which produces an error:

ConanException: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value.

Google tells me this is because it is invalid for clang.  So, I commented out the configure bit in conanfile.py.  That got me to a compile and a binary was produced.  However, the library `libantlr4-runtime.4.10.1.dylib` is not found.  I notice that otool tells me the binary, a4test, is linked against libantlr4-runtime.4.10.1.dylib.  No absolute path, and the library is not found.

chris@goldfish build % otool -L bin/a4test
bin/a4test:
    libantlr4-runtime.4.10.1.dylib (compatibility version 4.10.1, current version 4.10.1)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

The built lib is of course to be found under ~/.conan.  I also tried creating my own conanfile.txt and CMakeLists.txt based on the conan getting started documentation (https://docs.conan.io/en/latest/getting_started.html).  This produced a stream of errors during compilation that I did not experience with the original setup.

I'd love to sort this out.  Any ideas regarding what I should try?

Michal Widera

unread,
Apr 23, 2022, 11:29:08 AM4/23/22
to antlr-di...@googlegroups.com
Hi,

In case of non-supported or not default builded configurations you can
use: conan install .. --build missing
Like I've used for not supported yet gcc 11 in ubuntu 22.04 -
https://github.com/michalwidera/retractordb/blob/master/.circleci/config.yml
But I've no experience in Apple infrastructure builds at all. :-( -
Therefore I've no idea if this will help.
This A4Test is an example that I've needed to integrate with the conan
package asap and take this out of my repository to conan.
The Desired location is here:
https://github.com/conan-io/conan-center-index/tree/master/recipes/antlr4-cppruntime/all/test_package
Current conan test build script is trivial.
There are over 2000 people that listen on Slack Conan Channel -
https://cppalliance.org/slack/
There are also developers responsible for developing this product.
Maybe there are more people that can help you with Apple stuff - I'm
in despair here ... 404 - Apple hardware not found.

Regards,
Michal

Chris Miner

unread,
Apr 23, 2022, 2:14:31 PM4/23/22
to antlr-discussion
Thanks for the response!  As a matter of fact, I did use the --build missing option to get the library built.  That's part of how I got the executable that couldn't find the lib I had built under ~/.conan.  I'm digging through a cmake book (Modern CMake for C++!) now to see if that casts light on the issue.  Thanks for the tip on the cpp slack.  Found that yesterday when learning about conan.  Right now, I don't know enough about conan and cmake to ask the right question. lol

Chris Miner

unread,
Apr 25, 2022, 3:25:55 PM4/25/22
to antlr-discussion
In the event that a newby macos cpp user comes by, the antlr runtime lib could not be found in my case, because it was not on the search path for dynamic libraries.  There are a ton of paths to getting the lib found at run-time, so I won't suggest one here.  Google `install_name_tool` to discover the wonders of @rpath, @loader_path, and @executable_path.  Another friend in learning about this is `otool -l` and `otool -D`.  Again, though, thanks for the conan direction!  Way easier.
Reply all
Reply to author
Forward
0 new messages