Presentation is loading. Please wait.

Presentation is loading. Please wait.

Build system And Software Implementation Standard by Andreas Schuh and Andrew Hundt Copyright © 2011 University of Pennsylvania. Copyright © 2013 Carnegie.

Similar presentations


Presentation on theme: "Build system And Software Implementation Standard by Andreas Schuh and Andrew Hundt Copyright © 2011 University of Pennsylvania. Copyright © 2013 Carnegie."— Presentation transcript:

1 Build system And Software Implementation Standard by Andreas Schuh and Andrew Hundt Copyright © 2011 University of Pennsylvania. Copyright © 2013 Carnegie Mellon University.

2  Introduction  Project Template  CMake Modules  Utilities  Milestones  Tutorials 11/22/20132

3 Why BASIS? What is it? 11/22/20133

4  The lifetime of your software should be longer than the time you or your team spends on it. Therefore BASIS aims to:  establish a unified software structure.  ease package integration.  streamline maintenance.  Make software more robust and reliable.  Increase the impact of your work! 11/22/20134

5  Specify standards/conventions for the software development process.  Standardize project organization and software build including testing and packaging.  Provide basic utility functions in order to promote compliance with lab conventions and to reduce common development burden. 11/22/20135

6 6 BASIS …ToolkitODVBACOMPAREPREDICTGLISTRMICO Integrated Distribution Package Projects COMPARE PREDICT … ToolkitBASIS

7  BASIS is not simply a toolkit. It consists of:  Standardized project specifications on the website  A preset project template  Utility functions for integration between multiple supported programming languages.  However, the distinction may be fuzzy at times… 11/22/20137

8 8 Standard Specifications Template Filesystem Hierarchy Template Files CMake Modules BasisProject.cmake (CMake) BasisTest.cmake (CTest) BasisPack.cmake (CPack) Tools Project Creation Automated Testing Documentation Utilities Command Execution Command-line Parsing Testing Frameworks

9 Mad-libs style project creation 11/22/2013BASIS IntroductionCopyright (c) 2011 University of Pennsylvania. All rights reserved.9

10  basisproject is a command line program that:  Automatically generates a package source directory  Populates it with starter files using mad-lib style substitution to customize it for you in seconds. 11/22/201310

11  A directory with all mad-libs style template files, i.e., the project files before substitution  Used by basisproject  Follows the BASIS project layout standard  For an example, see the data/templates subdirectory of the BASIS source package. 11/22/201311

12  is the root directory of the source tree.  is the project name in lowercase only. / config/ data/ doc/ example/ include/ / src/ test/ 11/22/2013BASIS IntroductionCopyright (c) 2011 University of Pennsylvania. All rights reserved.12

13 11/22/2013BASIS IntroductionCopyright (c) 2011 University of Pennsylvania. All rights reserved.13  is the installation directory, e.g., /usr/local/ on Unix.  is a project- and possibly version-specific string, e.g., / bin/ / include/sbia/ / lib/ cmake/ / perl5/5.x.x/ / pythonx.x/ site- packages/ / share/ / doc/ example/ …

14  Main executables go in  /bin/ /  Auxiliary executables go in  /lib/ /.  Symbolic links created upon installation by default  From ▪ /bin/  To (selected) executables in ▪ /bin/ /.  More details in the specification.specification 11/22/201314

15 11/22/201315 BASIS CMake Modules

16  BASIS extends and replaces most CMake commands.  add_executable()  basis_add_executable()  Supports multiple languages, not just C++:  Java (not yet), Python, Perl, BASH, and MATLAB.  Implements the BASIS standard, adhering guidelines  Filesystem hierarchy  Software documentation  Packaging  Testing 11/22/201316

17  The main modules are:  BasisProject.cmake ▪ Must be part of every project. Defines meta-data.  BasisTest.cmake – Extends CTest.cmake. ▪ Used for software tests. ▪ Included by basis_project_initialize().  BasisPack.cmake – Extends CPack.cmake. ▪ Used for packaging. ▪ Included by basis_project_finalize(). 11/22/201317

18  The most important functions to know are:  basis_find_package()  basis_add_executable()  basis_add_library()  basis_add_test()  basis_add_doc()  basis_include_directories()  basis_target_link_libraries()  basis_set_target_properties()  basis_get_target_property()  basis_install() 11/22/201318

19  /config/Depends.cmake # find NIfTI-1 tools for MATLAB basis_find_package (MatlabNiftiTools REQUIRED) basis_add_include_directories (“${MatlabNiftiTools_INCLUDE_DIRS}”)  /src/CMakeLists.txt # MEX-file build from C++ basis_add_library (look_for_gold_instead MEX look_for_gold.cxx) # executable build from MATLAB scripts basis_add_executable (miner neurominer.m) basis_target_link_libraries (miner look_for_gold_instead) 11/22/201319

20  See the API documentation of BASIS for details on the CMake variables, functions, and macros.API documentation  Documentation can be automated so it is generated automatically every night (less frequently in later stages) from the in-source code comments using Doxygen. 11/22/201320

21 What tools do we get? 11/22/201321

