Software Package development and management

Slides:



Advertisements
Similar presentations
Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu.
Advertisements

DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr Carlo Izzo Using External Libraries.
05/11/2001 CPT week Natalia Ratnikova, FNAL 1 Software Distribution in CMS Distribution unitFormContent Version of SCRAM managed project.
13-Jul-15Advanced Programming Spring 2002 autoconf Jonathan Lennox Department of Computer Science Columbia University.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 9.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
Software Installation The full set of lecture notes of this Geant4 Course is available at
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.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
SDD/DFS R. Palsa VLT 2 nd Generation Instrumentation Pipelines, 19 Apr Ralf Palsa CVS, GNU Build Tools & Coding Standards.
CCA Port, Component & Application Build Skeleton Templates “A new script toolkit for generating CCA build skeletons” Torsten Wilde and James Kohl Oak Ridge.
Project Source Code Structure and Build Process ● Remember consistency matters as source code structure, build process, and release processes are all intertwined.
Trilinos 101: Getting Started with Trilinos November 7, :30-9:30 a.m. Mike Heroux Jim Willenbring.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Yannick Patois – CVS and Autobuild tools at CCIN2P3 – hepix - October, n° 1 CVS setup at CC-IN2P3 and Datagrid edg- build tools CVS management,
Software Engineering in Robotics Packaging and Deployment of Systems Henrik I. Christensen –
Handling of Unix Application Software Stephan Wiesand DESY -DV - May 25, 2004.
Makefiles CISC/QCSE 810. BeamApp and Tests in C++ 5 source code files After any modification, changed source needs to be recompiled all object files need.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
The introduction of CMT Version v1r14. General index 1.presentation 2.how to install CMT 3.how to write a requirements file 4.how to use CMT.
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
Tutorial build Main ideas –Reuse as much previously obtained configuration information as possible: from Babel, cca-spec-babel, etc. –Extract all irrelevant.
March 2, 2005Wah-kai Ngai1 Installation of Geant4 1st HK Simulation Meeting.
CMT Christian Arnault - LAL - Chep /18 Introduction What is CMT, its goals Operating CMT The concepts in CMT, the internal model Status, implementation.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
M4 Macro-processing Language Geoffrey Sewell. What will be shown? What’s a macro processor? History of M4 Uses Autotools Syntax Hopefully, you all learn.
CERN-PH-SFT-SPI August Ernesto Rivera Contents Context Automation Results To Do…
Advanced BioPSE NCRR How to Install and Configure J. Davison de St. Germain Chief Software Engineer SCI Institute December 2003 J. Davison.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Makefiles. Multiple Source Files (1) u Obviously, large programs are not going to be contained within single files. u C provides several techniques to.
Configuration Management CSCI 5801: Software Engineering.
Tools – Ant-MakeEtc 1 CSCE 747 Fall 2013 CSCE 747 Software Testing and Quality Assurance Tools 12 – Hamcrest 10/02/
GLite build and integration system Building and Packaging Robert HARAKALY
Differences Training BAAN IVc-BaanERP 5.0c: Application Administration, Customization and Exchange BaanERP 5.0c Tools / Exchange.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
10/2/2000LHCb Computing, CHEP Use of Configuration Management tool in LHCb software J. Harvey, P. Mato, F. Ranjard CERN (Switzerland)
Linux development Lection What we gonna do today Root privileges Software packages Managing software packages Build procedures Build components.
Software structure and distribution How to share your code with the rest of the world Why it has to be… AA: Kurtis AB: YongChul
Milan, 15 June 2001WP1 Meeting - F. Donno1 GRID Packaging and Code Management for WP1 F. Donno INFN - Pisa.
INTRODUCTION TO AUTOCONF AND AUTOMAKE. GNU BUILD SYSTEM 1)GNU AUTOCONF 2)GNU AUTOMAKE 3)GNU LIBTOOL 4)GNU GETTEXT.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Gfal-srm-ifce library CERN Todor Manev
GLite build and integration system Building and Packaging Robert HARAKALY
Wed Mar Michael Imamura / The GNU Autotools Your very own./configure.
“Port Monitor”: progress & open questions Torsten Wilde and James Kohl Oak Ridge National Laboratory CCA Forum Quarterly Meeting Santa Fe, NM ~ October.
CLHEP Infrastructure Improvements CHEP 2004 Lynn Garren, FNAL and Andreas Pfeiffer, CERN.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
Fixing autotools-related build issues
Getting Started in RPM Packaging Izhar Firdaus / KageSenshi Contributor Fedora Project
Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools.
MaSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic.
A gentle introduction to Autotools The good, the bad and the ugly Kees-Jan Dijkzeul October 28 th, 2010.
Stephanie Allison Software Mar 2, 2006 IOC Applications Host Applications Directory Structure Environment Setup Issues.
RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific.
Autoconf, Automake, and Libtool Tom Tromey. Copyright ● Copyright 2006 Tom Tromey ● Parts Copyright 2006 Alexandre Duret-Lutz ●
BASIS Quick Start Guide
Linux file system "On a UNIX system, everything is a file;
C Runtime In Tcl v3 Andreas Kupries ActiveState Software Inc. © 2011
June 2011 David Front Weizmann Institute
The GNU Autotools: autoconf, automake, (libtool)
What is make? make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss.
Software Installation
Overview Unit testing Building Version control.
Software Installation, release 4.0
SPL – PS1 Introduction to C++.
Presentation transcript:

