-
Notifications
You must be signed in to change notification settings - Fork 16
Getting started API
There are two ways to acquire PowerAPI: With or without Maven repositories. In other words, directly from Maven repositories (to get stable or snapshot versions), or from our Git repository (to get the source code).
Stable versions are available from the Maven central repository.
Snapshot versions are available from the OSS Sonatype repository. Thus, you have to add this following repository location:
- pom.xml
<repository>
<id>OSS Sonatype snapshot repository</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
- build.sbt
resolvers ++= Seq(
"OSS Sonatype snapshot repository" at "https://oss.sonatype.org/content/repositories/snapshots"
)
Without Maven repositories, you have to deal with our Git repository as explain below:
To acquire PowerAPI, simply clone it via your Git client:
git clone git://github.com/Spirals-Team/powerapi
As PowerAPI is a sbt managed project, you have to launch the publishLocal
command at the root directory (here, POWERAPI_DIR
) in order to compile and install it to your local machine.
To be able to use the metrics from the hardware counters, PowerAPI has to be installed and used as a root user.
cd $POWERAPI_DIR
sudo sbt publishLocal
You can use PowerAPI as a Jar project in your pom.xml
or build.sbt
file by adding these following lines:
- pom.xml
<dependency>
<groupId>org.powerapi</groupId>
<artifactId>powerapi-core_2.11</artifactId>
<version>4.0</version>
</dependency>
- build.sbt
libraryDependencies += "org.powerapi" % "powerapi-core_2.11" % "4.0"
Do not forget to configure correctly the modules (see here on how to configure a module).