Patrick Gartung LArSoft Usability Meeting 22 June 2016 Build system explorations: Spack.

Slides:



Advertisements
Similar presentations
Copyright 2013 – Noah Mendelsohn Compiling C Programs Noah Mendelsohn Tufts University Web:
Advertisements

Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
© 2010 IBM Corporation IBM Experience Modeler - Theme Editor Installing Python Image Library Presenter’s Name - Presenter’s Title DD Month Year.
Software Installation The full set of lecture notes of this Geant4 Course is available at
Julie McEnery1 Installing the ScienceTools The release manager automatically compiles each release of the Science Tools, it creates a set of wrapper scripts.
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.
Unclassified/FOUO Zeta White Noise Hour Presents: NeXtMidas / X-Midas Interoperability 18 Jan 2006.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
Unit tests, Integration tests Physics tests Andrea Dotti, Gunter Folger, Pere Mato CERN – PH/SFT Geant4 workshop 2012.
Trilinos 101: Getting Started with Trilinos November 7, :30-9:30 a.m. Mike Heroux Jim Willenbring.
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
Mosflm & iMosflm (1) Some numbers... (2) Mosflm (3) iMosflm.
Installing CompuCell3D from source Maciej Swat Biocomplexity Institute, Indiana University.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
March 11, 2008 USCMS Tier-2 Workshop Oh Dear God Alain made a PowerPoint presentation 1.
INFSO-RI Enabling Grids for E-sciencE Strategy for gLite multi-platform support Author:Eamonn Kenny Meeting:SA3 All Hands Meeting.
Migration from SL4 to SL5 at CC-Lyon J ü rgen Brunner.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
Building Your Own Android Systems from Source Adam C. Champion CSE 5236: Mobile App Development 1.
Servicing HEP experiments with a complete set of ready integrated and configured common software components Stefan Roiser 1, Ana Gaspar 1, Yves Perrin.
Getting Started with SIDL using the ANL SIDL Environment (ASE) ANL SIDL Team MCS Division, ANL April 2003 The ANL SIDL compilers are based on the Scientific.
Separate distribution of the analysis code (and more) P. Hristov 19/03/2014.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Geant4 is a toolkit to simulate the passage of particles through matter, and is widely used in HEP, in medical physics and for space applications. Ongoing.
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.
GLAST Science Support Center June 29, 2005Data Challenge II Software Workshop User Support Goals For DC 2 James Peachey GSFC/L3.
SCD Monthly Projects Meeting 2014 Scientific Linux Update Rennie Scott January 14, 2014.
 CSC 215 : Procedural Programming with C C Compilers.
Use of CMT in LHCb CMT Workshop, LAL (Orsay) 28 th February - 1 st March 2002 P. Mato / CERN.
Geant4 Collaboration Meeting 2011, SLAC P. Mato/CERN.
This material is based upon work supported by the U.S. Department of Energy Office of Science under Cooperative Agreement DE-SC , the State of Michigan.
SYSTEM INTEGRATION TESTING Getting ready for testing shifts Gunter Folger CERN PH/SFT Geant4 Collaboration Workshop 2011 SLAC.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
1 Creative Innovation – Customer Satisfaction – Continual Quality Improvement Accessing and Building Asterisk SCF.
Practical Project Maintenance
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 18 – Linking and Libraries.
CMake - Cross-Platform Make R. Douglas Barbieri Made to Order Software Corporation.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
MET4750 Techniques for Earth System Modeling MET 5990 Techniques for Earth System Modeling and Research (
Managing Combinatorial Software Installations with Spack
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
CSC 215 : Procedural Programming with C
MET4750 Techniques for Earth System Modeling
Developing and Distributing Cross-Platform Software with PyInstaller
Connect:Direct for UNIX v4.2.x Silent Installation
CEPC Software Management Proposal
Feedback on a first use of the ALFA and O2 software
A451 Theory – 7 Programming 7A, B - Algorithms.
Releases and developments
Malwarebytes Installation Issues Number Facing error with Malwarebytes software is not something unusual as most of the users use to face.
CMPE 152: Compiler Design ANTLR 4 and C++
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
Software Installation
Chapter 7 –Implementation Issues
Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions
Software Installation, release 4.0
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Review of Previous Lesson
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
Cmake + Physics Lecture 2.
ROOT Support and Developments at FNAL
PyWBEM Python WBEM Client: Overview #2
Black All good PowerPoint starts with black..
Building Your Own Android Systems from Source
AtlasSetup & Evolution
Presentation transcript:

Patrick Gartung LArSoft Usability Meeting 22 June 2016 Build system explorations: Spack

The current build system used to build Fermilab projects: –Makes use of cmake macros that were developed with earlier versions cmake that lacked the features of current cmake –Makes use of environment variables defined by UPS, a Fermilab developed environment setup tool, that has problems running on new OS’s and in linux containers –Only got a unified build script within the last year or so. –Doesn’t integrate well with IDE’s available on Linux or OSX –Uses LD_LIBRARY_PATH to find libraries Great for portability A problem on OSX ElCapitan where DYLD_LIBRARY_PATH is squashed in shell sub-processes by SIP –Not used anywhere else in HEP (but what build system is?) Why look into new build systems? 2

Spack is the “supercomputer package manager” –Developed at LLNL for use on “supercomputers” –but it can be used on any Linux and OSX Spack was presented at SC15 and caught the attention of Fermilab developers Spack is like cmsbuild, buildFW, contractor, worch, lcgcmake, conda, macports, homebrew, etc in that it –Builds a stack of dependent software packages Spack is not like scram, mrb, setup_for_development, etc in that –Spack does not set up an environment for interactively building software (as of v0.9.1) (That is where SpackDev comes in) What is Spack? 3

Open source, well documented and community supported – source codehttps://github.com/LLNL/spack source code – documentationhttp://software.llnl.gov/spack documentation – pdf official paperhttps:// pdf official paper – Information including info about weekly teleconferencehttps://github.com/LLNL/spack/wiki Information including info about weekly teleconference – google grouphttps://groups.google.com/d/forum/spack google group Spack Links 4

Each software package is defined by its own python class –Source versions and urls –Variants Used to control cmake or configure options –Package dependencies syntax for a range of dependency versions and variants –Source patches –Build and install method Spack packages can be collected into a repo that is added on to spack rather than adding to the 400+ spack built-in packages. –One was created by HSF to collect packages common to HEP – Spack Packages 5

Spack sets up a build environment per package –explicitly unsets LD_LIBRARY_PATH in the package build environment –compilers set to wrapper scripts that Add rpath to compiler and linker arguments for each package dependency Add include paths to compiler arguments for each package dependency –sets CMAKE_PREFIX_PATH and/or PKCONFIG_PATH for each package dependency Why use rpath? –setting rpath circumvents the issue of SIP on OS X squashing DYLD_LIBRARY_PATH in shell subprocesses –your program always finds the right libraries regardless of environment variables Spack package build environment 6

Spack worked out of the box on SLF6, SL7 and Ubuntu –Spack includes the python packages it needs so the only requirement is python 2.6+ Digging a little deeper than README.md resolved any initial misunderstandings. Spack worked out of the box on OS X with Xcode command line tools installed (clang) –Fortran support on OS X requires a Homebrew or MacPorts install of gcc with gfortran, but that’s expected Spack developers and community are very helpful. –Google group and weekly teleconference (report from HEP community included in the agenda) Resolved a bug I found compiling gcc on OS X. –Spack compiler wrapper generated command “ld -r -rpath …”. –On linux the -rpath is ignored, on OS X this errors out. Feedback and Experience 7

Using the root and geant4 packages definition in hep-spack, built on these platforms –OSX10.10 with clang and spack-built gcc –OSX10.11 with clang and spack-built gcc –SL7 with spack-built gcc –SLF6 with spack-built gcc –Ubuntu with spack-built gcc Platforms built on 8

Adding features is straightforward and the spack developers accept many pull requests –Create tarballs and relocate pre-built binaries Work by Benedikt Henger with testing by Patrick Gartung – Refining package relocation on OSX by Patrick Gartung – –Alternate install location Work by Benedikt Hegner with testing by Patrick Gartung – –Create view directories ala lcgcmake Adding features to spack 9

Question during HSF workshop: Does spack catch incompatible dependencies (i.e. different version requirements) Made root dependent on one version of clhep and geant4 –I know root is not dependent on geant4. This was a test. Made geant4 dependent on a different version of clhep. Did spack catch this? Yes, but the error is a little cryptic: geant4]$ spack install root ==> Error: Invalid spec: Package clhep requires version , but spec asked for Incompatible dependencies 10

