How to install and build an application. Giuliana Milluzzo INFN-LNS

Similar documents
Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 10.1.p02)

How to install and build an application

How to install and build an application

How to install and build an application

8 Novembre How to install

XIV Seminar on Software for Nuclear, Subnuclear and Applied Physics Alghero (ITALY) June Geant4 Installation.

Simulation Techniques Using Geant4

Software Installation, release 5.2

Geant4 Installation Guide

CPPsim User Guide. Table of Contents Page 2 Installation Guide Page 10 Computer Setup Page 13 Running CPPsim Page 15 Possible Future Issues

GUT. GUT Installation Guide

GUT. GUT Installation Guide

Upgrading your GEANT4 Installation

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Perl and R Scripting for Biologists

R- installation and adminstration under Linux for dummie

Introduction of Linux

Open CASCADE Technology. Building OCCT with WOK CONTENTS

Install and Configure wxwidgets on Ubuntu

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Ubuntu Install Instructions Macbook Pro >>>CLICK HERE<<<

Build a Geant4 application

Applied Informatics POCO PRO C++ Frameworks

musrsim and musrsimana tools for

The build2 Toolchain Installation and Upgrade

CSC BioWeek 2018: Using Taito cluster for high throughput data analysis

cgatools Installation Guide

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

CSC BioWeek 2016: Using Taito cluster for high throughput data analysis

Exercise 1: Basic Tools

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Geant4: A Simulation toolkit

CSE 390a Lecture 1. introduction to Linux/Unix environment

Android Studio Setup Procedure

Unit 13. Linux Operating System Debugging Programs

Introduction to Shell Scripting

Opera Web Browser Archive - FTP Site Statistics. Top 20 Directories Sorted by Disk Space

Python Programming Exercises 1

HEP Software Installation

CS 261 Recitation 1 Compiling C on UNIX

CSE 391 Lecture 1. introduction to Linux/Unix environment

Introduction to Linux. Fundamentals of Computer Science

Transitioning from Spread 3.17.x to Spread 4.0

TrinityCore Documentation

First, let's make sure we have all of the starter code downloaded. MAC (Go to the second part of the tutorial if you are using windows)

MRCP. Installation Manual. Developer Guide. Powered by Universal Speech Solutions LLC

Installing Geant4 v9.5 for Windows

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

EE458 - Embedded Systems Lecture 2 RTEMS Installation

Communications Library Manual

Introduction to Linux

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Apple Llvm 5.1 Error Exit Code 1.0

Chap2: Operating-System Structures

Building Allegro 5 Library using TDM-GCC and CMake

Introduction to Unix and Linux. Workshop 1: Directories and Files

Introduction to Linux

Setting up an SDK for Secondo

(Graphical) User Interface 1

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Visualization Plugin for ParaView

Lecture 2. Software Development on Linux Platforms (Cygwin( Cygwin,, etc.) INTRODUCTION TO DESIGN AUTOMATION. Guoyong Shi, PhD

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

BUILDING AND LEVERAGING A CROSS PLATFORM VFX/ ANIMATION DEVELOPMENT ENVIRONMENT. by Colin Doncaster ( )

CSE 391 Lecture 1. introduction to Linux/Unix environment

Introduction to Linux

PatternFinder is a tool that finds non-overlapping or overlapping patterns in any input sequence.

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

CS197U: A Hands on Introduction to Unix

LetItB Installation Manual. Okinawa Institute of Science and Technology Neural Computation Unit

Zephyr Kernel Installation & Setup Manual

User Manual. 1. Open pjsip-apps/build/wince-evc4/wince_demos.vcw EVC4 workspace, 2. Build the pjsua_wince application.

Using Commands. Introduction to Unix. May 24, 2008 Rabat, Morocco. Hervey Allen

How to build MPTK with CMake SUMMARY

MathCode Fortran90 installation instructions for MacOSX machines and license administration. Version 1.2.4, April 6, 2011.

CMPT 300. Operating Systems. Brief Intro to UNIX and C

Building and Installing QGIS

Introducing LCG Views. Pere Mato LIM Meeting, 16th January 2016

Science One CS : Getting Started

Introduction to Supercomputing

LabVIEW Application Builder User Guide

Unit 10. Linux Operating System

Upgrading Your Geant4 Release

Computer Systems and Architecture

Mac Os X The Missing Manual For Pc Emulator

Drupal Command Line Instructions Windows 7 List All Files >>>CLICK HERE<<<

Working with Basic Linux. Daniel Balagué

QPKG Debian6 V (Beta)

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

Overview of the UNIX File System

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

COP 3014: Spring 2018 A Guide to Using CLion

Modern C++ for Computer Vision and Image Processing. Igor Bogoslavskyi and Cyrill Stachniss

Lab #3 Automating Installation & Introduction to Make Due in Lab, September 15, 2004

1. Make sure you have home-brew installed. brew.sh

Unix Tools / Command Line

Linux Essentials Objectives Topics:

Application Management

Session 1: Accessing MUGrid and Command Line Basics

Transcription:

How to install and build an application Giuliana Milluzzo INFN-LNS

Outline Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 10) Using Cmake, on Linux Building a Geant4 application with CMake Example of a Geant4 application CLHEP full version installation (optional) 2