Software Package development and management An example of usage of the GNU autotools kit  Flavia Donno LCG EIS Team Flavia.Donno@cern.ch http://www.cern.ch/flavia/autotools.ppt Autotools Seminar CHEP 2003 – 24-28 March – no. (1)

Talk Outline Motivation Package Structure The autotools A practical example bootstrap configure.in Makefile.am The commands sequence

Motivations Establishing agreed package structure and management tools helps developers understanding the software The autotools kit make easier the burden of building, distributing, installing software packages It helps in writing multi-platform code It helps managing multi-component packages It relieves the developers from deep knowledge of system dependent features It make easier to build maintenance package infrastructure …

Package Structure Building Tree Installation Tree Distribution Tree -rw-r--r-- flavia zh AUTHORS -rw-r--r-- flavia zh CHANGES -rw-r--r-- flavia zh COPYING drwxr-xr-x flavia zh CVS -rw-r--r-- flavia zh INSTALL -rw-r--r-- flavia zh LICENCE -rw-r--r-- flavia zh Makefile.am -rw-r--r-- flavia zh README -rwxr-xr-x flavia zh bootstrap -rwxr-xr-x flavia zh clean.sh.in -rw-r--r-- flavia zh configure.in -rw-r--r-- flavia zh package.spec.in drwxr-xr-x flavia zh lib -rw-r--r-- flavia zh makefile_header drwxr-xr-x flavia zh src drwxr-xr-x flavia zh test drwxr-xr-x flavia zh doc drwxr-xr-x flavia zh bin drwxr-xr-x flavia zh etc drwxr-xr-x flavia zh include drwxr-xr-x flavia zh lib drwxr-xr-x flavia zh sbin/test drwxr-xr-x flavia zh share/doc Installation Tree Similar to the building tree. Contains system specific configure, spec, etc files Does not usually contains autotools file to modify autotools configuration Distribution Tree

The autotools The kit is composed by various tools: Autoconf http://www.gnu.org/software/autoconf Automake http://www.gnu.org/software/automake Libtool http://www.gnu.org/software/libtool Other packages are GNU m4 and Perl Autoconf: is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of UNIX-like systems. The scripts produced do not need autoconf when they run. Scripts are produced from template files. It reliably discovers system-specific build and run-time information. Automake: it supports dependency tracking, recursive builds in subdirectories, reliable timestamps, etc. It builds a Makefile.in starting from Makefile.am. Autoconf then process the Makefile.in. Libtool: it handles all the requirements of building shared libraries with portability.

A practical example The autotools have been used for the EDG GDMP package. The description of the steps performed are described in: http://edg-wp2.web.cern.ch/edg-wp2/docs/gdmp/GDMP_Autotools.pdf

bootstrap It is a startup procedure that creates primary scripts such as configure starting from the configure.in template #!/bin/sh # $Id$ ## ******************************************************* ## * Author: …. ## * Copyright © 2004 CERN and INFN on behalf of the LCG project ## * For License conditions see LICENSE file or ## * http://www.cern.ch/lcg/license.html ## * set –x if [ ! –x ./config ] ; then mkdir ./config fi rm –f config.cache aclocal –I config 2>/dev/null autoheader libtoolize –c –automake automake –foreign –add-missing –copy 2>/dev/null autoconf Collect M4 macro definitions to be used later on by autoconf Place config files in config dir Creates config.h.in Add libtool support configure Creates Makefile.in from Makefile.am