22  Create a new BASIS project  Modify an existing project.  Upgrade a project to a newer version of BASIS.  3-way file merge combines your changes with the changes in the newer BASIS template.  Uses TEMPLATE argument of basis_project to determine currently used template version. 11/22/201322

23  Wrapper for command-line tools implemented for the automated execution of software tests:  The basistest_cron is executed, e.g., every 5 minutes.  It in turn just calls basistest_master with the arguments specific to the given system.  A configuration file tells the basistest_master what branches of which projects to test at which time interval,…  The actual tests are executed by instances of basistest_slave which are submitted to SGE in our case and am using CTest. 11/22/201323

24  basistest can create CDash dashboard of test results for two testing regimens:  Continuous ▪ Executed after a change was committed to the repository.  Nightly ▪ Run once every certain time interval, e.g., every night. 11/22/201324

25  BASIS automates the process of setting up documentation  Doxygen is used for general code documentation  Natively, Doxygen knows how to parse C/C++, Java, and Python (not satisfactory, though)  Filters can be used to translate other languages into something Doxygen understands best: C++. BASIS includes such filters for the missing languages, i.e.(, Python), Perl, BASH, and MATLAB.  This is transparent to the BASIS developer.  A simple basis_add_doc(api GENERATOR Doxygen) in the build CMakeLists.txt is sufficient. 11/22/201325

26  See the API documentation of the BASIS utilities for examples of documentation generated from in-source comments only.API documentation 11/22/201326

27 What implementations do they provide? 11/22/201327

28  Standardizes application startup and conventions for programs to interact.  Main commands commonly execute several utility commands in *nix and research environments.  Also need to ensure the right commands are executed and the correct libraries are loaded. 11/22/201328

29  Calling Conventions aim to ensure executables are referenced by build target name rather than the filename to avoid ambiguity and errors. Calling Conventions  BASIS provides utility functions for each supported language to do just that in a safe and reusable way. 11/22/201329

30  Any command-line tool needs to parse command-line arguments.  BASIS requires each executable to output  a help screen on --help (-h)  a shorter usage information on ––helpshort  and its version and copyright on --version. 11/22/201330

31  BASIS provides command-line parsing libraries  Implemented for each supported language.  These libraries create a help screen from brief descriptions provided for each option.  No need to format the help screen manually.  Able to output a man page or XML description.  Such help is more likely to be up-to-date rather then being forgotten when an option was renamed, removed, or added… 11/22/201331

32  C++  TCLAP TCLAP  Gflags Gflags  Boost::program_options Boost::program_options  Java  args4j args4j  Python  argh (wrapper for argparse) arghargparse  Perl  Getopt::Tabular Getopt::Tabular  Getopt::Declare Getopt::Declare  BASH  shflags (extended shFlags) shflagsshFlags  MATLAB  none available yet 11/22/201332 See Command-line Parsing documentation on the BASIS website for more details.Command-line Parsing

33  C++  gtest gtest  gmock gmock  libtap++ libtap++  Boost.Test Boost.Test  Java  JUnit JUnit  JTap JTap  Python  unittest unittest  PyTap PyTap  Perl  Test::Simple Test::Simple  Test::More Test::More  Test::MockObject Test::MockObject  BASH  shtap (slightly modified tap-functions library) shtaptap-functions  MATLAB  MATLAB xUnit Test Framework MATLAB xUnit Test Framework 11/22/201333 Already part of Perl installation. Test Anything Protocol (TAP) Producers Common use and standardized output which can be processed, for example, by Test::Harness written in Perl. Built into Python language.

34 What’s changed? 11/22/201334

35  See ChangeLog of BASIS distributed by SBIA See ChangeLog of BASIS distributed by SBIA 11/22/201335

36  BASIS Moves to GitHub and expands beyond the Section of Biomedical Image Analysis (SBIA) at the University of Pennsylvania. BASIS Moves to GitHub  3.0 strips of some SBIA specific defaults to allow more customization required by other organizations.  Everything organization specific shall be separated from the main functionality and be configurable.  Default templates will be available that should provide a good starting point for anyone. 11/22/201336

37  Check GitHub for the latest developments  Read More ▪ https://github.com/schuhschuh/cmake-basis https://github.com/schuhschuh/cmake-basis  Get the Source ▪ git clone https://github.com/schuhschuh/cmake-basis.githttps://github.com/schuhschuh/cmake-basis.git 11/22/201337

38  Remember, your participation and feedback is required to improve BASIS!  What do you like?  What concerns you?  What hinders you?  What is missing?  Need tutorial-like examples to go more into details regarding certain aspects with hands-on examples  Post questions and ideas on GitHub  Issue tracker ▪ https://github.com/schuhschuh/cmake-basis/issues https://github.com/schuhschuh/cmake-basis/issues  Wiki ▪ https://github.com/schuhschuh/cmake-basis/wiki https://github.com/schuhschuh/cmake-basis/wiki 11/22/201338

39 11/22/201339


Download ppt "Build system And Software Implementation Standard by Andreas Schuh and Andrew Hundt Copyright © 2011 University of Pennsylvania. Copyright © 2013 Carnegie."

Similar presentations


Ads by Google