17
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 Interface Definition Language (SIDL) and compiler developed by the LLNL Babel team

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

Embed Size (px)

Citation preview

Page 1: 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

Getting Started with SIDL using the ANL SIDL Environment (ASE)

ANL SIDL TeamMCS Division, ANL

April 2003The ANL SIDL compilers are based on the Scientific Interface Definition Language (SIDL) and compiler developed by the

LLNL Babel team

Page 2: 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

Scientific Interface Definition Language

A language independent way of defining calling sequences for scientific software libraries

Allows calling libraries from and writing libraries with any language

Supports C++, Fortran90, Python, Matlab, Mathematica, C, F77,….

Developed by the components team at LLNL

Page 3: 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

SIDL Compiler

A system that generates all the code needed to call SIDL libraries from a particular programming language

In general, each programming language has its own SIDL compiler

The ANL compiler is defined using SIDL and written in Python

Page 4: 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

SIDL Environment

A system for Running the SIDL compiler Managing all the generated code Compiling (ie. C++,F90) the generated code Building the appropriate libraries Locating and loading libraries at runtime

The ANL enviroment is called BuildSystem

Page 5: 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

ANL SIDL Environment Requirements

Python 2.2 (or later) – A powerful, portable scripting programming language

BitKeeper – A freely available software revision control system

(Windows only) – The freely available Cygwin Unix emulation tools

A C++ compiler

Page 6: 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

Installing the ANL SIDL Environment

www.mcs.anl.gov/sidl Download bootstrap.sh python bootstrap.sh Run BuildSystem/install/gui.py to

install additional SIDL language compilers and other SIDL scientific software libraries

Page 7: 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

The rest of the slides provide more details on the ANL SIDL Environment and how it worksThey need to be revised

Page 8: 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

Basic Installation Install Bitkeeper Execute Bootstrap

Install BuildSystem Install Compiler and Runtime

Install SIDL Example (Optional) Install Regression

Page 9: 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

Setup Distribution Install Bitkeeper

http://www.bitkeeper.com Also provides version control Code organized into Projects

Each is a Bitkeeper repository Can contain several SIDL files Registers in a database

Page 10: 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

Start Bootstrap Retrieve the Python script

http://www.mcs.anl.gov/sidl/bootstrap.sh bk://sidl.bkbits.net/BuildSystem/install/bootstrap.py

Execute the script Uses Bitkeeper to retrieve BuildSystem Constructs the initial SIDL Compiler and Runtime

Front Ends Interactive curses front end Noninteractive batch mode

Page 11: 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

BuildSystem Installed automatically by

Bootstrap Handles

Configuration Build (make) Argument database

bk://sidl.bkbits.net/BuildSystem

Page 12: 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

Build System Overview I Implemented in Python Replaces configure, make and RPM Uses md5 rather than timestamps Control flow explicitly constructed

User builds a DAG with node objects Packets flow along edges Nodes operate on packet contents

Page 13: 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

Build System Overview II Requirements for user make.py

Specify project name and URL Specify URLs for required projects

Usually SIDL Runtime is required Specify SIDL source Specify server languages

Arbitrary targets declared using t_foo()

Page 14: 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

SIDL Environment Compiler handles SIDL compilation Runtime handles

Dynamic loading Dynamic dispatch Reference counting

bk://sidl.bkbits.net/Runtime bk://sidl.bkbits.net/Compiler

Page 15: 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

Boilerplate User Make.pyimport userimport build.filesetimport build.frameworkimport projectimport sys

class PetscMake(build.framework.Framework): def __init__(self, clArgs = None, argDB = None): proj = project.Project(‘myProject’, ‘bk://me.bkbits.net/myProject’, self.getRoot()) build.framework.Framework.__init__(self, proj, clArgs, argDB) def t_getDependencies(self): return [‘bk://sidl.bkbits.net/Runtime’]

def setupProject(self): self.filesets[‘sidl’] = build.fileset.ExtensionFileSet(self.project.getRoot(), ‘.sidl’)

def setupBuild(self): self.sidlTemplate.addServer(‘Python’)if __name__ == ‘__main__’: PetscMake(sys.argv[1:]).main()

Page 16: 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

Setup SIDL Example Install SIDL Example

installer.py bk://sidl.bkbits.net/Example ./driver/python/helloWorld.py

Look at implementation code in server In server-<lang>-<sidl filename>

Try C++ driver ./make.py compilePrograms ./bin/helloWorldCxx

Page 17: 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

Setup SIDL Regression Tests Install Regression

installer.py bk://sidl.bkbits.net/Regression

./make.py runTests