configure.in It is the main script. It can be generated using autoscan dnl This is a comment AC_INIT(src/BrokerInfo.C) dnl Set config options AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(edg-brokerinfo, 2.1) AC_PREFIX_DEFAULT(/opt/edg) if test “x$prefix” = “xNONE”; then prefix=$ac_default_prefix ac_configure_args=“$ac_configure_args –prefix $prefix” fi

configure.in shell directives are mixed up with M4 macros dnl Define patchlevel BIPATCHLVL=5 dnl Check for gcc3.2 compiler GCCVER=$EDG_RPM_RELEASE_VERSION dnl Check for programs. AC_PROG_CXX dnl Disable creation of static libraries by default AC_DISABLE_STATIC dnl Check for use of libtool AM_PROG_LIBTOOL dnl Check for libraries AC_CHEK_LIB(pthread)

configure.in shell directives are mixed up with M4 macros dnl Check for header files AC_HEADER_DIRENT AC_HEADER_STDC dnl Check for typedefs, structures, and compiler characteristics AC_C_CONST AC_TYPE_SIZE_T dnl Check for library functions AC_FUNC_UTIME_NULL AC_CHECK_FUNCS(getenv)

configure.in check for a specific library dnl Check for ClassAds AC_MSG_CHECKING([for ClassAds directory]) AC_ARG_WITH(classads-install, [--with-classads-install=<dir> Default is \$CLASSADS_INSTALL_PATH], classads_dir=“$withval”,classads_dir=“$CLASSADS_INSTALL_PATH”) if test –d “$classads_dir”; then AC_MSG_RESULT([$classads_dir found]) export CLASSADS_INSTALL_PATH=$classads_dir else AC_MSG_ERROR([no such directory $classads_dir]) fi

configure.in check for a specific library …continues dnl Check for ClassAds option AC_MSG_CHECKING([for ClassAds namespace]) AC_ARG_ENABLE(classads-namespace, [--enable-classads-namespace=<option> Default is no], classadsopt=“$enableval”,classadsopt=“no”) if test “x$classadsopt” = “xyes”; then AC_MSG_RESULT([enabling ClassAds C++ namespace]) CLASSADS_FLAGS=“-DWANT_NAMESPACE” else AC_MSG_RESULT([no ClassAds C++ namespace]) CLASSADS_FLAGS=“” fi

configure.in check for a specific library …continues dnl Enable namespace if gcc 3.2 if test “x$GCCVER” = “x_gcc_3_2_2”; then AC_MSG_RESULT([enabling ClassAds C++ namespace]) CLASSADS_FLAGS=“-DWANT_NAMESPACE” CC=gcc-3.2.2 CXX=c++-3.2.2 –Wno-deprecated” fi

configure.in What about rpms ? dnl Check rpm dir RPMD=`pwd` AC_MSG_CHECKING([for directory where to create rpms]) AC_ARG_WITH(rpm-dir,[ --with-rpm-dir=<dir> Default is \$RPMD/], rpm-dir=“$withval”, rpm_dir=“$RPMD”) if test –d “$rpm_dir” ; then AC_MSG_RESULT([found $rpm_dir]) else AC_MSG_RESULT([no such directory $rpm_dir]) AC_MSG_RESULT([the directory $rpm_dir will be created for you if possible]) fi RPM_DIR=$rpm_dir

configure.in Export environments dnl Define required variables AC_SUBST(BIPATCHLVL) AC_SUBST(CLASSAD_INSTALL_PATH) AC_SUBST(CLASSAD_FLAGS) AC_SUBST(RPM_DIR) AC_SUBST(GCCVER) AC_SUBST(CC) AC_SUBST(CXX)

configure.in Produce necessary files dnl Create files AC_OUTPUT(src/Makefile lib/Makefile Makefile doc/Makefile test/Makefile \ edg-brokerinfo.spec clean.sh)