Sort of, but not out of the box Needed some modification or replacement of existing cmake scripts –There are no UPS defined environment variables in the spack build environment These could be defined by declaring the spack-built packages to a UPS install, but I am not expert. Can Spack build FNAL software? 11

Ben Morgan has put in a lot of effort into building the art stack with Spack –Defined a Spack package repo with packages for cetlib, fhicl- cpp, messagefacility and canvas –All dependent on cetbuildtools2 Attempt to redefine cetbuildtool macros without using environment variables defined by UPS – – –Cetbuildtools macro find_ups_package() can be replaced by cmake’s find_package() because Spack defines CMAKE_PREFIX_PATH and/or PKGCONFIG_PATH Out of the box I used this to build cetlib, fhicl-cpp and messagefacility Can Spack build the Art stack? 12

I picked up where Ben left off with canvas I reused the altCmakelists.cmake files I had created for the worch build of Art 1.14 and updated them for the latest canvas and art. I added the missing cmake cetbuildtools macro Build_Dictionary –Initially this crashed during dictionary generation because of a missing argument to the genreflex –D option –This missing argument was defined by cetbuildtools using ups environment variables –Needed to set one environment variable in the root package definition to the checkClassVersion script would work on linux. Built all of the libraries for canvas and art on SLF6 and SLF7. Can Spack build canvas/art? 13

With gcc yes. With clang mostly. –Spack wants to build everything with gcc, so I had to make all of the packages using cmake dependent on cmake%clang Ben was able to build everything up to canvas with clang. I was able to build all of the libraries for canvas and art with clang and the changes I made for Linux. There was a problem loading libraries with root. The CLHEP library could not be found because it did not in LC_ID_DYLIB. Patching the CLHEP CMakeLists.txt fixed this problem and the dictionary libraries load with no error. Can Spack build Art on OSX? 14

I have built the larsoftobj packages nusimdata, larcoreobj, lardataobj and larsimobj. The rest of larsoft can be built once I can build the packages that the rest of larsoft depends on built. Can Spack be used to build LArSoft? 15

Need to set up an interactive development environment. This is where SpackDev comes in. SpackDev –Thin layer atop Spack for building sets of dependent packages –Locates dependencies –Builds all dependent packages If A->B->C and A->C and I modify C, A and B will be rebuilt –Transparent – all SpackDev commands written to file –SpackDev command files can be reviewed and executed separately –There to help you but not required. You can run the cmake commands yourself in the build environment spack sets up. –Build Cmake packages and non-Cmake packages –Cmake with or without (modified) cetbuildtools SpackDev 16

I have built canvas, art and larsoftobj packages using spack. Spack fills the needs for a new build system. Features like relocate-able binary installs are being worked on. SpackDev, an interactive development environment setup script based on Spack is being worked on. Conclusions 17