Learning Mana

This is what you have to do:

  1. Install hwaf (do this once and only once - subsequent hwaf updates can be done by 'updating hwaf')
  2. Install a mana release (do this whenever you want a new release)
  3. Create a folder and 'asetup' inside of it, with one of your installed releases (do this each time you start a new session)

Installing hwaf

hwaf is "the new cmt", but it does so much more. It will also be used to asetup and create new testareas and so on.

For a new user, easiest is to install go (golang.org) and then do:

go get github.com/hwaf/hwaf

The other thing you must do is add to your bash login or somewhere (so that it gets set up every time) the environment variable HWAF_SITEDIR, which will be the path where you install projects (a project is like an athena release. each mana release is a seperate waf project).

export HWAF_SITEDIR=/some/absolute/path

You can see what commands you have with

hwaf help

e.g. check your version with:

hwaf version

Updating hwaf

If Sebastien announces a new version of hwaf, you update like this (note: ideally you shouldn't need to do this as sudo, but this seems it may be necessary, at least for mac users. Yet to discover problem with this.):

hwaf self update

Then check you've got the new version with hwaf version. You do not need to do another hwaf self init.

  • N.B. If you're using OSX and have updated to a newer version, this might fail with e.g. panic: hwaf: unhandled distribution [darwin-10.9]. If so, you need to update with the following:
cd $GOPATH/src/github.com/hwaf/hwaf
git fetch --all
git checkout <some tag or branch>
go get .

Installing a project (i.e. a mana release)

Each mana release (and eventually athena releases) are a seperate waf project. The binaries for mana are found here. You can download and automatically install (installation happens automatically) the right binary for you like this:

cd $HWAF_SITEDIR
curl -L http://mana-fwk.web.cern.ch/mana-fwk/downloads/tar/SOME_BUILD_GOES_HERE.tar.gz | tar --strip-components=4 -zxf -

Note that you may see "Error exit delayed from previous error" at the end, but it seems safe to ignore this if the only printouts from above were about "ignoring" various stuff.

Creating a new testarea

A testarea can be anywhere you want. Just make a directory and cd to it. Then you use hwaf asetup mana [release] to setup that testarea and your environment (e.g. the $TestArea environment variable etc) with the mana build of your choice. e.g. (after I installed the 20130206 release for darwin on my mac):

mkdir work
cd work
hwaf asetup mana 20130206

To check everything worked, "show" the setup:

hwaf show setup

This gave me:

workarea=/Users/wbuttinger/phyhome/mana/work
cmtcfg=x86_64-darwin106-gcc42-opt
projects=/Users/wbuttinger/phyhome/mana/opt/sw/mana/mana-core/20130206/x86_64-darwin106-gcc42-opt

Basically what we've done is set up a testarea (which is actually a new waf project) and told it which project we want to use. Contrary to cmt-athena, you don't need to call hwaf asetup ... when you start a new terminal/session (except if you want to change the project or project-version to use.) To see this, start a new terminal, cd to your testarea, and then type hwaf show setup again, and you should see the same thing as above (if you don't, things have gone wrong, check you have the $HWAF_SITEDIR env var set)

Checking out code

Use the hwaf pkg co command, to see examples of how to use it, type: hwaf pkg help co. E.g. I can do:

hwaf pkg co PhysicsAnalysis/AnalysisCam/AnalysisCamEvent

You can see what packages you have checked out with:

hwaf pkg ls

If you want to delete a package, you should use the hwaf pkg rm command. If you delete the package with a normal rm, then you'll still need to do the hwaf pkg rm to clean up things correctly.

So where did the package go? It goes into the src folder under your testarea (this folder will be created for you. you'll also find a wscript is created, which you can ignore for now).

When you checkout a new package, or change a package's dependencies (i.e. play around with the wscript file of the package), you need to "configure" the workarea again:

hwaf configure
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2013-11-20 - EdwardMoyse
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback