Skip to content

Commit

Permalink
adds makefile and updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
vagmcs committed Aug 27, 2022
1 parent c8d3bcb commit c751529
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 21 deletions.
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
SHELL:=/usr/bin/env bash -euo pipefail -c
.DEFAULT_GOAL := help

CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

### help : Prints usage information
.PHONY: help
help:
@echo "Makefile usage:"
@echo ""
@sed -n 's/^###//p' < $(CURRENT_DIR)/Makefile | sort

### format : Format code
.PHONY: format
format:
@sbt scalafmt

### test : Test project
.PHONY: test
test:
@sbt test

### build : Clean, build and test project
.PHONY: build
build:
@sbt rebuild

### release : Creates a release
.PHONY: release
deploy: build
@sbt +publishSigned
@sbt sonatypeReleaseAll
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you a

## How to get Optimus

Optimus is published to Maven Central for Scala 2.12 and 2.13.
Optimus is published to Maven Central for Scala 2.12, 2.13 and 3.1.3!

Add the following dependencies to your SBT build file in order to get started:

```scala
libraryDependencies ++= Seq(
"com.github.vagmcs" %% "optimus" % "3.4.2",
"com.github.vagmcs" %% "optimus-solver-oj" % "3.4.2",
"com.github.vagmcs" %% "optimus-solver-lp" % "3.4.2"
"com.github.vagmcs" %% "optimus" % "3.4.3",
"com.github.vagmcs" %% "optimus-solver-oj" % "3.4.3",
"com.github.vagmcs" %% "optimus-solver-lp" % "3.4.3"
)
```

Optionally, you can also add the following extra dependencies for proprietary solvers:

```scala
"com.github.vagmcs" %% "optimus-solver-gurobi" % "3.4.2"
"com.github.vagmcs" %% "optimus-solver-mosek" % "3.4.2"
"com.github.vagmcs" %% "optimus-solver-gurobi" % "3.4.3"
"com.github.vagmcs" %% "optimus-solver-mosek" % "3.4.3"
```

For more information see [Building and Linking](docs/building_and_linking.md)
Expand Down
57 changes: 42 additions & 15 deletions docs/building_and_linking.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building and Linking Optimus

Optimus is builds for Scala 2.12 and 2.13. In order to build Optimus modules (`core`, `solver-oj`, `solver-lp`, `solver-gurobi`, `solver-mosek`) from source you need to have Java 8 or higher and [SBT](http://www.scala-sbt.org/) installed in your system. Optimus build optionally depends on [Gurobi](http://www.gurobi.com/) and [Mosek](https://www.mosek.com/) solvers. In case the dependencies for Gurobi or Mosek are not included, Optimus would build a minimal version having only lp solve and oj solver.
Optimus is builds for Scala 2.12, 2.13 and 3. In order to build Optimus modules (`core`, `solver-oj`, `solver-lp`, `solver-gurobi`, `solver-mosek`) from source you need to have Java 8 or higher and [SBT](http://www.scala-sbt.org/) installed in your system. Optimus build optionally depends on [Gurobi](http://www.gurobi.com/) and [Mosek](https://www.mosek.com/) solvers. In case the dependencies for Gurobi or Mosek are not included, Optimus would build a minimal version having only lp solve and oj solver.

## Instructions to build Optimus from source

Expand Down Expand Up @@ -103,19 +103,19 @@ $ sbt +publishLocal

## Usage of Optimus through Maven Central

Optimus is published into the Maven Central. In order to link Optimus `core` module (e.g., version 3.4.2) to your [SBT](http://www.scala-sbt.org/) project, add the following dependency:
Optimus is published into the Maven Central. In order to link Optimus `core` module (e.g., version 3.4.3) to your [SBT](http://www.scala-sbt.org/) project, add the following dependency:

```scala
libraryDependencies += "com.github.vagmcs" %% "optimus" % "3.4.2"
libraryDependencies += "com.github.vagmcs" %% "optimus" % "3.4.3"
```

Moreover, you can link your project to each solver module that you additionally require by adding some or all of the following dependencies:

```scala
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-oj" % "3.4.2"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-lp" % "3.4.2"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-gurobi" % "3.4.2"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-mosek" % "3.4.2"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-oj" % "3.4.3"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-lp" % "3.4.3"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-gurobi" % "3.4.3"
libraryDependencies += "com.github.vagmcs" %% "optimus-solver-mosek" % "3.4.3"
```

Likewise in an [Apache Maven](https://maven.apache.org/) pom XML file add:
Expand All @@ -125,22 +125,22 @@ Likewise in an [Apache Maven](https://maven.apache.org/) pom XML file add:
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus_2.12</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-oj_2.12</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-lp_2.12</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-gurobi_2.12</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
</dependencies>
```
Expand All @@ -152,22 +152,49 @@ or
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus_2.13</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-oj_2.13</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-lp_2.13</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-gurobi_2.13</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
</dependency>
</dependencies>
```

or

```xml
<dependencies>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus_3</artifactId>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-oj_3</artifactId>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-lp_3</artifactId>
<version>3.4.3</version>
</dependency>
<dependency>
<groupId>com.github.vagmcs</groupId>
<artifactId>optimus-solver-gurobi_3</artifactId>
<version>3.4.3</version>
</dependency>
</dependencies>
```

0 comments on commit c751529

Please sign in to comment.