-
Notifications
You must be signed in to change notification settings - Fork 2
Requirements
These requirements have been harvested from a number of places. Obviously much is informed by our current build system: FCM.
The bulk come from a previous project to evaluate the existing build systems as potential replacements to FCM. These have been extended and clarified for this document. Furthermore they have been separated into functional and technical requirements, then ranked by priority.
One structural change this project intends to make is to separate out extraction and build into separate tools. Thus separate sets of requirements are presented here.
This is a living document and will be updated periodically by the project team & board to account for emerging or obsolete requirements.
The extraction system has the job of preparing a source tree to build. It does this by collating source from a number of locations.
Items at the same level are ordered by priority. It may be desirable to implement an item at one level before all items below the previous item are complete.
- User interface shall be
- Programmable API - most suitable for complex situations
- Configuration file - most suitable for simple situations
- Zero configuration - for very simple situations
- If the project is presented in a certain form and does not require complex rules the tool shall infer what to do.
- A single source tree shall be synthesised from multiple trees
- The resulting source tree must be suitable for the build system to operate on.
- Filename uniqueness must be preserved using a namespace scheme.
- It shall be possible to install the resulting tree to a remote file system.
- Extracted source may contain further configuration for the extract system.
- Extract and merge source from a variety of locations:
- Local file system
- Subversion VCS
- Repository
- Working copy
- Remote file system
- Git VCS
- Remote clone
- Local clone
- Archive files
- tarballs
- zip files
- Nested repositories, e.g. a tarball held by a VCS
- Extraction should be possible from a sub-tree within a repository.
- Merge several versions of the same source tree (e.g. branches held in VCS)
- Failure to merge automatically is an error condition.
- Make use of temporary storage (e.g. RAM disk) for temporary files.
- It should be possible to filter the incoming files based on name.
- Both include and exclude filters should be supported.
- Parallelise activity where possible. e.g. extracts from different locations.
- Operate incrementally where possible.
- Extract only those files which have changed since the last extract.
- This may be disabled for a full extract.
- Schedule parallel tasks such that the longest to complete on the last
run go first.
- Use arbitrary order for the first run.
Items are unordered, they tend to describe things which are always true.
- Documentation required
- API
- User interface
- User guide
- Tutorial
- Good test coverage
- Unit tests
- Integration tests (may not be necessary)
- System tests
- Easy to deploy using recognised standard methods: PIP/PyPi
- Moderate use of 3rd party libraries.
- Shall be implemented using Python3.
- The same configuration should always lead to the same source tree, given the same repositories.
- Sub-systems shall be modular such that they may be used in isolation by
other tools.
- Shall be easy to re-use components.
- Support for source repositories should be modular allowing easy extension to support additional options.
- Local file systems shall include NFS mounts
- Remote file systems are those accessible explicitly over a network. e.g. SCP/rsync
- Network communication shall always flow to the compiling system, never from it. e.g. Desktop to HPC, never the other way round.
- Persistent data shall be compressed to reduce disc usage where it makes sense to do so.
Sorted into priority order.
- Extract from FTP server.
- Extract from HTTP server.
The buid system's job is to take the provided source tree and produce a number of artifacts from it, be they executable applications, libraries, documentation or other product.
Items at the same level are ordered by priority. It may be desirable to implement an item at one level before all items below the previous item are complete.
- User interface shall be:
- Programmable API - most suitable for complex situations
- Configuration file - most suitable for simple situations
- Zero configuration - for very simple situations
- If the project is presented in a certain form and does not require complex rules the tool shall infer what to do.
- Interpret source trees prior to build
- Automatic discovery of source files.
- Ability to ignore (filter out) source files based on patterns.
- Per tree
- Per product?
- Use dependency analysis in order to determine the directed acyclic graph
(DAG) of tasks needed to perform the build.
- Reject circular dependencies.
- Reject missing dependencies.
- Reject duplicate implementations, i.e. same program symbol with multiple implementations.
- Visualise the graph for debugging and development
- Exclude external dependencies.
- Preprocessing which could generate new dependencies (e.g. #include) will need to be done prior to analysis.
- Recognise that bind(c) in Fortran creates a dependency on an a symbol in an object or library file. These files may be created by a wide variety of compilers including C/C++.
- Support the building of all or a subset of end products:
- Anything which is the product of a transformation may be an end product.
- May be specified individually or as "everything in this directory."
- Only source required to build the end products shall be compiled.
- Executables
- These may be automatically discovered from the source.
- Libraries
- Static or dynamic (or both!)
- Collate additional files needed when compiling against the library.
Note that only those relating to the intended API should be exposed.
- C header files
- Fortran module files
- Anything which is the product of a transformation may be an end product.
- Allow intermediate artefacts to be replaced with hand written versions.
- This implies that the task which would normally create them is not run.
- The user should be aware that this mechanism is not for permanent use. Rather it should be an interim solution to overcome an immediate problem.
- Support performing additional actions upon completion of the build and/or
other intermediate stages of the build.
- Installation of final product/s
- Preserving intermediates from temporary build locations
- This may include files produced by a profiling tool or other debugging/diagnostic features of (e.g.) the compiler
- Execute compiled products as part of the build, e.g. unit tests, source generators.
- Support the ability for tasks to output multiple versions. e.g. MPI vs. serial, Static vs dynamic libraries or different build options.
- Make use of temporary storage (e.g. RAM disc) for intermediate files.
- Intermediate products shall be retained to speed compilation.
- Object files
- (Fortran) Module files
- Intermediate libraries
- Generated source
- Only sources which have changed or things which depend on rebuilt
intermediates (including configuration) should be rebuilt.
- This may be disabled for a full rebuild.
- Support task options
- Hierarchy of scope
- Global, installation wide
- Per Project (single build instance)
- Per product (executable, library, etc)
- Per directory
- Per source file
- Options for tasks include
- Preprocessor
- Include directory for C header files
- Compiler
- Per compiler version
- Directory for Fortran module files
- Debug
- Optimisation
- Features
- OpenMP
- OpenAcc
- Linker
- Per linker version
- Directories containing external library files
- Debug
- Optimisation
- Features
- OpenMP
- OpenAcc
- Preprocessor
- Hierarchy of scope
- Parallelise for performance
- Preprocessing
- Dependency analysis
- Compile
- Support tools (e.g. profiling) which "wrap" the compiler. (e.g. proftool -profargs ifort -compargs)
- Build Fortran module files only in the first phase obeying dependency information. In the second phase object files are built in parallel in any order.
- Store intermediate files in a compressed archive.
- Support cache of intermediate files to speed building.
- Only use cached intermediate if its prerequisites have not changed. i.e. source file, module file and configuration
- Multiple caches may be available.
- When dispatching tasks prefer those which took a long time in the previous
run.
- Only works for parallel tasks
- Dependency analysis
- Building object files (not module files)
- Use arbitrary order for the first run where there is no duration data.
- Only works for parallel tasks
Items are unordered, they tend to describe things which are always true.
- Documentation required
- API
- User interface
- User guide
- Tutorial
- Good test coverage
- Unit tests
- Integration tests (may not be necessary)
- System tests
- Easy to deploy using recognised standard methods
- PIP
- PyPi
- Moderate use of 3rd party libraries.
- Shall be implemented using Python3.
- Repeatable behaviour given identical inputs.
- Source files shall be uniquely identifiable.
- Support use against a large number of sites
- Each site may have many platforms
- Each platform may have multiple compilers
- Each site may have many platforms
- Support language standards at least as recent as:
- Fortran 2008
- Support all program units: Program, Subroutine, Function, Module and Submodule.
- C 2018
- C++ 2017
- Fortran 2008
- Sub-systems shall be modular such that they may be used in isolation by other tools. e.g. Dependency analyser.
- Shall be easy to re-use components.
- It shall be easy to add support for new language source code for both build system developers and users.
- Different dependency trees may pertain for compilation and linking.
- A task shall be any transformation which:
- Takes zero or more inputs and produces zero or more outputs.
- Shall include compilation, linking and various source generators
- PSyclone
- pFUnit
- User defined
- Libraries may be intermediate as well as end-product.
- More than one Fortran module may appear in a single source file.
- When handling inclusions such as C header files or Fortran include, support must be provided for cascading inclusions.
- Detecting changes to source files should utilise a hash rather than "last write" timestamp.
- Products should depend on their configuration as well as their source and prerequisites.
- Dependency analysis must be extendable with new dependency relationships by both build system developers and users.
- Compile and link have different dependencies. e.g. Fortran source depends on module files while link requires object and library files.
- Tasks shall be implemented such that it is easy to add additional ones either by build system developers or users.
- Recently a module system similar to Fortran's was accepted into the next version of the C++ standard. This can not be supported immediately but the implementation must not prevent it in the future.
- Persistent data shall be stored in a compressed archive where it makes sense to do so.
Sorted into priority order.
- Generate code browser during build.
- For Fortran, only dependency module files should be considered when determining rebuild. A change to the object file does not affect the ABI.
- Support the use of different compilers for different source trees. How this interacts with incompatible modules needs thought. Requirement from ABOM, consult with them.
- Trigger incremental rebuild from external dependencies.
- Integrate with IDEs.
- Source generation of Fortran interfaces for extern "C" functions and C header files for bind(c) procedures.
- Support use through GUIs such as Jupyter notebooks.
- Support for C++20 modules.
- Support for legacy FCM features
- Interface files
- "Depends on" comments
- Future Release
- vn1.0 Release, March 2023
- 0.11 Beta Release, Jan 2023
- 0.10 Beta Release, Oct 2022
- 0.9 Alpha Release, June 2022
- Phase 2
- Phase 3
- Phase 4
- Repository Management
- Development Process
- Development Environment
- Releasing Fab
- Coding Conventions
- Glossary
- Concerning the Database
- Unit Test Coverage
- Issues With the System Testing Framework