Supported platforms & compilers Linux systems Scientific Linux CERN 6 with gcc 4.7.X, 64 bit Geant4 has also been successfully compiled on other Linux distributions, including Debian, Ubuntu and opensuse (not officially supported) MacOSX systems Mac OS X 10.8 (Lion with clang 3.3), 64bit Geant4 has also been successfully compiled on Mac OS X 10.7 (Lion) with clang 3.1 (Apple), and MacOS X 10.9 (Mavericks) with clang 2.79 (not officially supported) Windows systems Windows 7 with Visual Studio 11 (VS2010). Check current Geant4 supported platforms in http://geant4.web.cern.ch/geant4/ 3

Required software The Geant4 toolkit source code (10.00) C++ compiler It is usually installed on your Linux. If not, you need to install it (not shown here) CMake 2.6.4 or higher for clang, Cmake 2.8.2 or higher is required CLHEP library an internal version is now supplied with the geant4 source (since 9.5 version) The Geant4 data files an automatic procedure can retrieve them (with CMake) 4

External software packages Suggested tools (optional): X11 OpenGL Visualization (Linux and Mac OS X) Requires: X11, OpenGL or MesaGL (headers and libraries). Qt User Interface and Visualization (All Platforms) Requires: Qt4, OpenGL or MesaGL (headers and libraries). Motif User Interface and Visualization (Linux and Mac) Requires: Motif and X11, OpenGL or MesaGL headers and libraries. Open Inventor Visualization (All Platforms) X11 RayTracer Visualization (Linux and Mac OS X) DAWN postscript renderer HepRApp Browser VRML browser WIRED4 JAS Plug-In GDML Support (All Platforms) AIDA (Abstract Interface for Data Analysis) 5

Where to download the packages Geant4 CLHEP http://geant4.cern.ch/support/download.shtml http://proj-clhep.web.cern.ch 6

Downloading Geant4 and data files Geant4 source or pre-compiled libraries Data files will be automatically downloaded at the installation phase http://geant4.cern.ch/support/download.shtml 7

Geant4 installation (10.0 version) Working area & installation area Why two different areas? To allow centralized installation of the Geant4 kernel libraries and related sources in a multi-user environment To decouple user-developed code and applications from the kernel To allow an easy integration of the Geant4 software in an existing software framework Two ways to proceed: Manually installing by env variables (deprecated) Using CMake (recommended and officially supported) 8

Installing Geant4 with CMake 9

