# Presentation: 285428

## 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](http://www.llnl.gov/CASC/components)_

## 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

## 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

## 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

## 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

## Installing the ANL SIDL Environment

- _[www.mcs.anl.gov/](http://www.mcs.anl.gov/sidl)__[sidl](http://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

## The rest of the slides provide more details on the ANL SIDL Environment and how it works

- They need to be revised

## Basic Installation

- Install Bitkeeper
- Execute Bootstrap
- Install BuildSystem
- Install Compiler and Runtime
- Install SIDL Example
- (Optional) Install Regression

## Setup Distribution

- Install Bitkeeper
- _[http://www.bitkeeper.com](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

## Start Bootstrap

- Retrieve the Python script
- _[http://www.mcs.anl.gov/](http://www.mcs.anl.gov/petsc/petsc-3/bootstrap.sh)__[sidl](http://www.mcs.anl.gov/petsc/petsc-3/bootstrap.sh)__[/bootstrap.sh](http://www.mcs.anl.gov/petsc/petsc-3/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

## BuildSystem

- Installed automatically by Bootstrap
- Handles
- Configuration
- Build (make)
- Argument database
- bk://sidl.bkbits.net/BuildSystem

## 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

## 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()

## SIDL Environment

- Compiler handles SIDL compilation
- Runtime handles
- Dynamic loading
- Dynamic dispatch
- Reference counting
- bk://sidl.bkbits.net/Runtime
- bk://sidl.bkbits.net/Compiler

## Boilerplate User Make.py

- import user
- import build.fileset
- import build.framework
- import project
- import 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()

## 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

## Setup SIDL Regression Tests

- Install Regression
- installer.py bk://sidl.bkbits.net/Regression
- ./make.py runTests