| ID |
Date |
Author |
Topic |
Subject |
|
3131
|
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. |
|
3133
|
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 |
|
3140
|
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. |
|
3141
|
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. |
|
3144
|
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 |
|
3154
|
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. |
|
3163
|
01 Dec 2025 |
Konstantin Olchanski | Info | MIDAS RPC add support for std::string and std::vector<char> | > This is moving slowly. I now have RPC caller side support for std::string and
> std::vector<char>. RPC server side is next. K.O.
The RPC_CXX code is now merged into MIDAS branch feature/rpc_call_cxx.
This code fully supports passing std::string and std::vector<char> through the MIDAS RPC is both directions.
For data passed from client to mserver, memory for string and vector data is allocated automatically as needed.
For data returned from mserver to client, memory to hold returned string and vector data is allocated automatically as
need.
This means that RPC calls can return data of arbitrary size, the rpc caller does not need to know maximum data size.
Removing this limitation was the main motivation for this development.
I completed this code in June 2024, but could not merge it because I broke my git repository (oops). Now I am doing
the merge manually. Changes are isolated to rpc_call_encode(), rpc_call_decode() and rpc_execute(). My intent right
now is to use the new RPC code only for RPCs that pass std::string and std::vector<char>, existing RPCs will use the
old code without any changes. This seems to be the safest way to move forward.
Included is test_rpc() which tests and probes most normal uses cases and some corner cases. When writing the test
code, I found a few bugs in the old MIDAS RPC code. If I remember right, I committed fixes for those bugs to main
MIDAS right then and there.
K.O. |
|
3164
|
02 Dec 2025 |
Konstantin Olchanski | Info | cm_expand_env() | Just to remember, MIDAS has cm_expand_env() to expand environment variables, in
file paths, etc. It is used in several places in mhttpd, msequencer and mjsonrpc.
std::string my_secret_file = cm_expand_env("$HOME/.ssh/authorised_keys");
One could add it everywhere we open files, etc, except for the security
consideration. We should not permit any/every web site to read any/every local
file (directly by injecting malicious js code or by cross-site mjsonrpc call).
Access should be limited to files in designated MIDAS experiment subdirectories.
Places like $HOME/.ssh, $HOME/.cache/google-chrome, etc must be protected.
K.O. |
|
3168
|
05 Dec 2025 |
Konstantin Olchanski | Info | MIDAS RPC add support for std::string and std::vector<char> | > > This is moving slowly. I now have RPC caller side support for std::string and
> > std::vector<char>. RPC server side is next. K.O.
> The RPC_CXX code is now merged into MIDAS branch feature/rpc_call_cxx.
> This code fully supports passing std::string and std::vector<char> through the MIDAS RPC is both directions.
The RPC_CXX in now merged into MIDAS develop. commit 34cd969fbbfecc82c290e6c2dfc7c6d53b6e0121.
There is a new RPC parameter encoder and decoder. To avoid unexpected breakage, it is only used for newly added RPC_CXX
calls, but I expect to eventually switch all RPC calls to use the new encoder and decoder.
As examples of new code, see RPC_JRPC_CXX and RPC_BRPC_CXX, they return RPC data in an std::string and std::vector<char>
respectively, amount of returned data is unlimited, mjsonrpc parameter "max_reply_length" is no longer needed/used.
Also included of RPC_BM_RECEIVE_EVENT_CXX, it receives event data as an std::vector<char> and maximum event size is no
longer limited, ODB /Experiment/MAX_EVENT_SIZE is no longer needed/used. To avoid unexpected breakage, this new code is not
enabled yet.
K.O. |
|
3170
|
05 Dec 2025 |
Konstantin Olchanski | Info | address and thread sanitizers | I added cmake support for the thread sanitizer (address sanitizer was already
there). Use:
make cmake -j YES_THREAD_SANITIZER=1 # (or YES_ADDRESS_SANITIZER=1)
However, thread sanitizer is broken on U-24, programs refuse to start ("FATAL:
ThreadSanitizer: unexpected memory mapping") and report what looks like bogus
complaints about mutexes ("unlock of an unlocked mutex (or by a wrong thread)").
On macos, thread sanitizer does not report any errors or warnings or ...
P.S.
The Undefined Behaviour Sanitizer (UBSAN) complained about a few places where
functions could have been called with a NULL pointer arguments, I added some
assert()s to make it happy.
K.O. |
|
3186
|
17 Dec 2025 |
Derek Fujimoto | Info | mplot updates | Hello everyone,
Stefan and I have make a few updates to mplot to clean up some of the code and make it more usable directly from Javascript. With one exception this does not change the html interface. The below describes changes up to commit cd9f85c.
Breaking Changes:
- The idea is to have a "graph" be the overarching figure object, whereas the "plot" is the line or points associated with a single dataset.
- Some internal variable names have been changed to reflect this while minimizing breaking changes
- defaultParam renamed defaultGraphParam.
- There is no longer an initialized defaultParam.plot[0], these defaults are now defaultPlotParam which is a separate global variable
- MPlotGraph constructor signature MPlotGraph(divElement, param) changed to MPlotGraph(divElement, graphParam)
- HTML key data-bgcolor changed to data-zero-color as the former was misleading
New Features
- New addPlot() function.
- While the functionality of setData is preserved you can now use addPlot(plotParam) to add a new plot to the graph with minimal copying of the old defaultParam.plot[0]
- Minimal example, from plot_example.html: given some div container with id "P6":
let d = document.getElementById("P6"); // get div
d.mpg = new MPlotGraph(d, { title: { text: "Generated" }}); // make graph
d.mpg.addPlot( { xData: [0, 1, 2, 3, 4], yData: [10, 12, 12, 14, 11] } ); // add plot to the graph
- modifyPlot() and deletePlot() still to come
- New lines styles: none, solid, dashed, dotted
- Barplot-style category plots
|
|
3187
|
04 Jan 2026 |
Stefan Ritt | Info | Ad-hoc history plots of slow control equipment | After popular demand and during some quite holidays I implemented ad-hoc history plots. To enable this
for a certain equipment, put
/Equipment/<name>/Settings/History buttons = true
into the ODB. You will then see a graph button after each variable. Pressing this button reveals the history
for this variable, see attachment.
Stefan |
| Attachment 1: Screenshot_2026-01-04_at_14.41.55.png
|
|
|
3195
|
20 Jan 2026 |
Stefan Ritt | Info | New tabbed custom pages | Tabbed custom pages have been implemented in MIDAS. Below you see and example. The documentation
is here:
https://daq00.triumf.ca/MidasWiki/index.php/Custom_Page#Tabbed_Pages
Stefan |
| Attachment 1: tabbed_page.png
|
|
|
3196
|
23 Jan 2026 |
Mathieu Guigue | Info | Homebrew support for midas | Dear all,
For my personal convenience, I started to add an homebrew formula
for
midas (*):
https://github.com/guiguem/homebrew-tap/blob/main/Formula/
midas.rb
It
is convenient in particular to deploy as it automatically gets all
the right
dependencies; for MacOS (**), there are bottles already available.
The
installation would then be
brew tap guiguem/tap
brew install midas
I
thought I
would share it here, if this is helpful to someone else (***).
This
was tested
rather extensively, including the development of manalyzer modules
using this
bottled version as backend.
A possible upgrade (if people are
interested) would
be to develop/deploy a "mainstream" midas version (and I would
rename mine
"midas-mod").
Cheers
Mathieu
-----
Notes:
(*) The version installed
by this
formula is a very slightly modified version of midas, designed to
support more
than 100 front-ends (needed for HK).
See commits here:
https://
gitlab.in2p3.fr/
hk/clocks/midas/-/
commit/060b77afb38e38f9a3155d2606860f12d680f4de
https://
gitlab.in2p3.fr/hk/
clocks/midas/-/
commit/1da438ad1946de7ba697e849de6a6675ac45ebb8
I have the
recollection this
version might not be compatible with the main midas one.
(**) I also have some
stuff for Ubuntu, but Ubuntu seems to do additional
linkage to curl which needs
to be handled (easy).
That being said the
installation from sources works fine!
(***) Some oddities were unraveled such as
the fact that the build_interface
pointing to the source include directory are
still appearing in the
midasConfig.cmake files (leading to issues in brew). This
was fixed by replacing
the faulty path to the final installation location. Maybe
this should be fixed ? |
|
3197
|
23 Jan 2026 |
Stefan Ritt | Info | Homebrew support for midas | Hi Mathieu,
thanks for your contribution. Have you looked at the install.sh script I developed last week:
https://daq00.triumf.ca/MidasWiki/index.php/Install_Script
which basically does the same, plus it modifies the environment and installs mhttpd as a service.
Actually I modeled the installation after the way Homebrew is installed in the first place (using curl).
I wonder if the two things can kind of be integrated. Would be great to get with brew always the newest midas version, and it would also
check and modify the environment.
If you tell me exactly what is wrong MidasConfig.cmake.in I'm happy to fix it.
Best,
Stefan |
|
3198
|
23 Jan 2026 |
Mathieu Guigue | Info | Homebrew support for midas | Thanks Stefan!
Actually, these two approaches are slightly different I guess:
- the installation script you are linking manages the
installation and the subsequent steps, but doesn't manage the dependencies: for instance on my machine, it didn't find root and so manalyzer
is built without root support.
Maybe this is just something to adapt?
Brew on the other hand manages root and so knows how to link these two
together.
- The nice thing I like about brew is that one can "ship bottles" aka compiled version of the code; it is great and fast for
deployment and avoid compilation issues.
- I like that your setup does deploy and launch all the necessary executables ! I know brew can do
this too via brew services (see an example here: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/r/rabbitmq.rb#L83 ), maybe worth
investigating...?
- Brew relies on code tagging to better manage the bottles, so that it uses the tag to get a well-defined version of the
code and give a name to the version.
I had to implement my own tags e.g. midas-mod-2025-12-a to get a release.
I am not sure how to do in the
case of midas where the tags are not that frequent...
Thank you for the feedback, I will make the modifications (aka naming my formula
``midas-mod'') so that it doesn't collide with a future official midas one.
Concerning the MidasConfig.cmake issue, this is what I need
(note that the INTERFACE_INCLUDE_DIRECTORIES is pointing to
/opt/homebrew/Cellar/midas/midas-mod-2025-12-a/)
set_target_properties(midas::midas PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "HAVE_CURL;HAVE_MYSQL;HAVE_SQLITE;HAVE_FTPLIB"
INTERFACE_COMPILE_OPTIONS "-I/opt/homebrew/Cellar/mariadb/12.1.2/include/mysql;-I/opt/homebrew/Cellar/mariadb/12.1.2/include/mysql/mysql"
INTERFACE_INCLUDE_DIRECTORIES "/opt/homebrew/Cellar/midas/midas-mod-2025-12-a/;${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "/opt/
homebrew/opt/zlib/lib/libz.dylib;-lcurl;-L/opt/homebrew/Cellar/mariadb/12.1.2/lib/ -lmariadb;/opt/homebrew/opt/sqlite/lib/libsqlite3.dylib"
)
whereas by default INTERFACE_INCLUDE_DIRECTORIES points to the source code location (in the case of brew, something like /private/<some-
hash> ).
Brew deletes the source code at the end of the installation, whereas midas seems to rely on the fact that the source code is still
present...
Does it help?
A way to fix is to search for this ``/private'' path and replace it, but this isn't ideal I guess...
This is what I
did in the midas formula:
--------
# Fix broken CMake export paths if they exist
cmake_files = Dir["#{lib}/**/*manalyzer*.cmake"]
cmake_files.each do |file|
if File.read(file).match?(%r{/private/tmp/midas-[^/"]+})
inreplace file, %r{/private/tmp/midas-
[^/"]+},
prefix.to_s
end
inreplace file, %r{/tmp/midas-[^/"]+}, prefix.to_s if File.read(file).match?(%r{/tmp/midas-[^/"]+})
end
cmake_files = Dir["#{lib}/**/*midas*.cmake"]
cmake_files.each do |file|
if File.read(file).match?(%r{/private/tmp/midas-
[^/"]+})
inreplace file, %r{/private/tmp/midas-[^/"]+},
prefix.to_s
end
inreplace file, %r{/tmp/midas-[^/"]+},
prefix.to_s if File.read(file).match?(%r{/tmp/midas-[^/"]+})
end
-----
I guess this code could be changed into some bash commands and
added to your script?
Thank you very much again!
Mathieu
> Hi Mathieu,
>
> thanks for your contribution. Have you looked at the
install.sh script I developed last week:
>
> https://daq00.triumf.ca/MidasWiki/index.php/Install_Script
>
> which basically does the
same, plus it modifies the environment and installs mhttpd as a service.
>
> Actually I modeled the installation after the way Homebrew is
installed in the first place (using curl).
>
> I wonder if the two things can kind of be integrated. Would be great to get with brew always
the newest midas version, and it would also
> check and modify the environment.
>
> If you tell me exactly what is wrong
MidasConfig.cmake.in I'm happy to fix it.
>
> Best,
> Stefan |
|
3199
|
26 Jan 2026 |
Stefan Ritt | Info | Homebrew support for midas | > Actually, these two approaches are slightly different I guess:
> - the installation script you are linking manages the
> installation and the subsequent steps, but doesn't manage the dependencies: for instance on my machine, it didn't find root and so manalyzer
> is built without root support.
> Maybe this is just something to adapt?
Yes indeed. From your perspective, you probably always want ROOT with MIDAS. But at PSI here we have several installation where we do not
need ROOT. These are mainly beamline control PCs which just connect to EPICS or pump station controls replacing Labview installations. All
graphics there is handled with the new mplot graphs which is better in some case.
I therefore added a check into install.sh which tells you explicitly if ROOT is found and included or not. Then it's up to the user to choose to
install ROOT or not.
> Brew on the other hand manages root and so knows how to link these two
> together.
If you really need it, yes.
> - The nice thing I like about brew is that one can "ship bottles" aka compiled version of the code; it is great and fast for
> deployment and avoid compilation issues.
> - I like that your setup does deploy and launch all the necessary executables ! I know brew can do
> this too via brew services (see an example here: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/r/rabbitmq.rb#L83 ), maybe worth
> investigating...?
Indeed this is an advantage of brew, and I wholeheartedly support it therefore. If you decide to support this for the midas
community, I would like you to document it at
https://daq00.triumf.ca/MidasWiki/index.php/Installation
Please talk to Ben <bsmith@triumf.ca> who manages the documentation and can give you write access there. The downside is that you will
then become the supporter for the brew and all user requests will be forwarded to you as long as you are willing to maintain the package ;-)
> - Brew relies on code tagging to better manage the bottles, so that it uses the tag to get a well-defined version of the
> code and give a name to the version.
> I had to implement my own tags e.g. midas-mod-2025-12-a to get a release.
> I am not sure how to do in the
> case of midas where the tags are not that frequent...
Yes we always struggle with the tagging (what is a "release", when should we release, ...). Maybe it's the simplest if we tag once per month
blindly with midas-2026-02a or so. In the past KO took care of the tagging, he should reply here with his thoughts.
> Thank you for the feedback, I will make the modifications (aka naming my formula
> ``midas-mod'') so that it doesn't collide with a future official midas one.
Nope. The idea is that YOU do the future official midas realize from now on ;-)
> Concerning the MidasConfig.cmake issue, this is what I need ...
Let's take this offline not to spam others.
Best,
Stefan |
|
146
|
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 |
|
172
|
04 Nov 2004 |
Jan Wouters | Forum | Frontend code and the ODB | I would like to know whether all parameters used by the frontend code have to be in the "Experiment/
Run Parameters" section. This section can become big and difficult to maintain, because it is one single
big section of experim.h (EXP_PARAM_DEFINED). I have parameters the various frontends read at the
beginning of each run, which set the hardware settings of various devices. I would like to place these in
a section all their own, organized by device. Is this doable? |
|
173
|
04 Nov 2004 |
Stefan Ritt | Forum | Frontend code and the ODB | Hi Jan,
I usually keep under /Experiment/Run Parameters only those settings which are kind of "global" and thus of
interest to frontend *and* analyzer, like a run mode (data/calibration/cosmic/...). Settings more specific to a
frontend I keep under /Equipment/<name>/Settings where <name> is the equipment name the specific frontend
produces. In your case each frontend will then get its own tree (related to each fragment). Please note that
both discussed trees can contain a whole tree with subdirectories, which lets you organize your data better.
Best regards, Stefan. |
|