CMake installation (if not provided) CMake: Cross-Platform Makefile Generator Depending on the OS installation, CMake may not be installed by default. In that case you have to install it: On Linux: it is recommended to use the CMake provided by the package management system of your distribution. In case it does not meet the minimum version requirement: 1. download the latest version (http://www.cmake.org/) 2. unzip the tar-ball 3../bootstrap, make, make install On Mac: install it using the Darwin64 dmg installerpackage On Windows: install it using the Win32 exe installerpackage 10

Geant4 installation with CMake Unpack the geant4 source package geant4.10.00.tar.gz to a location of your choice: ex.: /path/to/geant4.10.00.p01 à source directory Create a directory in which to configure and run the build and store the build products (not inside the source dir!) ex.: /path/to/geant4.10.00.p01-build à build directory $ mkdir /path/to/geant4.10.00.p01-build $ ls geant4.10.00 geant4.10.00.p01-build To configure, change into the build directory and run CMake: $ cd /path/to/geant4.10.00.p01-build $ cmake DCMAKE_INSTALL_PREFIX=/path/to/geant4.10.00.p01-install /path/to/geant4.10.00.p01 CMAKE_INSTALL_PREFIX option is used to set the install directory The second argument to CMake is the path to the source directory. 11

Geant4 installation with CMake CMake configures the build and generates Unix Makefiles to perform the actual build: check the messages output by CMake If you see that, you are successful!!! If you see errors at this point, carefully check the messages output by CMake 12

Geant4 installation with CMake After the configuration has run, CMake have generated Unix Makefiles for building Geant4. To run the build, simply execute make in the build directory: where N is the number of parallel jobs you require. The build will now run, and will output a progress report When build has completed, you can install Geant4 to the directory you specified earlier in CMAKE_INSTALL_PREFIX by running: 13

Geant4 installation with CMake Additional arguments can be passed to CMake to activate optional components of Geant4 (standard and advanced options): -DGEANT4_INSTALL_DATA=ON (recommended) the additional external data libraries are automatically downloaded -DGEANT4_USE_OPENGL_X11=ON (recommended) build the X11 OpenGL visualization driver -DGEANT4_BUILD_MULTITHREADED=ON (recommended) build Geant4 libraries with support for multithreading -DGEANT4_USE_QT=ON (optional, but nice!!!) build the Qt visualization driver -DQT_QMAKE_EXECUTABLE= <path to the qmake executable> 14

Geant4 installation with CMake If you want to activate additional options, simply rerun CMake in the build directory, passing it the extra options: $ cd /path/to/geant4.10.00.p01-build $ cmake DGEANT4_INSTALL_DATA=ON /path/to/geant4.10.00.p01 If you want to deactivate a previously selected option: $ cmake DCMAKE_INSTALL_PREFIX=/path/to/geant4.10.00.p01-install DGEANT4_USE_GDML=OFF /path/to/geant4.10.00.p01 You may also directly include the options since the beginning: cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4.10.00.p01-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON /path/to/geant4.10.00.p01 15

Geant4 installation with CMake The install of Geant4 is contained under the directory chosen (CMAKE_INSTALL_PREFIX), with the following structure: To make the Geant4 binaries and libraries available on your PATH and LIBRARY PATH and to set the variables for external data libraries: N.B.: each time you open a new shell remember to source the geant4.sh script before executing an application!!! Alternatively, you may use the geant4make.sh (.csh) script to compile applications with GNUmakefile (deprecated G4.10) 16

Building an application with CMake 17

Building an application with cmake First step: create a folder into your $HOME (ex. geant4-exercises) $ mkdir geant4-exercises Second step: copy in the geant4-exercises folder one of the Geant4 examples, ex: the B1 example contained in the source folder $ cp -r /usr/local/geant4/geant4.10.00.p01/examples/ basic/b1 $HOME Third step: create a build directory for the specific application (suggestion: build that alongside the application source directory): 18

Building an application with cmake Change to this build directory and run cmake to generate the Makefiles needed to build the B1 application. Pass cmake two arguments: $ cd $HOME/B1-build $ cmake DGeant4_DIR=/path/to/geant4.10.00.p01-install/lib64/ Geant4-10.0.1 $HOME/B1 cmake will now run to configure the build and generate Makefiles.: 19

Building an application with cmake The following files have been generated: Once the Makefile is available we can do: The following output should be displayed: 20

Building an application with cmake List again the content of the build directory, you see the executable: Run the application, simply with./exampleb1, the following output should be displayed: And that s all!!! If you don't want any UI or Visualization, you could rerun CMake as: $ cmake DWITH_GEANT4_UIVIS=OFF DGeant4_DIR=/path/to/ geant4.10.00.p01-intall/lib64/geant4-10.0.1 $HOME/B1 21

22 Building an application with cmake For further details have a look at the Installation guide:

A Geant4 application 23

A Geant4 application Geant4 is a toolkit: no main program User is responsible of building an application Increased flexibility, but...... more work to be done

A Geant4 application

A Geant4 application

A Geant4 application

A Geant4 application

A Geant4 application

Thanks for your attention

Installing CLHEP full version (optional) 31

Create a directory for the installation procedure (ex.:clhep) Move the downloaded tar-ball into this directory Unzip the extract tar-ball into this directory 32

The extracted CLHEP package can be found in the subdirectory 2.0.3.2/CLHEP. Have a look at the content: Have a look in the INSTALL file: It contains more details on the installation procedure Create two directories (inside our clhep directory), which are used for building and installing the package: NOTE: The package will be finally installed in the directory ~/clhep/install 33

Inside the build directory, call the CLHEP configure script (which is contained in the 2.0.3.2/CLHEP directory). NOTE: As argument you need to specify the directory, where CLHEP should be installed. Thus the full command to be called is:../2.0.3.2/clhep/configure --prefix=/home/geant4- tutorial/clhep/install Adapt prefix path according to your own installation directory! The configure script checks for required programs and libraries,and creates some files, e.g. makefiles, and directories: 34

If no error occured in the configure process, one can start to build the CLHEP package using the make command: This may take a while... Only the initial and last output messages of the make command are shown Compiling was successful if make does not exit with error messages... 35

Once the package was compiled successfully, CLHEP can be installed using the make install command: The CLHEP libraries are now installed in the directory ~/clhep/ install (NOTE: We specified the installation directory in the configure process; see the previous slides) Congratulations! 36

What do the subdirectories in ~/clhep/install contain? include: Contains (in a defined directory tree structure) the C++ header files of CLHEP lib: Contains the (static and shared) CLHEP libraries bin: Contains configure scripts Finally, to save some disk space, you can remove the build directory, as well as the tar-ball and the source package 37