23 Sep 2025, Pavel Murat, Info, switch midas to c++17
|
perhaps c++20? - std::format is an immediately useful feature. --regards, Pasha
> Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17. There is
> many new features and we want to start using some of them.
>
> Per my previous message https://daq00.triumf.ca/elog-midas/Midas/3084,
> c++17 is available on current MacOS, U-22 and newer, el9 and newer, D-12 and newer.
>
> (ROOT moved to C++17 as of release 6.30 on November 6, 2023)
>
> As I reported earlier, MIDAS already builds with c++23 on U-24, and this move does not require any
> actual code changes other than a bump of c++ version in CMakeLists.txt and Makefile.
>
> Please let us know if this change will cause problems or if you think that we should move to an older
> c++ (c++14) or newer c++ (c++20 or c++23 or c++26).
>
> If we do not hear anything, we will implement this change in about 2-3 weeks.
>
> K.O. |
23 Sep 2025, Konstantin Olchanski, Info, long history variable names
|
To record discussion with Stefan about long history variable names.
We have several requests to remove the 32-byte limit on history variable names.
Presently, history variable names are formed from two 32-byte strings: history event name and
history tag name:
* history event name is usually same as the equipment name (also a 32-byte string)
* history tag name is composed from /eq/xxx/variables/yyy name (also a 32-byte string) or from
names in /eq/xxx/variables/names and "names zzz", which can have arbitrary length (and tag name
would have to be truncated).
This worked well for "per-equipment" history, history events corresponded to equipment/variables
and all data from equipment/variables were written together in one go. (this very inefficient if
values of only one variable is updated).
Then at some point we implemented "per-variable" history:
* history event name is a equipment name (32-byte string) plus /eq/xxx/variables/vvv variable name
(also 32-byte string). (obviously truncation is quite possible)
* history tag name is unchanged (also can be truncated)
With "per-variable" history, history events correspond to individual variables (ODB entries) in
/eq/xxx/variables. If value of one variable is updated, only that variable is written to ODB. This
is much more efficient. (If variable is an array, the whole array is written, is variable is a
subdirectory, the whole subdirectory is written).
We considered even finer granularity, writing to history file only the one value that changed, but
decided against slicing the data too fine. (for arrays, MIDAS frontends usually update all values
of an array, as in "array of 10 temperatures" or "array of 4000 high voltages").
Many years later, we have the SQL history and the FILE history which do not have the 32-byte limit
on history event names and history tag names (no limit in the MIDAS C++ code. MySQL and PgSQL have
limits on table name and column name lengths, 64 bytes and 31 bytes respectively, best I can
tell).
But the API still uses the MIDAS "struct TAG" with the 32-byte tag name length limit.
It is pretty easy to change the API to use a new "struct TAG_CXX" with std::string unlimited-
length tag names, but the old MIDAS history will be unable to deal with long names. Hence
the discussion about removing the old MIDAS history and keeping only the FILE and SQL history
(plus the mhdump and mh2sql tools to convert old history files to the new formats).
(some code in mhttpd may need to be corrected for long history names. javascript code should be
okey, history plot code may need adjustment to display pathologically long names. use small font,
truncate, etc).
K.O. |
23 Sep 2025, Konstantin Olchanski, Info, switch midas to c++17
|
> perhaps c++20? - std::format is an immediately useful feature. --regards, Pasha
confirmed. std::format is an improvement over K&R C printf().
but seems unavailable on U-20 and older, requires --std=c++20 on U-24 and MacOS.
but also available as a standalone library: https://github.com/fmtlib/fmt
myself, I use printf() and msprintf(), I think std::format is in the "too little, too late to save C++"
department.
K.O. |
23 Sep 2025, Pavel Murat, Info, switch midas to c++17
|
> > perhaps c++20? - std::format is an immediately useful feature. --regards, Pasha
>
> confirmed. std::format is an improvement over K&R C printf().
>
> but seems unavailable on U-20 and older, requires --std=c++20 on U-24 and MacOS.
agreed! - availability is significantly more important. -- regards, Pasha |
24 Sep 2025, Andreas Suter, Info, obsolete mana.c removal
|
Sorry,
I have had now the time to dig deeper in our code and realized that we actually use rmana, i.e. WITH ROOT. If there is an easy way to incorporate the necessary parts temporarily to our side, we will do it. Without ROOT this would have been quite easy, with ROOT, I am not that sure. Anyhow, as said the timeline for this is only until end of 2026.
Andreas
> > Hi, at the LEM Experiment at PSI, we still use mana.c and would like to keep it until end of 2026, where we will enter a long shutdown.
>
> Excellent, good to hear from you! Once we remove ROOT support rmana.o will be gone, only mana.o (no ROOT) will remain. Will this break your builds?
>
> One solution could be to copy mana.c from MIDAS into your source tree and compile/link it from there (not from MIDAS).
>
> Perhaps the way to proceed is create a test branch with ROOT and mana.c removed, you can try it,
> report success/fail and we go from there.
>
> We should schedule this work for when both of us have a block of free time to work on it.
>
> K.O. |
06 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17
|
> Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17.
There were no objections to this move.
There was one suggestion to use std::format available in c++20 (MIDAS has very similar msprintf()).
We shall move forward with this change.
K.O. |
06 Nov 2025, Konstantin Olchanski, Info, removal of ROOT support in mlogger
|
> we should finally bite the bullet and remove ROOT support from MIDAS ...
there were no objections to removing ROOT support from mlogger.
there was a request to keep rmana.
We shall move forward with this:
- remove all the HAVE_ROOT code from mlogger.cxx
- for now, keep HAVE_ROOT in CMakefile (HAVE_ROOT was removed from Makefile a long time ago)
- for now, keep rmana
- look into moving rmana to a separate package or a separate subdirectory and keep maximum compatibility
with existing make files.
K.O.
> Historically, building MIDAS with ROOT caused us many problems - build failures because of c++ version
> mismatch, CFLAGS mismatch; run-time failures because of ROOT library mismatches; etc, etc.
>
> Following discussions at the MIDAS Workshop, we think we should finally bite the bullet and remove ROOT
> support from MIDAS:
>
> - remove support for writing data in ROOT TTree format in mlogger (rmlogger)
> - remove support for ROOT in mana.c based analyzer (which itself we propose to remove)
> - remove ROOT helper functions in rmidas.h
> - remove ROOT support in cmake
> - remove rmlogger and rmana
>
> This change will not affect the rootana and manalyzer packages, they will continue to be built with
> ROOT support if ROOT is available.
>
> Right now, we cannot remember any experiment that uses the ROOT TTree output function in mlogger.
>
> If you use this feature, we very much would like to hear from you. Please contact Stefan or myself or
> reply to this message.
>
> As replacement for rmlogger, we could implement identical or similar functionality using an manalyzer-
> based custom logger, but we need at least one user who can test it for us and confirm that it works
> correctly.
>
> K.O. |
06 Nov 2025, Konstantin Olchanski, Info, make clang-tidy
|
I added Makefile rules for running MIDAS through the clang-tidy static code
analyzer. (rules for running cppcheck have gone missing, I hope I find them).
Reports from clang-tidy are somewhat repetitive (complain about the same class of
non-problem problems repeatedly), but several warnings and errors identified real
bugs.
Specifically, detection of memory leaks in error paths and detection of NULL
pointer dereference and use of uninitialized variables is pretty solid.
Fixes for the worst problems reported by cppcheck and clang-tidy are already
committed to midas git.
K.O. |
10 Nov 2025, Konstantin Olchanski, Info, db_delete_key(TRUE)
|
> I would handle this actually like symbolic links are handled under linux. If you delete a symbolic link, the link gets
> detected and NOT the file the link is pointing to.
>
> So I conclude that the "follow links" is a misconception and should be removed.
I am finally writing test code for the ODB API, partially to discover what db_delete_key(TRUE) actually does,
because when I went ahead to remove it, I found that it's use is inconsistent. And indeed
it does strange and unexpected things, I will proceed with removing it.
K.O. |
20 Nov 2025, Konstantin Olchanski, Info, db_delete_key(TRUE)
|
> > I would handle this actually like symbolic links are handled under linux. If you delete a symbolic link, the link gets
> > detected and NOT the file the link is pointing to.
> >
> > So I conclude that the "follow links" is a misconception and should be removed.
>
> I am finally writing test code for the ODB API, partially to discover what db_delete_key(TRUE) actually does,
> because when I went ahead to remove it, I found that it's use is inconsistent. And indeed
> it does strange and unexpected things, I will proceed with removing it.
>
this is now merged into develop. there will be deprecation warnings from mvodb and from midas_c_compat, I and Ben will clean
them up, just not today.
for more detail, see separate message.
K.O. |
20 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17
|
> > Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17.
> We shall move forward with this change.
It is done. Last c++11 MIDAS is midas-2025-11-a (plus the db_delete_key merge).
I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely
the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
K.O. |
20 Nov 2025, Konstantin Olchanski, Info, removal of ROOT support in mlogger
|
> > we should finally bite the bullet and remove ROOT support from MIDAS ...
as discussed, HAVE_ROOT and OBSOLETE were removed from mlogger. rmana and ROOT support in manalyzed remain,
untouched.
last rmlogger is in MIDAS tagged midas-2025-11-a.
K.O. |
20 Nov 2025, Nick Hastings, Info, switch midas to c++17
|
> I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely
> the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
Does adding
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Get it to do the right thing?
Cheers,
Nick.. |
21 Nov 2025, Konstantin Olchanski, Info, cppcheck
|
> (rules for running cppcheck have gone missing, I hope I find them).
found them. I built cppcheck from sources.
520 ~/git/cppcheck/build/bin/cppcheck src/midas.cxx
523 ~/git/cppcheck/build/bin/cppcheck manalyzer/manalyzer.cxx manalyzer/mjsroot.cxx
524 ~/git/cppcheck/build/bin/cppcheck src/tmfe.cxx
525 ~/git/cppcheck/build/bin/cppcheck midasio/*.cxx
526 ~/git/cppcheck/build/bin/cppcheck mjson/*.cxx
K.O. |
24 Nov 2025, Stefan Ritt, Info, switch midas to c++17
|
> > > Following discussions at the MIDAS workshop, we propose to move MIDAS from c++11 to c++17.
> > We shall move forward with this change.
>
> It is done. Last c++11 MIDAS is midas-2025-11-a (plus the db_delete_key merge).
>
> I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely
> the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
>
> K.O.
We should either use
set(CMAKE_CSS_STANDARD 17)
or
target_compile_features(<target> PUBLIC cxx_std_17)
but not mix both. We have already the second one for the midas library, like
target_compile_features(objlib PUBLIC cxx_std_17)
which correctly causes a
c++ -std=gnu++17 ...
(at leas in my case).
If the compiler flag is missing for a target, we should add the target_compile_feature above for that target.
Stefan |
25 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17
|
>
> > I notice the cmake does not actually pass "-std=c++17" to the c++ compiler, and on U-20, it is likely
> > the default c++14 is used. cmake always does the wrong thing and this will need to be fixed later.
>
> set(CMAKE_CXX_STANDARD 17)
> set(CMAKE_CXX_STANDARD_REQUIRED ON)
>
We used to have this, it is not there now.
>
> Get it to do the right thing?
>
Unlikely, as Stefan reported, asking for C++17 yields -std=gnu++17 which is close enough, but not the same
thing.
For now, it does not matter, U-22 and U-24 are c++17 by default, if somebody accidentally commits c++20
code, builds will fail and somebody will catch it and complain, plus the weekly bitbucket build will bomb-
out.
On U-20, default is c++14 and builds will start bombing out as soon as we commit some c++17 code.
el7 builds have not worked for some time now (a bizarre mysterious error)
el8, el9, el10 likely same situation as Ubuntu.
macos, not sure.
K.O. |
25 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17
|
> target_compile_features(<target> PUBLIC cxx_std_17)
> which correctly causes a
> c++ -std=gnu++17 ...
I think this is set in a couple of places, yet I do not see any -std=xxx flag passed to the compiler.
(and I am not keen on spending a full day fighting cmake)
(btw, -std=c++17 and -std=gnu++17 are not the same thing, I am not sure how well GNU extensions are supported on
macos)
K.O. |
26 Nov 2025, Stefan Ritt, Info, switch midas to c++17
|
I switched from
target_compile_features(<target> PUBLIC css_std_17)
to
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # optional: disables GNU extensions
Which is now global in the CMakeLists.txt, so we only have to deal with one location if we want to change it. It also turns off the g++ options. On my
Mac I get now a clean
-std=c++17
Please everybody test on your side. Change is committed.
Stefan |
27 Nov 2025, Konstantin Olchanski, Info, switch midas to c++17
|
>
> set(CMAKE_CXX_STANDARD 17)
> set(CMAKE_CXX_STANDARD_REQUIRED ON)
> set(CMAKE_CXX_EXTENSIONS OFF) # optional: disables GNU extensions
>
Looks like it works, I see -std=c++17 everywhere. Added same to manalyzer and mscb (mscb was still c++11).
Build on U-20 works (g++ accepts -std=c++17), build on CentOS-7 bombs, cmake 3.17.5 does not know CXX17.
K.O. |
28 Sep 2004, Piotr Zolnierczuk, Forum, MIDAS/MVME167/Linux
|
Hi,
has anyone tried runnning midas frontend on a Linux running
on a Motorola MVME167 motorola embedded CPU?
I have seen people running Linux on a MV167
(http://www.sleepie.demon.co.uk/linuxvme/)
so in principle this can be done.
The reason I am asking is that we have a lot of them in house
and we would like to avoid paying for VxWorks
(I have succesfully run Midas on a mvme167/VxWorks node)
Or maybe one has come up with a much better solution
[short of dumping mv167 into a sewer :)]
Piotr |
|