Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools.

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.
C Programming; a review
LING 581: Advanced Computational Linguistics Lecture Notes March 29th.
Embedded Systems Programming Introduction to cross development techniques.
1 UQC122S3 Real-Time and Embedded Systems GCC as a cross compiler.
Selecting a Cross Development Environment. Why do you need to select a CDE? Through out your career the target systems will change rapidly –Both the h/w.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
13-Jul-15Advanced Programming Spring 2002 autoconf Jonathan Lennox Department of Computer Science Columbia University.
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.
Building a Cross Compiler, Assembler and Linker Designed by Prof. Peng-Sheng Chen.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Introduction Purpose This training course introduces the free GNU tools that can be used for debugging embedded system application software in the Renesas.
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.
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.
Software Engineering in Robotics Packaging and Deployment of Systems Henrik I. Christensen –
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
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.
How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET.
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.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
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.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
22-24 Feb 05 Workshop DKRZ / M&D Stephanie Legutke Introduction to the Standard Compile Environment (SCE) of the Integrated Model & Data Infrastructure.
GLite build and integration system Building and Packaging Robert HARAKALY
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.
Build Systems Margolin Alex 2/4/09 Includes part of ”Using GNU Autotools” by Alexandre Duret-Lutz.
김민수 Cortex-M4 Processor - Getting Started with the GNU Compiler Collection(gcc)
Introduction to SimpleScalar Tool Set CPEG323 Tutorial Long Chen September, 2005.
Wed Mar Michael Imamura / The GNU Autotools Your very own./configure.
The World Leader in High Performance Signal Processing Solutions Toolchain Basics.
CLHEP Infrastructure Improvements CHEP 2004 Lynn Garren, FNAL and Andreas Pfeiffer, CERN.
Lecture 6 UNIX Development Tools. Software Development Tools.
RTLAB Kang. Moo jin Using Open Source Tools for AT91SAM7X Cross Development.
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
Software development tools
Linux Development Tools Presented by: Lisha Sterling Creating programs in Linux for Linux and the rest of the world...
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.
Autoconf, Automake, and Libtool Tom Tromey. Copyright ● Copyright 2006 Tom Tromey ● Parts Copyright 2006 Alexandre Duret-Lutz ●
Multiple file project management & Makefile
COM S 326X Deep C Programming for the 21st Century Prof. Rozier
CSE 303 Lecture 17 Makefiles reading: Programming in C Ch. 15
Software Package development and management
Brief Intro to Make CST494/ Gannod.
CDT Build/Run/Debug in Container
The GNU Autotools: autoconf, automake, (libtool)
ns-3 Waf build system ns-3 Annual Meeting June 2017
Software Installation
Overview Unit testing Building Version control.
Appendix F C Programming Environment on UNIX Systems
Software Installation, release 4.0
Preparation for Assignment 2
SPL – PS1 Introduction to C++.
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.
Presentation transcript:

Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools – autoconf – automake – libtool ● Prerequisites – Tools

Developing Portable Applications ● GNU toolchain – GNU make – GCC – GNU binutils (linker, assembler, library tools) – GNU debugger – GNU autotools

Developing Portable Applications ● What GNU autotools are for ? ● What GNU autotools are not for ? ● When to use GNU autotools ? ● When not to use GNU autotools ?

Developing Portable Applications ● Source distribution *.tar.gz ● Build from sources ● Steps in building programs: – configuration step – building step – Makefiles generated on the target machine.

Developing Portable Applications ● Tools (developer) – (GNU autotools) – autoconf package – automake package – libtool package ● Tools (installer) – Standard shell + common utilities (grep, sed,...) – C/C++ compiler – Perl (required by automake) – make utility

Developing Portable Applications ● Supported operating systems – GNU/Linux – Variants of Unices. – MAC/OS – Windows (with Cygwin support) – Other Posix compliant OSs' (OpenVMS)

Developing Portable Applications ● Supported languages – C/C++ – Fortran77/90 – Objective C – Ada – Erlang – Python – Java (limited)

Developing Portable Applications ● Installing GNU autotools – Download ● autoconf ● automake ● libtool from – tar.gz files – Unpack –./configure && make && make install

Developing Portable Applications ● Versions – GNU autoconf 2.61 – GNU automake 1.10 – GNU libtool – GNU m

