CLHEP Infrastructure Improvements CHEP 2004 Lynn Garren, FNAL and Andreas Pfeiffer, CERN.

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

Separate compilation Large programs are generally separated into multiple files, e.g. tuples.h, ray.h, ray.c, tuples.c main.c With several files, we can.
Understanding Makefiles COMP 2400, Fall 2008 Prof. Chris GauthierDickey.
Compilation & linkage.h read.h.c read.c.c main.c.c list.c.h list.h prog1 Linkage: g++ read.o main.o list.o –o prog1.o main.o.o list.o.o read.o Compilation:
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
14 May 2007 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC.
18 June 2010 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC.
6 November 2009 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC Geant4 v9.2p02.
14 January 2011 Upgrading Your Geant4 Release J. Perl 1 Upgrading Your Geant4 Release Joseph Perl, SLAC.
Software Installation, release 4.0 Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002 Takashi Sasaki, Gabriele Cosmo,
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.
CIS*2450 Seminar I Makefiles Debugging/Design Approaches Exception Handling Library Revision Control Designed by: Terry Moreland Updated by: Tom Crabtree.
Software Tools and Processes Training and Discussion October 16, :00-4:30 p.m. Jim Willenbring.
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.
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
ICS – Software Engineering Group 1 Cross Compiling vxWorks on Linux EPICS Collaboration Meeting l May 2002 at BESSY, Germany May 2002 at BESSY,
Setting up Eclipse Computer Organization I 1 August 2009 ©2009 McQuain Getting Eclipse for C/C++ Development Go to and click on Download.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
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.
Jump to first page (C) 1998, Arun Lakhotia 1 Software Configuration Management: Build Control Arun Lakhotia University of Southwestern Louisiana Po Box.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
Adv. UNIX: large/131 Advanced UNIX v Objectives of these slides: –learn how to write/manage large programs consisting of multiple files, which.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
Chapter Ten g++ and make1 System Programming Software Development: g++ and make.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring Mike Phenow.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Makefile M.A Doman. Compiling multiple objects Card.cpp -> Card.o Deck.cpp -> Deck.o main.cpp -> main.o main.o Deck.o Card.o -> Dealer.exe.
Advanced BioPSE NCRR How to Install and Configure J. Davison de St. Germain Chief Software Engineer SCI Institute December 2003 J. Davison.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Good Morning! f Tuesday, 28 January FPCLTF and CLHEP Walter E. Brown f Fermi National Accelerator Laboratory Z O O M.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
J.P. Wellisch, CERN/EP/SFT SCRAM Information on SCRAM J.P. Wellisch, C. Williams, S. Ashby.
Support for Platforms in Geant4. Gunter Folger, CERN PH/SFT Geant4 Technical Forum CERN, 5 February 2004.
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)
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.
Open project in Microsoft Visual Studio → build program in “Release” mode.
C code organization CSE 2451 Rong Shi. Topics C code organization Linking Header files Makefiles.
INTRODUCTION TO AUTOCONF AND AUTOMAKE. GNU BUILD SYSTEM 1)GNU AUTOCONF 2)GNU AUTOMAKE 3)GNU LIBTOOL 4)GNU GETTEXT.
Migration to ISO C++ an overview Gabriele Cosmo CERN - IT/ASD.
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.
CSc 352 An Introduction to make Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Wed Mar Michael Imamura / The GNU Autotools Your very own./configure.
Development meeting 7 April  Platforms  Build system  CVS structure  Namespace structure  Overall development process Testing.
Use of CMT in LHCb CMT Workshop, LAL (Orsay) 28 th February - 1 st March 2002 P. Mato / CERN.
Fixing autotools-related build issues
Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools.
Software Package development and management
Getting Eclipse for C/C++ Development
How to Upgrade Your Geant4 Release
Software Installation
CMPSC 60: Week 4 Discussion
Software Installation, release 4.0
Getting Eclipse for C/C++ Development
Cygwin: getting the setup tool
Preparation for Assignment 2
The make utility (original presentation courtesy of Alark Joshi)
Presentation transcript:

CLHEP Infrastructure Improvements CHEP 2004 Lynn Garren, FNAL and Andreas Pfeiffer, CERN

What is CLHEP? HEP-specific foundation and utility classes that provide – Random number generators – Physics vectors – Particle data table – Etc. Used by Geant4, ThePeg, …

The problem CLHEP has traditionally been distributed as one large package which builds one large library Some packages are updated more frequently than CLHEP releases Users may want only some of the packages Users may want to get single package updates

The solution Enable separate builds of each CLHEP package – Each package needs its own configure – Have to worry about dependencies Still build entire CLHEP – Default option – Use infrastructure in each package

Other changes Use namespace everywhere – Namespace CLHEP if no other namespace Add exception handling packages – Exceptions, Cast, Refcount – Disabled by default Geometry package substantially rewritten Updates to several packages

Code Structure Old source code: – CLHEP/ (*.cc, *.hh, *.h, *.icc) – CLHEP/ /doc – CLHEP/test (tests for all packages) New source code : – CLHEP/ / (*.h, *.hh, *.icc) – CLHEP/ /src (*.cc) – CLHEP/ /doc – CLHEP/ /test (tests for this package)

Concerns Backwards compatibility Headers invoked as “CLHEP/ /myheader.h” – Notice that this does not match the source code structure – Create a temporary header directory when building

Supported Compilers gcc 3.3 (all operating systems) gcc (only for backwards compatibility) gcc 3.4 tested, but not yet officially supported Solaris CC 5.4 Windows VisualC – Must compile under cygwin – Do not need to be in cygwin to use libraries

