Difficulties to install Oscar

82 views
Skip to first unread message

maxime...@univ-lille1.fr

unread,
Mar 1, 2017, 2:35:36 AM3/1/17
to OscaR
Hello,
 
I tried to install OscaR to use it in a sbt project.
I was unsuccessful. I have done the following steps.

0a. Install glpk lp_solve i.e.
brew tap homebrew/science
brew install lp_solve
brew install glpk
0b. Install gurobi7.0.2_mac64.pkg
1. Download oscarlib-oscar-2daaec79ae02
2. cd oscarlib-oscar-2daaec79ae02
3. sbt -Djava.library.path=lib/macos64/:/usr/local/lib/
4. project oscar-algebra
5. package
6. project oscar-linprog
7. package
8. copy oscar-algebra_2.11-3.1.0.jar and oscar-linprog_2.11-3.1.0.jar in MYPROJECT/lib/
9. Create a simple example

import oscar.linprog.modeling._
import oscar.linprog._
import oscar.algebra._
object TestLinProg {
  def main(args: Array[String]) {
    val lp = LPSolver()
    val mip =MIPSolver()
    val x0 = LPVar(lp,"x0",0,40) // can take value in continuous interval [0,40]
    val x1 = LPVar(lp,"x1",0, 1000)
    val x2 = LPVar(lp,"x2",0 ,17)
    val x3 = LPVar(lp,"x3",2,3)

    lp.maximize(x0+2*x1+3*x2+x3) subjectTo {
      lp.add(-1*x0 + x1 + x2 + 10*x3 <= 20)
      lp.add(x0 - 3.0*x1 + x2 <= 30)
      lp.add(x1 - 3.5*x3 == 0 )
    }
    println("objective"+lp.getObjectiveValue())
    println(x1.getValue())
  }


10. sbt -Djava.library.path=/usr/local/lib/
11. compile

I have the following error :
Compiling 1 Scala source to .../scala-2.11/classes...
[error] .../TestLinProg.scala:12: not found: value LPSolver
[error]     val lp = LPSolver()


Any idea ?


Thanks in advance for your help,


MM.

Pierre Schaus

unread,
Mar 2, 2017, 2:59:39 AM3/2/17
to oscar...@googlegroups.com
Dear Maxime,

Which version do you depend on in your SBT?
We will remove the linprog package from OscaR pretty soon.
As you seem to have a university affiliation, we advise you to use gurobi/cplex java api instread.
Best regards,

Pierre

--

---
You received this message because you are subscribed to the Google Groups "OscaR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscar-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maxime MORGE

unread,
Mar 2, 2017, 3:03:06 AM3/2/17
to oscar...@googlegroups.com
Dear Pierre,

Le 02/03/2017 à 08:59, Pierre Schaus a écrit :
> Which version do you depend on in your SBT?
0.13.9

> We will remove the linprog package from OscaR pretty soon.
> As you seem to have a university affiliation, we advise you to use
> gurobi/cplex java api instread.
I am currently work on it.

Best regards,

Maxime.
> send an email to oscar-user+...@googlegroups.com
> <mailto:oscar-user+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OscaR" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/oscar-user/qNd7aALDZyA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> oscar-user+...@googlegroups.com
> <mailto:oscar-user+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


--
Maxime...@univ-lille1.fr -- http://cristal.univ-lille.fr/~morge/
Responsable du parcours SIAD BIMST - FSES
Université de Lille 1 Sciences et Technologies
14A RdC - Bât M3 - Cité scientifique
F-59655 Villeneuve d'Ascq cédex
CRIStAL: +333 20 33 77 12 / FSES: +333 28 77 84 07
Fax: +333 28 77 85 37
Reply all
Reply to author
Forward
0 new messages