Changelog: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The midas git repository uses tags to denote specific releases. Tags are of the format <code>midas-YEAR-MONTH-SUFFIX</code>, e.g. <code>midas-2019-06-b</code>. This page details the major changes in each release, and highlights how to update client code to adapt to any changes that are not backwards-compatible. | The midas git repository uses tags to denote specific releases. Tags are of the format <code>midas-YEAR-MONTH-SUFFIX</code>, e.g. <code>midas-2019-06-b</code>. This page details the major changes in each release, and highlights how to update client code to adapt to any changes that are not backwards-compatible. | ||
== 2019-06 == | |||
Releases <code>midas-2019-06-a</code>, <code>midas-2019-06-b</code>. | Releases <code>midas-2019-06-a</code>, <code>midas-2019-06-b</code>. | ||
Line 7: | Line 7: | ||
Relevant elog entries - [https://midas.triumf.ca/elog/Midas/1564 1564 (midas-2019-06 with cmake and c++)] and [https://midas.triumf.ca/elog/Midas/1526 1526 (How to convert C midas frontends to C++)]. | Relevant elog entries - [https://midas.triumf.ca/elog/Midas/1564 1564 (midas-2019-06 with cmake and c++)] and [https://midas.triumf.ca/elog/Midas/1526 1526 (How to convert C midas frontends to C++)]. | ||
=== Improvements === | |||
* Migration from C to C++. '''You will have to make changes to your clients''' (see upgrade guide below). | * Migration from C to C++. '''You will have to make changes to your clients''' (see upgrade guide below). | ||
Line 13: | Line 13: | ||
* mxml and mscb are now included as git submodules. See the "upgrade guide" instructions for how to checkout the latest version of these modules. | * mxml and mscb are now included as git submodules. See the "upgrade guide" instructions for how to checkout the latest version of these modules. | ||
=== Bug fixes === | |||
=== Known issues === | |||
* cmake/cmake3 - ZLIB support is not detected, so gzipped files cannot be written by the logger. Will be fixed in the next release, or you can update midas to a commit after August 2. | * cmake/cmake3 - ZLIB support is not detected, so gzipped files cannot be written by the logger. Will be fixed in the next release, or you can update midas to a commit after August 2. | ||
* mxml can segfault due to a double free. Will be fixed in the next release, or you can update mxml to commit f6fc49d: <code>cd mxml; git checkout f6fc49d; cd ..</code> and re-compile midas. | * mxml can segfault due to a double free. Will be fixed in the next release, or you can update mxml to commit f6fc49d: <code>cd mxml; git checkout f6fc49d; cd ..</code> and re-compile midas. | ||
=== Upgrade guide === | |||
==== Updating midas ==== | |||
<nowiki> | <nowiki> | ||
Line 46: | Line 46: | ||
You should then restart <code>mserver</code>, <code>mlogger</code>, <code>mhttpd</code>, and any other midas programs that you run. | You should then restart <code>mserver</code>, <code>mlogger</code>, <code>mhttpd</code>, and any other midas programs that you run. | ||
==== Cleanup unneeded stuff ==== | |||
As mxml and mscb are included as submodules now, you can remove the external packages that were downloaded previously (assuming they aren't used by other experiments on the same machine). E.g. | As mxml and mscb are included as submodules now, you can remove the external packages that were downloaded previously (assuming they aren't used by other experiments on the same machine). E.g. | ||
Line 53: | Line 53: | ||
rm -r $HOME/packages/mscb # new location $MIDASSYS/mscb</nowiki> | rm -r $HOME/packages/mscb # new location $MIDASSYS/mscb</nowiki> | ||
==== Update experiment frontends ==== | |||
The migration from C to C++ is one of the biggest user-facing changes in midas for a long time. Unfortunately it requires manual work from experimenters to update their client code: | |||
# Update your Makefile | |||
## Update library search path for code that links against libmidas or mfe.o (<code>$MIDASSYS/linux/lib</code> becomes <code>$MIDASSYS/lib</code>) | |||
## If you reference mxml in your Makefile, change the include path to <code>$MIDASSYS/mxml</code> | |||
## If you explicitly have the compiler as <code>gcc</code>, change it to <code>g++</code> | |||
# Update frontend code to use mfe.h and build as C++ | |||
## Add <code>#include "mfe.h"</code> after including <code>midas.h</code> | |||
## Remove <code>extern C</code> brackets around mfe-related code. Ideally there should be no <code>extern C</code> brackets anywhere. | |||
## Ensure that <code>frontend_name</code> and <code>frontend_file_name</code> are <code>const char*</code> rather than <code>char*</code>. | |||
## If you define your own global <code>HNDLE hDB</code>, change it to <code>extern HNDLE hDB</code> to pick up the one provided by mfe. | |||
## Ensure that <code>poll_event</code> and <code>interrupt_configure()</code> use <code>INT</code> rather than <code>INT[]</code> for the <code>source</code> argument. | |||
## If you use <code>extern int frontend_index</code>, change it to use the <code>get_frontend_index()</code> function from mfe.h instead. | |||
## Ensure that the last argument to <code>bk_create</code> is cast to <code>(void**)</code> | |||
# Try to compile, and fix any more compilation errors. Examples may include: | |||
## Duplicate or mismatched declarations of functions defined in mfe.h (fix the mismatched declarations in your code) | |||
## <code>bool debug</code> colliding with declaration in mfe.h (suggest to rename the variable in the client) | |||
## Return value of <code>malloc()</code> etc needs to be cast to the correct data type (e.g. <code>char* s = (char*)malloc(...)</code>) | |||
An example diff of a frontend is: | |||
<nowiki> | |||
#include "midas.h" | |||
+ #include "mfe.h" | |||
#include "msystem.h" | |||
#include "utils1.h" | |||
- #ifdef __cplusplus | |||
- extern "C" { | |||
- #endif | |||
- char *frontend_name = FE_NAME; | |||
+ const char *frontend_name = FE_NAME; | |||
- HNDLE hDB; | |||
+ extern HNDLE hDB; | |||
- #ifdef __cplusplus | |||
- } | |||
- #endif | |||
- extern "C" int frontend_index; | |||
INT frontend_init() { | |||
- printf("We are running as frontend index %d", frontend_index); | |||
+ printf("We are running as frontend index %d", get_frontend_index()); | |||
return SUCCESS; | |||
} | |||
- extern "C" INT interrupt_configure(INT cmd, INT[] source, PTYPE adr) { | |||
+ INT interrupt_configure(INT cmd, INT source, PTYPE adr) { | |||
return 0; | |||
}</nowiki> |
Revision as of 10:02, 7 August 2019
The midas git repository uses tags to denote specific releases. Tags are of the format midas-YEAR-MONTH-SUFFIX
, e.g. midas-2019-06-b
. This page details the major changes in each release, and highlights how to update client code to adapt to any changes that are not backwards-compatible.
2019-06
Releases midas-2019-06-a
, midas-2019-06-b
.
Relevant elog entries - 1564 (midas-2019-06 with cmake and c++) and 1526 (How to convert C midas frontends to C++).
Improvements
- Migration from C to C++. You will have to make changes to your clients (see upgrade guide below).
- Ability to compile using cmake/cmake3 as well as make. To use cmake, you can either build manually with
mkdir build; cd build; cmake ..; make; make install
, or use the handy shortcutmake cmake3
. Note that the location where libraries and executables are built has changed - the OS-specific subdirectories (e.g./linux/lib
) has been replaced by a common/lib
and/bin
. - mxml and mscb are now included as git submodules. See the "upgrade guide" instructions for how to checkout the latest version of these modules.
Bug fixes
Known issues
- cmake/cmake3 - ZLIB support is not detected, so gzipped files cannot be written by the logger. Will be fixed in the next release, or you can update midas to a commit after August 2.
- mxml can segfault due to a double free. Will be fixed in the next release, or you can update mxml to commit f6fc49d:
cd mxml; git checkout f6fc49d; cd ..
and re-compile midas.
Upgrade guide
Updating midas
# Grab the new code git checkout develop git pull git checkout midas-2019-06-b git pull git submodule update --init # this will checkout correct versions of mxml and mscb # Tidy up the old build - be sure to delete the deprecated linux directory! make clean make cclean rm -rf linux/bin rm -rf linux/lib rmdir linux # Build the new midas make cmake3 # or "make cmake" on ubuntu and macos
If you have a script that sets up environment variables, you should change PATH
from $MIDASSYS/linux/bin
to $MIDASSYS/bin
.
You should then restart mserver
, mlogger
, mhttpd
, and any other midas programs that you run.
Cleanup unneeded stuff
As mxml and mscb are included as submodules now, you can remove the external packages that were downloaded previously (assuming they aren't used by other experiments on the same machine). E.g.
rm -r $HOME/packages/mxml # new location $MIDASSYS/mxml rm -r $HOME/packages/mscb # new location $MIDASSYS/mscb
Update experiment frontends
The migration from C to C++ is one of the biggest user-facing changes in midas for a long time. Unfortunately it requires manual work from experimenters to update their client code:
- Update your Makefile
- Update library search path for code that links against libmidas or mfe.o (
$MIDASSYS/linux/lib
becomes$MIDASSYS/lib
) - If you reference mxml in your Makefile, change the include path to
$MIDASSYS/mxml
- If you explicitly have the compiler as
gcc
, change it tog++
- Update library search path for code that links against libmidas or mfe.o (
- Update frontend code to use mfe.h and build as C++
- Add
#include "mfe.h"
after includingmidas.h
- Remove
extern C
brackets around mfe-related code. Ideally there should be noextern C
brackets anywhere. - Ensure that
frontend_name
andfrontend_file_name
areconst char*
rather thanchar*
. - If you define your own global
HNDLE hDB
, change it toextern HNDLE hDB
to pick up the one provided by mfe. - Ensure that
poll_event
andinterrupt_configure()
useINT
rather thanINT[]
for thesource
argument. - If you use
extern int frontend_index
, change it to use theget_frontend_index()
function from mfe.h instead. - Ensure that the last argument to
bk_create
is cast to(void**)
- Add
- Try to compile, and fix any more compilation errors. Examples may include:
- Duplicate or mismatched declarations of functions defined in mfe.h (fix the mismatched declarations in your code)
bool debug
colliding with declaration in mfe.h (suggest to rename the variable in the client)- Return value of
malloc()
etc needs to be cast to the correct data type (e.g.char* s = (char*)malloc(...)
)
An example diff of a frontend is:
#include "midas.h" + #include "mfe.h" #include "msystem.h" #include "utils1.h" - #ifdef __cplusplus - extern "C" { - #endif - char *frontend_name = FE_NAME; + const char *frontend_name = FE_NAME; - HNDLE hDB; + extern HNDLE hDB; - #ifdef __cplusplus - } - #endif - extern "C" int frontend_index; INT frontend_init() { - printf("We are running as frontend index %d", frontend_index); + printf("We are running as frontend index %d", get_frontend_index()); return SUCCESS; } - extern "C" INT interrupt_configure(INT cmd, INT[] source, PTYPE adr) { + INT interrupt_configure(INT cmd, INT source, PTYPE adr) { return 0; }