Releases Two concurrent releases – CLHEP 1.9.x.x is backwards compatible “using namespace CLHEP” in headers CLHEP.h and package defs.h headers Supports gcc – CLHEP 2.0.x.x is NOT backwards compatible Otherwise identical to 1.9 No “using namespace” statements in headers CLHEP.h replaced by package defs.h headers Does not support gcc Major source code changes in CLHEP 2.1.x.x

Using Autotools Take advantage of the power of autotools Recent versions required – support operating system and compiler configurations autoconf 2.59 or later – Configure automake or later – Makefiles libtool 1.9b or later – Build shared and static libraries – Lots of knowledge about compilers

Infrastructure Files These files are used by developers, not installers CLHEP/bootstrap – Run autotools commands for this and all package directories CLHEP/ /bootstrap CLHEP/configure.in CLHEP/ /configure.in Makefile.am – In top directory and all subdirectories CLHEP/setup.cygwin-VC71 – For Windows VisualC++ 7.1

configure.in # Identify the package and initialize autotools: AC_INIT(CLHEP Vector, , Vector) AC_CONFIG_SRCDIR([src/AxisAngle.cc]) # tell autoconf the name of the configuration header AM_CONFIG_HEADER([Vector/defs.h]) # various files to be generated from xxx.in AC_CONFIG_FILES([Vector/Makefile])

configure.in – boilerplate for defs.h AH_TOP([#ifndef VECTOR_DEFS_H #define VECTOR_DEFS_H]) …. ## backwards compatibility AH_VERBATIM([ENABLE_BACKWARDS_COMPATIBILITY],[/* backwards compatibility will be enabled ONLY in CLHEP 1.9 */ #ifndef ENABLE_BACKWARDS_COMPATIBILITY #define ENABLE_BACKWARDS_COMPATIBILITY #endif]) AH_BOTTOM([#endif // VECTOR_DEFS_H])

configure.in – compiler section # Locate a C++ compiler: AC_PROG_CXX(cl g++ c++ aCC CC cxx cc++ FCC KCC RCC xlC_r xlC gpp) # Use it hereinafter: AC_LANG(C++)

configure.in – compiler flags case "$CXX" in g++) case "$target" in *-*-linux*) AM_CXXFLAGS="-O -ansi -pedantic -Wall -D_GNU_SOURCE";; *) AM_CXXFLAGS="-O -ansi -pedantic -Wall" esac;; cl) AM_CXXFLAGS="-EHsc" ;; *) echo UNEXPECTED CHOICE OF C++ COMPILER: $CXX esac # tell configure to use AM_CXXFLAGS when building the Makefile # must be called after defining AM_CXXFLAGS AC_SUBST(AM_CXXFLAGS)

configure.in - finalizing Checks already exist for most C++ deficiencies # Check for needed header files: AC_CHECK_HEADERS([sstream]) # Check for needed typedefs, structures, and compiler characteristics: AC_CHECK_TYPES([ptrdiff_t]) # Finish up: AC_OUTPUT

CLHEP/ /Makefile.am # Process this file with automake to produce Makefile.in includedir = $(prefix)/include/CLHEP # SUBDIRS order is very important – this is the processing order SUBDIRS = Vector. src test # list all subdirectories - for distribution and cleaning DIST_SUBDIRS = Vector. src test doc # create temporary CLHEP header tree all-local: $(top_builddir)/CLHEP # add rules to build documentation docs: cd doc; $(MAKE) $(AM_MAKEFLAGS)

CLHEP/ / /Makefile.am # makefile for the header subdirectory includedir = $(prefix)/include/CLHEP tempincludedir = # list each header explicitly # be sure to also list defs.h pkginclude_HEADERS = \ AxisAngle.h AxisAngle.icc … TwoVector.h defs.h # copy headers into $(tempincludedir) # this instruction is called by various CLHEP/ /Makefiles install-tmpHEADERS: …

CLHEP/ /src/Makefile.am INCLUDES = -I$(top_builddir) lib_LTLIBRARIES = = \ AxisAngle.cc Boost.cc \ ….. ThreeVector.cc ThreeVectorR.cc TwoVector.cc List each file explicitly Not much here configure generates final Makefile with compilation rules

Building CLHEP Get a source code tarball – bootstrap has already been run Create a separate build directory Identify your install directory cd build-directory …/CLHEP/configure –prefix=/fullpath/installdir [options] make make check make install make docs make install-docs

Updating a single package Get the source from a source code tarball cd build-directory Define $CLHEP_DIR – Allows you to get headers from standard installation – Choice of $CLHEP_DIR was arbitrary …/CLHEP/ /configure [options] make make check make install

configure options CXX=xyz (set the C++ compiler) CXXFLAGS=“some stuff” – Appends to compiler flags defined in configure.in --disable-shared (build only static libraries) --enable-exceptions (enable Exceptions package) --help Using environmental variables is not recommended

clheplib utility Lists individual package libraries needed for linking clheplib -L/fullpath/lib –lCLHEP clheplib HepMC -L/fullpath/lib –lCLHEP-HepMC –lCLHEP-Geometry –lCLHEP-HepPDT –lCLHEP-Vector Also, clhep-config [--lib] [--include] …

Source code distribution Source code tarball – bootstrap has already been run – Do not need autotools – Recommended for installers Source code also available from cvs – Must have autotools and run bootstrap – Only recommended for code developers

Comments about Autotools Pro – Very smart – Allow lots of configuration – Build libraries cleanly and properly – Checks times and will reconfigure if necessary Con – Sometimes too smart for its own good – Libtool “knows everything” about building for various operating system and compiler combinations – Will sometimes reconfigure when unnecessary Has been very useful for CLHEP