Makefile.am This is the top Makefile.am # $Id:$ ## ********************************* ## * SUBDIRS = src lib test doc BI_SPEC = edg-brokerinfo.spec EXTRA_DIST = edg-brokerinfo.spec.in clean.sh.in makefile_header bootstrap \ LICENSE README MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in \ stamp-h.in

Makefile.am This is the top Makefile.am RPM_SPEC_PATH=@RPM_DIR@/SPECS rpm: $(BI_SPEC) gmake –i dist; \ /bin/mkdir –p @RPM_DIR@/SOURCES \ @RPM_DIR@/SPECS \ @RPM_DIR@/RPMS \ @RPM_DIR@/SRPMS \ /bin/cp –u @PACKAGE@-@VERSION@.tar.gz \ @RPM_DIR@/SOURCES; \ for file in $(BI_SPEC) ; do /bin/cp $$file $(RPM_SPEC_PATH); \ done cd $(RPM_SPEC_PATH); \ rpm –define “_topdir @RPM_DIR@” –ba $$file;

Makefile.am This is the top Makefile.am – other targets dist-hook: cd $(distdir) \ for file in $(MAINTAINERCLEANFILES); do \ /bin/rm $(distdir)/$$file; \ done /bin/cp $(srcdir)/doc/edg-brokerinfo-user-guide-v2.pdf \ $(distdir)/doc userdoc: gmake –C doc clean-tree: chmod a+rx ./clean.sh ./clean.sh

Makefile.am This is the src/Makefile.am include $(top_srcdir)/makefile_header edg_brokerinfoincdir = $(prefix)/include/edg-brokerinfo edg_brokerinfoinc_HEADERS = BrokerInfo.h bi_result.h noinst_LTLIBRARIES = libedg-brokerinfo.la libedg_brokerinfo_la_SOURCES = BrokerInfo.C BrokerInfo.h bi_result.h bin_PROGRAMS = edg-brokerinfo edg_brokerinfo_SOURCES = BrokerCLI.C edg_brokerinfo_LDADD = BrokerInfo.o ($BROKERINFOLIBS) edg_brokerinfo_LDFLAGS = $(BROKERINFOLDFLAGS) MAINTAINERCLEANFILES = Makefile.in dist-hook: cd $(distdir) \ for file in $(MAINTAINERCLEANFILES); do \ /bin/rm $(distdir)/$$file; \ done

Makefile.am This is the lib/Makefile.am lib_LTLIBRARIES = libedg-brokerinfo.la libedg_brokerinfo_la_SOURCES = libedg_brokerinfo_la_LDFLAGS = --version-info 1:0:1 libedg_brokerinfo_la_LIBADD = ../src/libedg-brokerinfo.la MAINTAINERCLEANFILES = Makefile.in dist-hook: cd $(distdir) \ for file in $(MAINTAINERCLEANFILES); do \ /bin/rm $(distdir)/$$file; \ done

Makefile.am This is the test/Makefile.am include $(top_srcdir)/makefile_header bitestdir = $(prefix)/sbin/test Bitest_DATA = example.BrokerInfo bin_PROGRAMS = edg-brokerinfo-test edg_brokerinfo_test_SOURCES = BrokerTester.C edg_brokerinfo_test_LDADD = ../src/BrokerInfo.o ($BROKERINFOLIBS) edg_brokerinfo_test_LDFLAGS = $(BROKERINFOLDFLAGS) EXTRA_DIST = example.BrokerInfo MAINTAINERCLEANFILES = Makefile.in install-data-hook: edg-brokerinfo-test example.BrokerInfo if test –d $(DESTDIR)$(bitestdir) ; then \ $(mkinstalldirs) $(DESTDIR)$(bitestdir); \ fi /bin/mv $(DESTDIR)$(bindir)/edg-brokerinfo-test $(DESTDIR)$(bitestdir)/edg-brokerinfo-test; dist-hook: cd $(distdir) \ for file in $(MAINTAINERCLEANFILES); do \ /bin/rm $(distdir)/$$file; \ done This is the test/Makefile.am

The commands sequence rpm implies dist ./bootstrap ./configure –prefix=/opt/flavia –with-classads-install=/opt/classads \ –enable-classad-namespace –with-rpm-dir=/home/flavia/rpms gmake gmake userdoc gmake install gmake dist gmake rpm gmake clean-tree rpm implies dist