[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Getting rid of the rest of Boost (was: Best way to integrate P
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] Getting rid of the rest of Boost (was: Best way to integrate PCRE) |
Date: |
Mon, 4 Oct 2021 00:13:07 +0200 |
On Thu, 30 Sep 2021 13:22:01 +0000 Greg Chicares <gchicares@sbcglobal.net>
wrote:
GC> I plan to do it
Thanks for doing this and finally integrating this! I slightly regret the
loss of LMI_HAS_PCRE, as I think it was cleaner to define this once to be
able to find all places where it is used later, rather than testing for
POSIX platform (as nothing intrinsically ties PCRE to POSIX), but it's not
really a big deal, of course.
Another thing is that the step for building Boost.Regex has somehow
remained in the CI workflow file, but I've now removed it from there
myself, so this is not a problem neither. I've also fixed the problem with
the bad ownership of /opt/lmi/local directory, which somehow ended up being
owned by root, breaking the MSW cross-build using the official makefiles as
it couldn't create gcc-x86_64-pc-linux-gnu subdirectory there. To be
honest, I didn't spend time on finding out how exactly did it happen and
just corrected the problem in the workflow file, but this is somewhat
surprising because /opt/lmi is owned by the non-root user when it is
created, so I could look into this if you'd like.
But for now I'd mostly like to know if you think it would be useful to get
rid of the rest of Boost, so that we could get rid of it entirely. AFAICS
only the following Boost parts are still used (all in the tests):
1. boost::numeric_cast in bourn_cast_test.cpp
This one isn't even really used by default, it has to be explicitly
enabled by defining TEST_BOOST_CAST_INSTEAD and I think it should be
fine to leave the code as is -- if you'd like to test boost_cast<>
instead of lmi bourn_cast<>, you would just need to make sure that
Boost headers are available on the system, e.g. by installing
libboost-dev under Debian.
2. boost::numeric::ublas::vector in expression_template_0_test.cpp
This one is a bit confusing, as since the changes of e89831e23
(C++20-ize two unit tests, 2021-03-01), the Boost class is only
used when C++ 20 or later is used, which I don't quite understand:
I'd rather expect this to be _disabled_ for C++20. In any case, if
we never defined USE_UBLAS at all, this would become the same as the
case (1) above, i.e. we could completely remove Boost from lmi and
just rely on the system Boost headers if we ever wanted to test ublas.
3. boost::lexical_cast in
(a) value_cast_test.cpp
(b) numeric_io_test.cpp
The first one is again the same as above, i.e. Boost function is not
used by default, so I suggest treating it in the same way.
The second one is the only (AFAICS) places where Boost is actually
used right now by default. I don't know if you want to keep this
test (mete_two_thirds_boost), but if you do, we could add the same
kind of TEST_BOOST_LEXICAL_CAST guard for it as is used in (1).
Personally I would just remove it -- and maybe add a test using
std::format(), which should be orders of magnitude faster than
boost::lexical_cast<> and so a more worth comparison target.
Please let me know if you'd like me to make the changes suggested above,
test them and submit a patch with them and, also, removing everything
Boost-related from lmi entirely.
Thanks in advance!
VZ
pgpMDPHPtBTHb.pgp
Description: PGP signature