# Setting environment variables for a package "SCIP"

**URL:** <https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839>\
**Category:** Optimization (Mathematical)\
**Created:** [July 28, 2020, 9:12pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839 "2020-07-28T21:12:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 28, 2020, 9:12pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/1 "2020-07-28T21:12:45Z")

</div>

hello there,

I need to set the environment variable for SCIP package  
I am wokring on windows 10…so I opened:  
Advanced system Settings…Advanced…Environment Variables  
I created a new variable and added the path as:  
C:\Program Files\SCIPOptSuite 7.0.1\bin\libscip.dll  
but building the package after that in Julia says that the environment variable SCIPOPTDIR needs to be set

```julia
Error: Error building `SCIP`: 
│ ERROR: LoadError: AssertionError: Environment variable `SCIPOPTDIR` not set!

```

What can be the problem ?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 28, 2020, 9:51pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/2 "2020-07-28T21:51:31Z")

</div>

You need to exit Julia and restart it for the new environment variables to take effect.

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 29, 2020, 4:55am UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/3 "2020-07-29T04:55:06Z")

</div>

I thought I am adding the extension for the wrong file… which file exactly do I need to add its path ?  
With what extension is this file ? @odow

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 29, 2020, 9:53am UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/4 "2020-07-29T09:53:56Z")

</div>

I have so many folders in the installation path with different extensions…like  
.dll and .lib  
so which of these should I point at its location?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 29, 2020, 3:07pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/5 "2020-07-29T15:07:31Z")

</div>

Try

```nohighlight
ENV["SCIPOPTDIR"] = "C:\\Program Files\\SCIPOptSuite 7.0.1"
] build SCIP

```

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 29, 2020, 6:52pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/6 "2020-07-29T18:52:44Z")

</div>

```julia
julia> ENV["SCIPOPTDIR"] = "C:\Program Files\SCIPOptSuite 7.0.1"
ERROR: syntax: invalid escape sequence

```

@odow

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 29, 2020, 7:53pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/7 "2020-07-29T19:53:41Z")

</div>

Please see the double backslash in my previous answer.

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 29, 2020, 8:19pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/8 "2020-07-29T20:19:49Z")

</div>

> [@odow](#):
>
> `ENV["SCIPOPTDIR"] = "C:\\Program Files\\SCIPOptSuite 7.0.1"`

```julia
Error: Error building `SCIP`: 
│ ERROR: LoadError: None of the selected providers can install dependency libcsip.
│ Use BinDeps.debug(package_name) to see available providers

```

Okay I edited it but I still get this 😢

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 29, 2020, 8:53pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/9 "2020-07-29T20:53:08Z")

</div>

What is the output of `] st`? You probably need SCIP.jl v0.9.5.

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 30, 2020, 8:35am UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/10 "2020-07-30T08:35:47Z")

</div>

@odow

I tried to install this version and it showed successful build

```julia
(@v1.4) pkg> add SCIP@v0.9.5

```

then I added the environment

```julia
ENV["SCIPOPTDIR"] = "C:\\Program Files\\SCIPOptSuite 7.0.1"

```

then I build the solver

```julia
(@v1.4) pkg> build SCIP@v0.9.5

```

It showed successful build

Now I am trying to use it

```julia
using SCIP
using JuMP

optimizer = SCIP.Optimizer()
MOI.set(optimizer, SCIP.Param("display/verblevel"), 0)
MOI.set(optimizer, SCIP.Param("limits/gap"), 0.05)
m = Model(with_optimizer(optimizer, print_level=0))`

```

but it does not work

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 30, 2020, 12:44pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/11 "2020-07-30T12:44:08Z")

</div>

The syntax is

```nohighlight
model = Model(SCIP.Optimizer)
set_optimizer_attribute(model, "display/verblevel", 0)
set_optimizer_attribute(model, "limits/gap", 0.05)

```

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 30, 2020, 1:30pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/12 "2020-07-30T13:30:45Z")

</div>

I tried it now and it worked…Thank you so much  
@odow

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 12:17pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/13 "2020-07-31T12:17:11Z")

</div>

Hello @odow , can you tell me what does that mean pls ?

```julia
LoadError: InitError: SCIP is installed at version 7.0.1, supported are 6.0.0 up to (including) 7.0.0.
during initialization of module SCIP
in expression starting at D:\M A S T E R S S S S S S\chapter_4\work\codes\a-SCIP\ML-scip.jl:1
error(::String) at error.jl:33
__init__ () at init.jl:16
_include_from_serialized(::String, ::Array{Any,1}) at loading.jl:697
_require_search_from_serialized(::Base.PkgId, ::String) at loading.jl:781
_require(::Base.PkgId) at loading.jl:1006
require(::Base.PkgId) at loading.jl:927
require(::Module, ::Symbol) at loading.jl:922

```

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 12:53pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/14 "2020-07-31T12:53:00Z")

</div>

The next time, I ran the program, The error changes to…

`LoadError: Unexpected quadratic expression 0 in nonlinear expression. Quadratic expressions (e.g., created using @expression) and nonlinear expressions cannot be mixed. in expression starting at D:\`

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 31, 2020, 3:26pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/15 "2020-07-31T15:26:34Z")

</div>

It looks like 7.0.1 was only recently released, and SCIP.jl hasn’t been released with support. But you can get something working with `] add SCIP#master`.

The second error is a JuMP message. Use `@NLexpression` instead of `@expression` when making nonlinear constraints. Here are the NLP docs for JuMP: [Nonlinear Modeling · JuMP](https://jump.dev/JuMP.jl/v0.21.1/nlp/).

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 3:28pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/16 "2020-07-31T15:28:46Z")

</div>

I will add the master now and tell you what happened  
I use a combination of both in fact  
NL expressions and expression  
Let me show it  
too

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [July 31, 2020, 3:36pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/17 "2020-07-31T15:36:10Z")

</div>

> I use a combination of both in fact

Yes, hence the error.

You cannot use `@expression` in the nonlinear macros `@NLxxx`. Use `@NLexpression` instead.

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 3:52pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/18 "2020-07-31T15:52:13Z")

</div>

Ok…I am trying now  
in 5 minutes, I will update you

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 4:02pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/19 "2020-07-31T16:02:08Z")

</div>

I added the master branch

but  
`m = Model(SCIP.Optimizer)`  
then this line returns an error

```julia
 Model not defined

```

---

<div class="post-metadata">

**Author:** ![mayar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mayar/32/16426_2.png) [@mayar](https://discourse.julialang.org/u/mayar)\
**Post date:** [July 31, 2020, 4:05pm UTC](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839/20 "2020-07-31T16:05:24Z")

</div>

I think…they need JuMP. before it

[Next page](https://discourse.julialang.org/t/setting-environment-variables-for-a-package-scip/43839.md?page=2)
