| ID |
Date |
Author |
Topic |
Subject |
|
3207
|
09 Apr 2026 |
Nick Hastings | Forum | Migrate Legacy code to current Midas version | > I am an applied physicist at Canadian Nuclear Laboratories and am in the process
> of migrating the full experiment configuration—including the front-end interface—
> of the CRIPT muon tomography detector from a legacy version of MIDAS (SVN Rev.
> 5238, circa 2012) to a more modern release.
> The current system runs on Scientific Linux 6 and very old hardware. Due to
> substantial changes in the MIDAS codebase over the years, I have encountered
> multiple compatibility issues during the migration. I have also attempted to build
> and run the legacy MIDAS version and the front-end code using GCC 4.8 on a modern
> Linux system (Ubuntu 24.04), but without success.
I suggest updating the midas version. You should be able to get to at least midas 2024-12-a
without breaking anything.
> Could you please advise on the recommended approach for upgrading or refactoring
> legacy MIDAS front-end code to the current framework? Any guidance or best
> practices would be greatly appreciated.
Start here: https://daq00.triumf.ca/MidasWiki/index.php/Changelog
The 2019-06 release was the c -> c++ transition. Read that section carefully.
The 2020-12 update also had a change that you will also likely want to update your FEs for.
You will also likely encounter a quite a few non-midas issues related to the newer compilers.
Updates to your front ends may include things like needing to use "const char*" instead of "char*",
adding extra headers like <cstring> and <cstdlib>, using ctime_r() instead of ctime(), etc
Post back if you have specific questions.
P.S. I'm maintaining a number of midas FEs mostly written around 2007-2009.
These were running on SL5 and SL6 for many years and are now on Alma 9 with
midas 2024-12-a. |
|
Draft
|
23 Apr 2026 |
Nick Hastings | Bug Report | increasing the max number of hot links in ODB | > Dear MIDAS experts,
>
> when I attempted to increase the max number of hotlinks in ODB , defined as
>
> #define MAX_OPEN_RECORDS 256 /**< number of open DB records */
>
> I started running into an assertion in midas/src/odb.cxx
>
> https://bitbucket.org/tmidas/midas/src/fa5457b5274a6b42c5ed8b6dea5e3cdd43de38fe/src/odb.cxx#lines-1525 :
>
> assert(sizeof(DATABASE_CLIENT) == 2112);
>
> is it possible that the size of the DATABASE_CLIENT structure should be checked against 64+sizeof(OPEN_RECORD)*MAX_OPEN_RECORDS ?
> - 64 clearly can be expressed in a better maintainable form
Yes, this assert needs to be updated if you increase MAX_OPEN_RECORDS. See
https://daq00.triumf.ca/MidasWiki/index.php/FAQ#Increasing_Number_of_Hot-links
> UPDATE: similar consideration holds for the size of the DATABLE_HEADER structure, which is also checked against a constant
>
> https://bitbucket.org/tmidas/midas/src/fa5457b5274a6b42c5ed8b6dea5e3cdd43de38fe/src/odb.cxx#lines-1526
Yes DATABASE_HEADER can also be updated, but the associated assert()s need to be updated too.
FYI I have done both of these things and have attached patches.
Cheers,
Nick. |
| Attachment 1: 0001-Increase-MAX_OPEN_RECORDS-to-increase-the-max-number.patch
|
From 6ac1ad23e1e0c8fcfdbb25844ace9de3ab7a993b Mon Sep 17 00:00:00 2001
From: Nick Hastings <hastings@post.kek.jp>
Date: Tue, 19 Sep 2023 08:57:11 +0900
Subject: [PATCH 1/2] Increase MAX_OPEN_RECORDS to increase the max number of
hot_links
In 2011 the number of hotlinks for the gsc was increased from the
default 256 to 2560. See https://elog.nd280.org/elog/GSC/425. Since we
are getting more equipment, increase to 4096. General
instructions can be found on the midas wiki at.
https://daq00.triumf.ca/MidasWiki/index.php/FAQ#Increasing_Number_of_Hot-links
When increasing this number the size of two structs will also
increase. Midas checks the size of these structs are correct, so
updated the check sizes.
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS
default: = 64 + 8*256
= 2112 -> Confirmed in odb.cxx
updated: = 64 + 8*4096
= 32832
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT
default: = 64 + 64*2112
= 135232 -> Confirmed in odb.cxx
updated: = 64 + 64*32832
= 2101312
---
include/midas.h | 2 +-
src/odb.cxx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/midas.h b/include/midas.h
index ec6b54a1..46d653f4 100644
--- a/include/midas.h
+++ b/include/midas.h
@@ -273,7 +273,7 @@ class MJsonNode; // forward declaration from mjson.h
#define HOST_NAME_LENGTH 256 /**< length of TCP/IP names */
#define MAX_CLIENTS 64 /**< client processes per buf/db */
#define MAX_EVENT_REQUESTS 10 /**< event requests per client */
-#define MAX_OPEN_RECORDS 256 /**< number of open DB records */
+#define MAX_OPEN_RECORDS 4096 /**< number of open DB records */
#define MAX_ODB_PATH 256 /**< length of path in ODB */
#define BANKLIST_MAX 4096 /**< max # of banks in event */
#define STRING_BANKLIST_MAX BANKLIST_MAX * 4 /**< for bk_list() */
diff --git a/src/odb.cxx b/src/odb.cxx
index e4e2bd35..bc084612 100644
--- a/src/odb.cxx
+++ b/src/odb.cxx
@@ -1477,8 +1477,8 @@ static void db_validate_sizes()
assert(sizeof(KEY) == 68);
assert(sizeof(KEYLIST) == 12);
assert(sizeof(OPEN_RECORD) == 8);
- assert(sizeof(DATABASE_CLIENT) == 2112);
- assert(sizeof(DATABASE_HEADER) == 135232);
+ assert(sizeof(DATABASE_CLIENT) == 32832);
+ assert(sizeof(DATABASE_HEADER) == 2101312);
assert(sizeof(EVENT_HEADER) == 16);
//assert(sizeof(EQUIPMENT_INFO) == 696); has been moved to dynamic checking inside mhttpd.c
assert(sizeof(EQUIPMENT_STATS) == 24);
--
2.47.3
|
| Attachment 2: 0002-Increase-MAX_CLIENTS-from-64-to-256.patch
|
From d0b0c5f316944a3133a26cc5340ec293f719b500 Mon Sep 17 00:00:00 2001
From: Nick Hastings <hastings@post.kek.jp>
Date: Tue, 19 Sep 2023 09:43:04 +0900
Subject: [PATCH 2/2] Increase MAX_CLIENTS from 64 to 256
In 2012 MAX_CLIENTS was increased from 64 to 128 for the t2kgsc. This
allowed double the number of frontends or clients. See elog entry at
https://elog.nd280.org/elog/GSC/808
For the new gsc this is further increased to 256. This necessitates
updating the size checks of the BUFFER_HEADER and DATABASE_HEADER structs.
BUFFER_HEADER = 32 + 7*4 + 256*MAX_CLIENTS
current: = 32 + 7*4 + 256*64
= 16444 -> Confirmed in odb.cxx
updated: = 32 + 7*4 + 256*256
= 65596
DATABASE_HEADER = 32 + 8*4 + 32832*MAX_CLIENTS
current: = 32 + 8*4 + 32832*64
= 2101312 -> Confirmed in odb.cxx
updated: = 32 + 8*4 + 32832*256
= 8405056
N.B. When the corresponding change was made in 2012 the value of
MAX_RPC_CONNECTION was increased from 64 to 96. No equivalent change
is made now since it was removed from midas in 2021 commit 9c93bc7f
"RPC_SERVER_ACCEPTION cleanup".
---
include/midas.h | 2 +-
src/odb.cxx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/midas.h b/include/midas.h
index 46d653f4..43ca476e 100644
--- a/include/midas.h
+++ b/include/midas.h
@@ -271,7 +271,7 @@ class MJsonNode; // forward declaration from mjson.h
#define NAME_LENGTH 32 /**< length of names, mult.of 8! */
#define HOST_NAME_LENGTH 256 /**< length of TCP/IP names */
-#define MAX_CLIENTS 64 /**< client processes per buf/db */
+#define MAX_CLIENTS 256 /**< client processes per buf/db */
#define MAX_EVENT_REQUESTS 10 /**< event requests per client */
#define MAX_OPEN_RECORDS 4096 /**< number of open DB records */
#define MAX_ODB_PATH 256 /**< length of path in ODB */
diff --git a/src/odb.cxx b/src/odb.cxx
index bc084612..b94cef29 100644
--- a/src/odb.cxx
+++ b/src/odb.cxx
@@ -1469,7 +1469,7 @@ static void db_validate_sizes()
#ifdef OS_LINUX
assert(sizeof(EVENT_REQUEST) == 16); // ODB v3
assert(sizeof(BUFFER_CLIENT) == 256);
- assert(sizeof(BUFFER_HEADER) == 16444);
+ assert(sizeof(BUFFER_HEADER) == 65596);
assert(sizeof(HIST_RECORD) == 20);
assert(sizeof(DEF_RECORD) == 40);
assert(sizeof(INDEX_RECORD) == 12);
@@ -1478,7 +1478,7 @@ static void db_validate_sizes()
assert(sizeof(KEYLIST) == 12);
assert(sizeof(OPEN_RECORD) == 8);
assert(sizeof(DATABASE_CLIENT) == 32832);
- assert(sizeof(DATABASE_HEADER) == 2101312);
+ assert(sizeof(DATABASE_HEADER) == 8405056);
assert(sizeof(EVENT_HEADER) == 16);
//assert(sizeof(EQUIPMENT_INFO) == 696); has been moved to dynamic checking inside mhttpd.c
assert(sizeof(EQUIPMENT_STATS) == 24);
--
2.47.3
|
|
3217
|
27 Apr 2026 |
Nick Hastings | Bug Report | increasing the max number of hot links in ODB | For the record, the ND280 (T2K near detector) MIDAS GSC was initially set up
with MAX_OPEN_RECORDS = 2560 and MAX_CLIENTS = 128.
In 2023 one fairly simple part of the detector was replaced with several
other more complex systems (many more midas frontends, equipments, and
variables being logged) so we updated MAX_OPEN_RECORDS = 4096 and
MAX_CLIENTS = 256.
Nick. |
|
1237
|
15 Feb 2017 |
NguyenMinhTruong | Bug Report | increase event buffer size | Dear all,
I have problem in event buffer size.
When run MIDAS, I got error "total event size (1307072) larger than buffer size
(1048576)", so I guess that the EVENT_BUFFER_SIZE is small.
I change EVENT_BUFFER_SIZE in midas.h from 0x100000 to 0x200000. After compiling
and run MIDAS, I got other error "Shared memory segment with key 0x4d040761
already exists, please remove it manually: ipcrm -M 0x4d040761 size0x204a3c" in
system.C
I check the shmget() function in system.C and it is said that error come from
Shared memory segments larger than 16,773,120 bytes and create teraspace shared
memory segments
Anyone has this problem before?
Thanks for your help
M.T |
|
1238
|
15 Feb 2017 |
NguyenMinhTruong | Bug Report | increase event buffer size | Dear all,
I have problem in event buffer size.
When run MIDAS, I got error "total event size (1307072) larger than buffer size
(1048576)", so I guess that the EVENT_BUFFER_SIZE is small.
I change EVENT_BUFFER_SIZE in midas.h from 0x100000 to 0x200000. After compiling
and run MIDAS, I got other error "Shared memory segment with key 0x4d040761
already exists, please remove it manually: ipcrm -M 0x4d040761 size0x204a3c" in
system.C
I check the shmget() function in system.C and it is said that error come from
Shared memory segments larger than 16,773,120 bytes and create teraspace shared
memory segments
Anyone has this problem before?
Thanks for your help
M.T |
|
Draft
|
19 Feb 2017 |
NguyenMinhTruong | Bug Report | increase event buffer size | I am sorry for my late reply memory in my PC is 16 GB I check the contents of .SHM_TYPE.TXT and it is "POSIXv2_SHM". But there is no buffer sizes in "/Experiment" After run "ipcrm -M 0x4d040761 size0x204a3c", remove .SYSTEM.SHM and run MIDAS again, I still get error "Shared memory segment with key 0x4d040761 already exists, please remove it manually: ipcrm -M 0x4d040761 size0x204a3c" M.T |
|
1241
|
20 Feb 2017 |
NguyenMinhTruong | Bug Report | increase event buffer size | I am sorry for my late reply
memory in my PC is 16 GB
I check the contents of .SHM_TYPE.TXT and it is "POSIXv2_SHM".
But there is no buffer sizes in "/Experiment"
After run "ipcrm -M 0x4d040761 size0x204a3c", remove .SYSTEM.SHM and run MIDAS again, I still get error "Shared memory segment
with key 0x4d040761 already exists, please remove it manually: ipcrm -M 0x4d040761 size0x204a3c" M.T |
|
851
|
04 Jan 2013 |
Nabin Poudyal | Suggestion | how to start using midas | Please, tell me how to choose a value of a "key" like DCM, pulser period,
presamples, upper thresholds to run a experiment? where can I find the related
informations? |
|
2740
|
29 Apr 2024 |
Musaab Al-Bakry | Forum | Midas Sequencer with less than 1 second wait | Hello there,
I am working on a task that involves some ODB changes that happen within 20-500
ms. The wait command for Midas Sequencer only works for > 1 second. As a
workaround, I tried calling a python script that has a time.sleep() command, but
the sequencer doesn't wait for the python script to terminate before moving to the
next command. Obviously, I could just move the entire script to python, but that
would cause further issues to us. Is there a way to have a wait that has precision
in order of milliseconds from within the Midas Sequencer? If there is no Midas-
native methods for doing this, what workaround will you suggest to get this to
work? |
|
2759
|
05 May 2024 |
Musaab Al-Bakry | Forum | Midas Sequencer with less than 1 second wait | > > Ok, I implemented the float second wait function. Internally it works in ms, so the maximum resolution is 0.001 s.
> >
> > Best,
> > Stefan
>
> Thank you, we will test this soon and let you know if we see any issues (but we're not expecting any).
Hello Stefan,
Thank you for the help you provided for us so far. I tried your code changes on our midas fork. Now, I notice that any
wait command takes at least 0.2 seconds to run.
For example, when I use the following script:
SCRIPT source scripts/time_print.sh
WAIT Seconds, 0.1
SCRIPT source scripts/time_print.sh
WAIT Seconds, 0.1
SCRIPT source scripts/time_print.sh
The time_print.sh script prints time segments separated by almost exactly 0.2 seconds. Same goes for when I use 0.01
second waits.
However, when I use 0.2 seconds wait, then I get time segments separated by 0.3 seconds. I also tried something like
this:
SCRIPT source scripts/time_print.sh
WAIT Seconds, 0.2
WAIT Seconds, 0.2
SCRIPT source scripts/time_print.sh
WAIT Seconds, 0.2
WAIT Seconds, 0.2
SCRIPT source scripts/time_print.sh
This script results in time segements of 0.6 seconds difference. It is not immidiately clear to me from the sequencer
code what causes this effect. The code as it stands is a lot better than what we had before the changes, but I am
wondering if this can be reduced to the order of 1ms or 10ms.
Best regards,
Musaab Faozi |
|
2762
|
07 May 2024 |
Musaab Al-Bakry | Forum | Midas Sequencer with less than 1 second wait | > Actually I realized that a 1ms wait still works, so I reduced it to that.
>
> Stefan
Thank you so much, Stefan. I have tested your changes, and it seems like this does
the job for our purposes. Very appreciated!
Best regards,
Musaab Faozi |
|
780
|
12 Dec 2011 |
Michael Murray | Bug Report | bk_delete uses memcpy instead of memmove | In midas.c, the bk_delete function removes a bank by decrementing the total
event size and then copying the remaining banks into the location of the first
using memcpy from string.h.
memcpy is not specified to handle overlapping memory regions (such as MIDAS
banks), though it seems most common implementations do.
memmove should be used instead, which is specified to behave as if copying
through an intermediate buffer.
I noticed the misbehavior using glibc with gcc version 4.4.4 and scientific
linux 6.0. Other gcc versions changed nothing, as this originates from the
implementation of memcpy in libc.
libc version:
GNU C Library stable release version 2.12, by Roland McGrath et al.
Compiled by GNU CC version 4.4.5 20110214 (Red Hat 4.4.5-6).
Compiled on a Linux 2.6.32 system on 2011-12-06. |
|
1064
|
09 Jun 2015 |
Michael McEvoy | Forum | Midas-MSCB SCS2000 integration | I am using the MSCB SCS2000 to monitor slow control variables (temperatures, voltages, etc). I am trying to
get it set up at fermilab as a test stand in the MC1 building and was wondering if anyone has integrated
Midas with a MSCB SCS2000 before. We have two systems at fermilab, one system that is currently running
in the g-2 experimental hall, but running an out of date version of midas. The second test stand I am
setting up is working with the current version of midas. I believe we will easily be able to figure out the
external probes for temperatures and voltages just fine. But the MSCB SCS2000 box itself has 1
temperature value, 1 current value, and 5 voltages internally that we also need to monitor. If I use the msc
command I can read back the external values through the daughter cards I have installed on the SCS2000
box but has no way of reading back the internal values that I need. I also have been looking through the
MIDAS files trying to find a possible way to read these out to no avail.
If anyone has any ideas or has had previous work with the SCS2000 and knows how to read back the
internal values please let me know.
Thanks,
Michael McEvoy
NIU Graduate Student |
|
1974
|
10 Aug 2020 |
Mathieu Guigue | Info | MidasConfig.cmake usage | As the Midas software is installed using CMake, it can be easily integrated into
other CMake projects using the MidasConfig.cmake file produced during the Midas
installation.
This file points to the location of the include and libraries of Midas using three
variables:
- MIDAS_INCLUDE_DIRS
- MIDAS_LIBRARY_DIRS
- MIDAS_LIBRARIES
Then the CMakeLists file of the new project can use the CMake find_package
functionalities like:
```
find_package (Midas REQUIRED)
if (MIDAS_FOUND)
MESSAGE(STATUS "Found midas: libraries ${MIDAS_LIBRARIES}")
pbuilder_add_ext_libraries (${MIDAS_LIBRARIES})
else (MIDAS_FOUND)
message(FATAL "Unable to find midas")
endif (MIDAS_FOUND)
include_directories (${MIDAS_INCLUDE_DIR})
```
pbuilder_add_ext_libraries is a CMake macro allowing to automatically add the
libraries into the project: this macro can be found here:
https://github.com/project8/scarab/blob/master/cmake/PackageBuilder.cmake
If such macro doesn't exist, the linkage to each executable/library can be done
similarly to https://midas.triumf.ca/elog/Midas/1964 using:
```
target_link_libraries(crfe ${MIDAS_LIBARIES} ${LIBS})
```
The current version of the MidasConfig.cmake is minimal and could for example
include a version number: this would allow to define a e.g. minimal version of
Midas needed by the new project. |
|
2163
|
12 May 2021 |
Mathieu Guigue | Bug Report | mhttpd WebServer ODBTree initialization | Hi,
Using midas version 12-2020, I am trying to run mhttpd from within a docker container using docker-compose.
Starting from an empty ODB, I simply run `mhttpd` and this is the output I have:
midas_hatfe_1 | <Warning> Starting mhttpd...
midas_hatfe_1 | [mhttpd,INFO] ODB subtree /Runinfo corrected successfully
midas_hatfe_1 | MVOdb::SetMidasStatus: Error: MIDAS db_find_key() at ODB path "/WebServer/Host list" returned status 312
midas_hatfe_1 | Mongoose web server will not use password protection
midas_hatfe_1 | Mongoose web server will not use the hostlist, connections from anywhere will be accepted
midas_hatfe_1 | Mongoose web server listening on http address "localhost:8080", passwords OFF, hostlist OFF
midas_hatfe_1 | [mhttpd,ERROR] [mhttpd.cxx:19160:mongoose_listen,ERROR] Cannot mg_bind address "[::1]:8080"
According to the documentation, the WebServer tree should be created automatically when starting the mhttpd; but it seems not as it doesn't find the entry "/WebServer/Host list".
If I create it by end (using "create STRING /WebServer/Host list"), I still get the error message that mhttpd didn't bind properly to the local port 8080.
I am not sure what it wrong, as mhttpd is working perfectly well in this exact container for midas 03-2020.
Any idea what difference makes it not possible anymore to run into these container?
Thanks very much for your help.
Cheers
Mathieu |
|
2167
|
13 May 2021 |
Mathieu Guigue | Bug Report | mhttpd WebServer ODBTree initialization | > > It looks like mhttpd managed to bind to the IPv4 address (localhost), but not the IPv6 address (::1). If you don't need it, try setting "/Webserver/Enable IPv6" to false.
>
> We had this issue already several times. This info should be put into the documentation at a prominent location.
>
> Stefan
Thanks a lot, this solved my issue! |
|
2172
|
24 May 2021 |
Mathieu Guigue | Bug Report | Bug "is of type" | Hi,
I am running a simple FE executable that is supposed to define a PRAW DWORD bank.
The issue is that, right after the start of the run, the logger crashes without messages.
Then the FE reports this error, which is rather confusing.
```
12:59:29.140 2021/05/24 [feTestDatastruct,ERROR] [odb.cxx:6986:db_set_data1,ERROR] "/Equipment/Trigger/Variables/PRAW" is of type UINT32, not UINT32
``` |
|
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 ? |
|
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 |
|
1948
|
15 Jun 2020 |
Martin Mueller | Bug Report | deprecated function stime() | Hi
I had a problem with the compilation of midas after an OS update to the recent version of OpenSuse tumbleweed. The function stime() in system.cxx:3196 is no longer available.
In the documentation it is also marked as deprecated with the suggestion to use clock_settime instead:
https://man7.org/linux/man-pages/man2/stime.2.html
replacing system.cxx:3196 with the clock_settime - method in system.cxx:3200 - 3204 also for OS_UNIX seems to solve the problem, but i'm not sure if this will cause problems on older OS's.
Martin |
|