[home]

Development


MAD-X is improved continuously by the MAD team as well as other collaborators. This webpage is dedicated to developers who want to participate to the improvement of the application.

The source code is avalaible on the GitHub repository, which includes a Wiki on Git.

Note: every development must be done on a separate branch from the master and pass all the tests before being merged through a Pull Request (mandatory). All developpers should subscribe to notifications and mad-dev e-group (see support) to be informed about what is ongoing on in the repository.


MAD-X nightly builds and tests

MAD-X is built and tested each night to ensure that new developments do not break the proper functioning of the application on all supported platforms. If some tests appear to be failing, a report summary containing the list of failing tests and the corresponding architectures is sent to the e-group mad-src (see support). The complete reports of the builts and the tests for each supported architecture can be browsed from the reports repository, where the history is kept for one year.

The scripts used to make the nightly reports can be found in the directory scripts and seen as examples of proper usage of the builds and tests system.


MAD-X builds

To build MAD-X, you will need a set of tools usually available on Unixes by default (but not on Windows): GNU make (>=3.81), GNU gcc, g++, gfortran compilers (>=4.4, 32/64 bit on Darwin) and Intel icc, icl, ifort compilers (>=14, optional), as well as Xorg X11 (32/64 bit on Darwin). Lahey, Nagfor and g95 are also used from time to time but not actively supported.

The build system supports tens of targets to clean, report, debug and trace what it's going on. For example, to clean everything and restart from scratch, you can run make cleanall. The system is also highly configurable through tens of variables (like options above). For more details, look at the project Makefile[_xxx] or at the build system makefiles in the directory make.

Notes: the option ONLINE=yes works only on linux platforms (e.g. lxplus) and the default for DESTDIR is ./build.


MAD-X test suites

The following instructions assume that you downloaded the source release from the GitHub repository or the releases repository, and that madx and numdiff are in your PATH or in the madX directory.

The ARCH option forces to run the tests for a specific architecture (e.g. 32 bit or 64 bit) instead of the detected one. The commands based on test-name-list are useful to run only few tests, or to run tests that are not yet registered in the file Makefile_test. A test-name is the name of the test directory in madX/tests (e.g. test-twiss). If TESTS is set to detect, it will run all the tests in madX/tests/test-*. The last command is equivalent to the third one, but it will report an obscur error if the tests does not exists, and it will not display the trailing summary. To trace what is going on during the tests, you can add the option SHOW=yes to any of the commands above. To see the available test name, look at the file Makefile_test.

To speed-up the tests setup for numdiff constraints (i.e. .cfg files), you can run the above make commands with the option TESTCMD= (i.e. force empty option) that will run only numdiff (very fast) and not madx (may be slow).

Note that on Windows platforms, you will need to download and install GNU make to run the tests.