BASIS Quick Start Guide

Slides:



Advertisements
Similar presentations
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
Advertisements

BASIS Quick Start Guide by Andreas Schuh.  Introduction  Installing BASIS  Creating a New Project  Installing Your Project  Adding Executables 
Cygwin Linux for Windows Desktop Paul Stuyvesant.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
Linux+ Guide to Linux Certification, Second Edition
Command Console Tutorial BCIS 3680 Enterprise Programming.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Doxygen: Source Code Documentation Generator John Tully.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Linux Operations and Administration
BASIS Tutorial by Andreas Schuh Copyright ©2011 University of Pennsylvania. Copyright ©2013 Carnegie Mellon University.11/11/2013.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Build system And Software Implementation Standard by Andreas Schuh and Andrew Hundt Copyright © 2011 University of Pennsylvania. Copyright © 2013 Carnegie.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Linux+ Guide to Linux Certification, Second Edition
Guideline: How to build AMSS source code? History: 01/02/ Make Draft 05/02/2010 – Release /02/2010 – Updated.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
QT - a C++ based GUI QT’s Designer and Assistant.
Cygwin Linux for Windows Desktop Paul Stuyvesant.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
Tutorial build Main ideas –Reuse as much previously obtained configuration information as possible: from Babel, cca-spec-babel, etc. –Extract all irrelevant.
Build system And Software Implementation Standard by Andreas Schuh.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
WDO-It! 102 Workshop: Using an abstraction of a process to capture provenance UTEP’s Trust Laboratory NDR HP MP.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
How to Open a New Language in Web OPAC for Testing Web Screens Presenter: Yoel Kortick.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Part 3: Adding System Calls to OS/161 Dr. Xiao Qin Auburn University.
 CSC 215 : Procedural Programming with C C Compilers.
Xxx Presentation, No 1 Copyright © TAC AB Engineering Classic Networks1.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Software development tools
Tinyos Introduction to Programming Pritee Parwekar.
Review Why do we use protection levels? Why do we use constructors?
bitcurator-access-webtools Quick Start Guide
Subversion Subversion is a brand of version control software that is frequently used to store the code and documentation of a project so as to permit.
CSC 215 : Procedural Programming with C
Development Environment
Install external command line softwares
The Linux Operating System
Introduction to computing
CMPE 152: Compiler Design ANTLR 4 and C++
Chapter 2: The Linux System Part 2
Cmake Primer.
Use of Mathematics using Technology (Maltlab)
Compilers, Make and SubVersion
Software Installation
Electronics II Physics 3620 / 6620
Cordova & Cordova Plugin Installation and Management
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
bitcurator-access-webtools Quick Start Guide
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Lab 4: Introduction to Scripting
Software Installation, release 4.0
Java Code Review with CheckStyle
Presentation transcript:

BASIS Quick Start Guide Getting Started by Andreas Schuh, updated by Andrew Hundt 11/11/2013 Copyright ©2011 University of Pennsylvania. Copyright ©2013 Carnegie Mellon University.

Outline Introduction Installing BASIS Creating a New Project Installing Your Project Adding Executables Adding Libraries 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Introduction What is this quick start guide about? Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Introduction First install BASIS on your system. Use the so-called “basisproject” command line tool to create a new empty project. Add some example source files and edit the build configuration files to build the executable and library files. Finally, build and test the example project. For a more detailed explanation of each step, have a look at the corresponding BASIS Tutorial.

Windows Users To follow the steps in this quick start guide, you need to have a Unix-like operating system. Linux Mac OS X Note that BASIS can also be installed and used on Windows. The tools for creating a new project and for automated software tests are, however, only available for Unix. At the moment, there is no separate tutorial available for Windows users. Alternatively, you can install CygWin. This would also allow you to use the BASIS tools which are not available for native Windows.

Installing BASIS How do I get BASIS installed on my system? 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Get a Copy of BASIS Download the source code of BASIS: mkdir -p ~/local/src cd ~/local/src git clone https://github.com/schuhschuh/cmake-basis.git 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Configure BASIS Before you can build BASIS, you need to configure it using CMake 2.8.4 or greater. Configure the build system using CMake: mkdir basis-build cd basis-build ccmake ../basis Hit ‘c’ to configure the project. Change INSTALL_PREFIX to ~/local. Disable any of the BUILD_*_UTILITIES options depending on whether you have Python or Perl installed on your system and intend to use these languages. Hit ‘g’ to generate the Makefiles. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Build BASIS CMake has generated Makefiles for GNU Make. Therefore, the build is triggered by the make command: make 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Install BASIS To install BASIS, we “build” the install target: make install As a result, CMake copies the built files into the installation tree as specified by the INSTALL_PREFIX variable. Additionally, BASIS may create some symbolic links on Unix systems if the INSTALL_LINKS option was set to ON during the configuration of BASIS. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Set Up Environment Set the following environment variables: setenv PATH "~/local/bin:${PATH}" setenv BASIS_EXAMPLE_DIR "~/local/share/basis/example" setenv HELLOBASIS_RSC_DIR "${BASIS_EXAMPLE_DIR}/hellobasis" Using BASH: export PATH="~/local/bin:${PATH} " export BASIS_EXAMPLE_DIR="~/local/share/basis/example" export HELLOBASIS_RSC_DIR="${BASIS_EXAMPLE_DIR}/hellobasis" 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Creating a New Project How do I create my own BASIS conforming project? 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Create a New Project Create a new and empty project as follows: basisproject --name HelloBasis --description "This is a BASIS project. " --root ~/local/src/hellobasis The next command demonstrates that you can modify a previously created project by using the project tool again: basisproject --root ~/local/src/hellobasis --noexample --config-settings Here we removed the example/ subdirectory and added some configuration file used by BASIS. These options could also have been given to the initial command above instead. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Website Links More details on the creation of a new BASIS project and its modification afterwards using the project tool of BASIS can be found on the website of SBIA at: http://www.rad.upenn.edu/sbia/software/basis/manual.html