Developing Portable Applications ● Installation example –./configure (with optional arguments) – make – make all – make check – make install – make dist – make distcheck – make clean

Developing Portable Applications ● Commonly used configure options: –./configure –help –./configure --prefix=/home/space ● Configure destination directories – /usr/local/bin – /usr/local/lib – /usr/local/include – /usr/local/man ● --prefix -> /usr/local

Developing Portable Applications ● Enabling or disabling package features. – --with-package – --without-package – –enable-feature – --disable-feature ● Passing environment variables – Example, export CFLAGS=-g (bash) ●./configure –disable- ●./configure --enable-debug=full

Developing Portable Applications ● Source directory structure – Shallow structure – Deep structure ● Organising project in sub-directories. ● src ● lib ● include ● doc

Developing Portable Applications ● Minimal files – in top level directory. – README – INSTALL – AUTHORS – NEWS – ChangeLog

Developing Portable Applications ● Version numbers – Major number – Minor number – A third number for unofficial releases. ● Example: – tar-1.16 – glpi

Developing Portable Applications ● Basic input files: – configure.ac (or configure.in) – Makefile.am

Developing Portable Applications ● Contents of distribution (in addition to the source files) – config.h.in – Makefile.in – aclocal.m4

Developing Portable Applications ● Example: – shmem_s.c – shmem_c.c

Developing Portable Applications ● Configuration steps – aclocal – autoheader – autoconf – libtoolize – automake

Developing Portable Applications ● Process flow

Developing Portable Applications ● aclocal

Developing Portable Applications ● autoheader

Developing Portable Applications ● Files generated by configure script. – config.cache – config.status – config.log – config.h – Makefile

Developing Portable Applications ● Note: – Only one configure.in at top level directory. – One Makefile.am for each subdirectory. – autoreconf program OR the following script. ● #/bin/sh ● rm -f config.cache ● aclocal ● autoconf ● autoheader ● libtoolize -c –force ● automake -a

Developing Portable Applications ● Order of invoking macros in configure.ac – AC_INIT – AC_CONFIG_HEADERS – Check for programs – Check for libraries – Check for header files – Check for types/structures – Check for compiler characteristics – Check for library functions – Check for system services – AC_CONFIG_FILES – AC_OUTPUT

Developing Portable Applications ● Automake variables – prefix_primary – Common prefixes (w.r.t /usr/local - default) ● bin_ ● sbin_ ● lib_ ● noinst_ ● EXTRA_ ● check_

Developing Portable Applications ● Common primaries – _PROGRAMS – _LIBRARIES – _SCRIPTS – _HEADERS – _OBJECTS – _DATA – _LDADD

Developing Portable Applications ● Portability considerations – Shell scripts ● It is easier to write portable shell than writing a portable shell script. – Larry Wall – Compiler characteristics – Library functions – System calls

Developing Portable Applications ● Top level directory – configure.ac – Makefile.am ● Sub-directories – Makefile.am

Developing Portable Applications ● Defining user macros in configure.ac ● AC_DEFUN[MACRO_NAME, MACRO_BODY] – dnl Make an uppercase version of a given name – AC_DEFUN([NC_UPPERCASE], – [changequote(,)dnl – $2=`echo $1 |tr '[a-z]' '[A-Z]'` – changequote([,])dnl – ])dnl

Developing Portable Applications ● Makefile basics – Specifies the dependencies on how the target is to be built. – Dependencies may be nested. – Format: ● target:.... ● commands – Timestamps.

Developing Portable Applications ● VPATH build. – Building for more than one architecture.

Developing Portable Applications ● Shared library basics – Static vs shared library – Advantages – Object/executable formats – Library names and version numbering. – Symbolic links – Special gcc flags $(CCFLAGS) – $(LDFLAGS) – -$(LIBS)

Developing Portable Applications ● Static linking,runtime linking,dynamic linking ● ld ● LD_LIBRARY_PATH ● ld.so.conf, ld.so.cache ● ld.linux.so ● dlopen() ● dlsym() ● dlclose()

Developing Portable Applications ● Some useful library related commands: – nm – objdump – readelf – ar – ranlib – ldd

Developing Portable Applications ● GNU autotools and cross compilation. ● Linux Standard Base – binary compatibility