Installing Your Project Fine, so how do I build and install this BASIS project? 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Install Your Project The build and installation of this BASIS project is identical to the build and installation of BASIS itself. In fact, all CMake-based projects are build this way. The Build and Installation How-to summarizes these steps. Build and install the (currently empty) project: mkdir ~/local/src/hellobasis-build cd ~/local/src/hellobasis-build cmake -D INSTALL_PREFIX=~/local ../hellobasis make 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Adding Executables How do I get my executables build? 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Add Executable Target Copy the source file from the example to src/: cd ~/local/src/hellobasis cp ${HELLOBASIS_RSC_DIR}/helloc++.cxx src/ Add the following line to src/CMakeLists.txt under the section “executable target(s)”: basis_add_executable (helloc++.cxx) Note: Alternatively, you can use the implementation of this example executable in Python, Perl, BASH or MATLAB. In case of MATLAB, add also a dependency to MATLAB: basisproject --root ~/local/src/hellobasis --use MATLAB 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Change Properties The name of the output file is given by the OUTPUT_NAME property. The name of the symbolic link is given by the SYMLINK_NAME property. To change these properties, add the following lines to the src/CMakeLists.txt (after basis_add_executable()): basis_set_target_properties ( helloc++ PROPERTIES OUTPUT_NAME "hellobasis" SYMLINK_NAME "helloworld" ) Note: If you used another example, you need to replace helloc++ by the name of the source file you used excluding the extension. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

src/CMakeLists.txt To conclude, your src/CMakeLists.txt file should now contain CMake code similar to the following snippet: basis_add_executable (helloc++.cxx) basis_set_target_properties ( helloc++ PROPERTIES OUTPUT_NAME "hellobasis" SYMLINK_NAME "helloworld" ) 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Test the Executable Now build the executable and test it: cd ~/local/src/hellobasis-build make bin/hellobasis How is it going? Note: As you configured the build system before using CMake, we only need to run GNU Make. CMake will recognize the change of src/CMakeLists.txt and reconfigure the build system automatically. Install the executable and test it: make install helloworld Note: The symbolic link named helloworld is in ~/local/bin/ which is already in our search path for executables (PATH). 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Adding Libraries How do I add libraries/modules to my project? 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Add Private Library Copy the files from the example to src/: cd ~/local/src/hellobasis cp ${HELLOBASIS_RSC_DIR}/foo.* src/ Add the following line to src/CMakeLists.txt (section “library target(s)”): basis_add_library (foo.cxx) Note: This is a library without public interface. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Add Public Library Create the subdirectory tree for the public header files: cd ~/local/src/hellobasis basisproject --root . --include Copy the files from the example: cp ${HELLOBASIS_RSC_DIR}/bar.cxx src/ cp ${HELLOBASIS_RSC_DIR}/bar.h include/sbia/hellobasis/ Add the following line to src/CMakeLists.txt (section “library target(s)”): basis_add_library (bar.cxx) Note: This is a library with public interface as declared in bar.h. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Add Script Module Another kind of libraries are modules written in a scripting language such as Perl. Copy the module file to src/: cd ~/local/src/hellobasis cp ${HELLOBASIS_RSC_DIR}/FooBar.pm.in src/ Add the following line to src/CMakeLists.txt (section “library target(s)” ): basis_add_library (FooBar.pm) 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

The .in Suffix Note that some of these files have a .in file name suffix. This suffix can be omitted in the basis_add_library() statement. It has however an impact on how this function treats this file. The .in suffix indicates that the file is not usable as is, but contains patterns such as @PROJECT_NAME@ which BASIS should replace during the build of the module. The substitution of these @*@ patterns is what we refer to as “building” script files. 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

Install the Libraries Now build the libraries: And install them: cd ~/local/src/hellobasis-build make And install them: make install 10/21/2011 Getting Started Copyright (c) 2011 University of Pennsylvania. All rights reserved.

You just finished your first BASIS Quick Start Guide! Congratulations You just finished your first BASIS Quick Start Guide! If this was not clear enough or you would like to know more, have a look at the corresponding BASIS Tutorial which gives more details about each of the steps described here.