# Problem installing CPLEX.jl with CPLEX 22.1.1 on Mac OS

**URL:** https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967
**Category:** Optimization (Mathematical)
**Tags:** cplex
**Created:** [March 22, 2024, 12:59pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967 "2024-03-22T12:59:01Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)
#### Post date: [March 22, 2024, 12:59pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/1 "2024-03-22T12:59:02Z")

</div>

Hello

I just installed CPLEX 22.1.1

```julia
poss@Mac-de-Michael x86-64_osx % pwd
/Applications/CPLEX_Studio_Community2211/cplex/bin/x86-64_osx

```

In configured CPLEX\_STUDIO\_BINARIES as requested:

```julia
julia> ENV["CPLEX_STUDIO_BINARIES"]
"/Applications/CPLEX_Studio_Community2211/cplex/bin/x86-64_osx/"

```

Yet, the installation fails:

```julia
julia> Pkg.build("CPLEX")
    Building CPLEX → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/ac239474b90c8cea06e5595ac87b1235900f3044/build.log`
ERROR: Error building `CPLEX`: 
ERROR: LoadError: Unable to install CPLEX.jl.

The versions of CPLEX supported by CPLEX.jl are:

* 12.10
* 20.1
* 22.1 22.1.1

You must download and install one of these versions separately.

You should set the `CPLEX_STUDIO_BINARIES` environment variable to point to
the install location then try again. For example (updating the path to the
correct location):
...

```

Am I doing something wrong?

---

<div class="post-metadata">

### Author: ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)
#### Post date: [March 23, 2024, 10:54am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/2 "2024-03-23T10:54:28Z")

</div>

What is `ls lib` in that path?

Another quick check/fix is to rename  
Applications/CPLEX\_Studio\_Community2211  
To  
Applications/CPLEX\_Studio2211

---

<div class="post-metadata">

### Author: ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)
#### Post date: [March 23, 2024, 3:36pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/3 "2024-03-23T15:36:51Z")

</div>

> What is `ls lib` in that path?

```julia
poss@Mac-de-Michael x86-64_osx % ls lib
ls: lib: No such file or directory
poss@Mac-de-Michael x86-64_osx % ls
cplex cplexamp libcplex2211.dylib
cplex.log cpxchecklic

```

> Another quick check/fix is to rename  
> Applications/CPLEX\_Studio\_Community2211  
> To  
> Applications/CPLEX\_Studio2211

I renamed as suggested and adapted

```julia
ENV["CPLEX_STUDIO_BINARIES"] = "/Applications/CPLEX_Studio2211/cplex/bin/x86-64_osx/"

```

but get the same issue as before (same by adapting to CPLEX\_Studio221).

---

<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: [March 23, 2024, 10:46pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/4 "2024-03-23T22:46:29Z")

</div>

It looks like you have installed the `x86-64` (intel) version of CPLEX. I assume you have an M1 or M2 Mac? If so, you will also need to install the `x86-64` version of Julia: [Download Julia](https://julialang.org/downloads/)

Alternatively, download and install the aarch64 version of CPLEX.

---

<div class="post-metadata">

### Author: ![Sharara](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Sharara](https://discourse.julialang.org/u/Sharara)
#### Post date: [March 24, 2024, 7:36am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/5 "2024-03-24T07:36:04Z")

</div>

Hi Dears

I have the same problem which I could not solve during the last 2 weeks!  
I checked all possible conversations and methods,  
I did this link step-by-step:  
–jump-dev/CPLEX.jl#note-for-windows

then this topic:

> <https://github.com/jump-dev/CPLEX.jl/issues/214>
>
> Hello everyone. I need to get CPLEX in my Julia 0.6.4. I've already done everyth…ing that was mentioned in the previous issues. I have CPLEX optimizer installed on my computer but when I use "using CPLEX" I get this error:
> \`\`\`
> INFO: Precompiling module CPLEX.
> ERROR: LoadError: CPLEX not properly installed. Please run Pkg.build("CPLEX")
> Stacktrace:
> \[1\] error at .\\error.jl:21
> \[2\] include\_from\_node1 at .\\loading.jl:576
> \[3\] include at .\\sysimg.jl:14
> while loading C:\\Users\\ramin\\.julia\\v0.6\\CPLEX\\src\\CPLEX.jl, in expression starting on line 16
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> and then when I run Pkg.build("CPLEX") I get this error:
> INFO: Building CPLEX
> ================================\[ERROR: CPLEX \]================================
> 
> LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEX.jl README for further instructions.
> while loading C:\\Users\\ramin\\.julia\\v0.6\\CPLEX\\deps\\build.jl, in expression starting on line 69
> 
> ================================================================================
> 
> ================================\[BUILD ERRORS \]================================
> 
> WARNING: CPLEX had build errors.
> 
> - packages with build errors remain installed in C:\\Users\\ramin\\.julia\\v0.6
> - build the package(s) and all dependencies with \`Pkg.build("CPLEX")\`
> - build a single package by running its \`deps/build.jl\` script
> 
> ================================================================================
> \`\`\`
> Does anyone know how I can resolve this issue? I'm using windows 10, Julia 0.6.4, CPLEX 12.8.0 and Jupyter Notebook.
> Thank you.

Then the current topic,

I re-install Julia several times, I clean and install CPLEX several times,

(I am using Mac OSX M2)  
I install macOS x86 (Intel or Rosetta) and Cplex x86  
not worked,  
I installed macOS (Apple Silicon) and arm Cplex, but it did not work,  
I installed both of them, and none worked!!!

this is the Error I received in the Julia:

> **julia\>** ENV[“CPLEX\_STUDIO\_BINARIES”] = “/Applications/CPLEX\_Studio\_Community2211/cplex/bin/x86-64\_osx/libcplex2211.dylib”
> 
> “/Applications/CPLEX\_Studio\_Community2211/cplex/bin/x86-64\_osx/libcplex2211.dylib”
> 
> **julia\>** import Pkg
> 
> **julia\>** Pkg.add(“CPLEX”)
> 
> **Resolving** package versions…
> 
> **No Changes** to `~/.julia/environments/v1.10/Project.toml`
> 
> **No Changes** to `~/.julia/environments/v1.10/Manifest.toml`
> 
> **julia\>** Pkg.build(“CPLEX”)
> 
> **Building** CPLEX → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/ac239474b90c8cea06e5595ac87b1235900f3044/build.log`
> 
> **ERROR:** Error building `CPLEX`:
> 
> ERROR: LoadError: Unable to install CPLEX.jl.
> 
> The versions of CPLEX supported by CPLEX.jl are:
> 
> - 12.10
> 
> - 20.1
> 
> - 22.1 22.1.1
> 
> You must download and install one of these versions separately.
> 
> You should set the `CPLEX_STUDIO_BINARIES` environment variable to point to
> 
> the install location then try again. For example (updating the path to the
> 
> correct location):
> 
> ```julia
> 
> ENV["CPLEX_STUDIO_BINARIES"] = "/Applications/CPLEX_Studio221/cplex/bin/x86-64_osx/"
> 
> import Pkg
> 
> Pkg.add("CPLEX")
> 
> Pkg.build("CPLEX")
> 
> ```
> 
> See the CPLEX.jl README at [GitHub - jump-dev/CPLEX.jl: Julia interface for the CPLEX optimization software](https://github.com/jump-dev/CPLEX.jl) for further
> 
> instructions.
> 
> Stacktrace:
> 
> [1] error(s::String)
> 
> @ Base ./error.jl:35
> 
> [2] try\_local\_installation()
> 
> @ Main ~/.julia/packages/CPLEX/eQ4bU/deps/build.jl:140
> 
> [3] top-level scope
> 
> @ ~/.julia/packages/CPLEX/eQ4bU/deps/build.jl:158
> 
> [4] include(fname::String)
> 
> @ Base.MainInclude ./client.jl:489
> 
> [5] top-level scope
> 
> @ none:5
> 
> in expression starting at /Users/sharara/.julia/packages/CPLEX/eQ4bU/deps/build.jl:151
> 
> Stacktrace:
> 
> [1] **pkgerror(msg::String)**
> 
> @ Pkg.Types /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
> 
> [2] **(::Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1156
> 
> [3] **withenv(**::Pkg.Operations.var"#67#74"{…}, ::Pair{…}, ::Vararg{…}**)**
> 
> @ Base ./env.jl:257
> 
> [4] **(::Pkg.Operations.var"#117#122"{String, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{…}, Pkg.Types.PackageSpec})()**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1824
> 
> [5] **with\_temp\_env(fn::Pkg.Operations.var"#117#122"{…}, temp\_env::String)**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1705
> 
> [6] **(::Pkg.Operations.var"#115#120"{…})(tmp::String)**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1794
> 
> [7] **mktempdir(fn::Pkg.Operations.var"#115#120"{…}, parent::String; prefix::String)**
> 
> @ Base.Filesystem ./file.jl:766
> 
> [8] **mktempdir(fn::Function, parent::String)**
> 
> @ Base.Filesystem ./file.jl:762
> 
> [9] **mktempdir**
> 
> @ ./file.jl:762 [inlined]
> 
> [10] **sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target\_path::String, sandbox\_path::String, sandbox\_project\_override::Pkg.Types.Project; preferences::Dict{…}, force\_latest\_compatible\_version::Bool, allow\_earlier\_backwards\_compatible\_versions::Bool, allow\_reresolve::Bool)**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1752
> 
> [11] **build\_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1137
> 
> [12] **build\_versions**
> 
> @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1055 [inlined]
> 
> [13] **build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)**
> 
> @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:995
> 
> [14] **build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::@Kwargs{io::Base.TTY})**
> 
> @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:1056
> 
> [15] **build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})**
> 
> @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
> 
> [16] **build(pkgs::Vector{Pkg.Types.PackageSpec})**
> 
> @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
> 
> [17] **build**
> 
> @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
> 
> [18] **build(pkg::String)**
> 
> @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:146
> 
> [19] top-level scope
> 
> @ REPL[4]:1

Some type information was truncated. Use `show(err)` to see complete types.

(I have Cplex 22.11)

and while I run my main program:

> Precompiling CPLEX  
> Info Given CPLEX was explicitly requested, output will be shown live  
> ERROR: LoadError: CPLEX not properly installed. Please run Pkg.build(“CPLEX”)  
> Stacktrace:  
> [1] error(s::String)  
> @ Base ./error.jl:35  
> [2] top-level scope  
> @ ~/.julia/packages/CPLEX/eQ4bU/src/CPLEX.jl:12  
> [3] include  
> @ ./Base.jl:495 [inlined]  
> [4] include\_package\_for\_output(pkg::Base.PkgId, input::String, depot\_path::Vector{String}, dl\_load\_path::Vector{String}, load\_path::Vector{String}, concrete\_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)  
> @ Base ./loading.jl:2222  
> [5] top-level scope  
> @ stdin:3  
> in expression starting at /Users/sharara/.julia/packages/CPLEX/eQ4bU/src/CPLEX.jl:6  
> in expression starting at stdin:3  
> ✗ CPLEX  
> 0 dependencies successfully precompiled in 1 seconds. 48 already precompiled.
> 
> ERROR: The following 1 direct dependency failed to precompile:
> 
> CPLEX [a076750e-1247-5638-91d2-ce28b192dca0]
> 
> Failed to precompile CPLEX [a076750e-1247-5638-91d2-ce28b192dca0] to “/Users/sharara/.julia/compiled/v1.10/CPLEX/jl\_thkDb6”.  
> ERROR: LoadError: CPLEX not properly installed. Please run Pkg.build(“CPLEX”)  
> Stacktrace:  
> [1] error(s::String)  
> @ Base ./error.jl:35  
> [2] top-level scope  
> @ ~/.julia/packages/CPLEX/eQ4bU/src/CPLEX.jl:12  
> [3] include  
> @ ./Base.jl:495 [inlined]  
> [4] include\_package\_for\_output(pkg::Base.PkgId, input::String, depot\_path::Vector{String}, dl\_load\_path::Vector{String}, load\_path::Vector{String}, concrete\_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)  
> @ Base ./loading.jl:2222  
> [5] top-level scope  
> @ stdin:3  
> in expression starting at /Users/sharara/.julia/packages/CPLEX/eQ4bU/src/CPLEX.jl:6  
> in expression starting at stdin:  
> Stacktrace:  
> [1] pkgerror(msg::String)  
> @ Pkg.Types ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70  
> [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal\_call::Bool, strict::Bool, warn\_loaded::Bool, already\_instantiated::Bool, timing::Bool, \_from\_loading::Bool, kwargs::@Kwargs{…})  
> @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:1659  
> [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{\_from\_loading::Bool})  
> @ Pkg.API ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:159  
> [4] precompile  
> @ ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]  
> [5] #precompile#114  
> @ ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]  
> [6] #invokelatest#2  
> @ ./essentials.jl:894 [inlined]  
> [7] invokelatest  
> @ ./essentials.jl:889 [inlined]  
> [8] \_require(pkg::Base.PkgId, env::String)  
> @ Base ./loading.jl:1963  
> [9] \_\_require\_prelocked(uuidkey::Base.PkgId, env::String)  
> @ Base ./loading.jl:1812  
> [10] #invoke\_in\_world#3  
> @ ./essentials.jl:926 [inlined]  
> [11] invoke\_in\_world  
> @ ./essentials.jl:923 [inlined]  
> [12] \_require\_prelocked(uuidkey::Base.PkgId, env::String)  
> @ Base ./loading.jl:1803  
> [13] macro expansion  
> @ ./loading.jl:1790 [inlined]  
> [14] macro expansion  
> @ ./lock.jl:267 [inlined]  
> [15] \_\_require(into::Module, mod::Symbol)  
> @ Base ./loading.jl:1753  
> [16] #invoke\_in\_world#3  
> @ ./essentials.jl:926 [inlined]  
> [17] invoke\_in\_world  
> @ ./essentials.jl:923 [inlined]  
> [18] require(into::Module, mod::Symbol)  
> @ Base ./loading.jl:1746  
> [19] eval  
> @ ./boot.jl:385 [inlined]  
> [20] include\_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)  
> @ Base ./loading.jl:2076  
> [21] include\_string(m::Module, txt::String, fname::String)  
> @ Base ./loading.jl:2086  
> [22] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})  
> @ Base ./essentials.jl:892  
> [23] invokelatest(::Any, ::Any, ::Vararg{Any})  
> @ Base ./essentials.jl:889  
> [24] inlineeval(m::Module, code::String, code\_line::Int64, code\_column::Int64, file::String; softscope::Bool)  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:263  
> [25] (::VSCodeServer.var"#67#72"{…})()  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:181  
> [26] withpath(f::VSCodeServer.var"#67#72"{…}, path::String)  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/repl.jl:274  
> [27] (::VSCodeServer.var"#66#71"{…})()  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:179  
> [28] hideprompt(f::VSCodeServer.var"#66#71"{…})  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/repl.jl:38  
> [29] (::VSCodeServer.var"#65#70"{…})()  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:150  
> [30] with\_logstate(f::Function, logstate::Any)  
> @ Base.CoreLogging ./logging.jl:515  
> [31] with\_logger  
> @ ./logging.jl:627 [inlined]  
> [32] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:255  
> [33] #invokelatest#2  
> @ ./essentials.jl:892 [inlined]  
> [34] invokelatest(::Any)  
> @ Base ./essentials.jl:889  
> [35] (::VSCodeServer.var"#62#63")()  
> @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.75.2/scripts/packages/VSCodeServer/src/eval.jl:34  
> Some type information was truncated. Use `show(err)` to see complete types.

I have a deadline this week and still, I have not done the main optimization and its possible errors… I stopped here… please kindly help me…

---

<div class="post-metadata">

### Author: ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)
#### Post date: [March 24, 2024, 11:10am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/6 "2024-03-24T11:10:51Z")

</div>

I think installed the Mac OS version of CPLEX (I actually have an M3), entitled: `cos_installer_preview-22.1.1.0.R0-M08SXML-osx`,  
and CPLEX is working fine:

```julia
poss@Mac-de-Michael ~ % /Applications/CPLEX_Studio2211/cplex/bin/x86-64_osx/cplex ; exit;

Welcome to IBM(R) ILOG(R) CPLEX(R) Interactive Optimizer Community Edition 22.1.1.0
  with Simplex, Mixed Integer & Barrier Optimizers
5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
Copyright IBM Corp. 1988, 2022. All Rights Reserved.

Type 'help' for a list of available commands.
Type 'help' followed by a command name for more
information on commands.

CPLEX>

```

---

<div class="post-metadata">

### Author: ![Sharara](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Sharara](https://discourse.julialang.org/u/Sharara)
#### Post date: [March 24, 2024, 11:32am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/7 "2024-03-24T11:32:38Z")

</div>

would you please say what did you do?

---

<div class="post-metadata">

### Author: ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)
#### Post date: [March 24, 2024, 1:16pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/8 "2024-03-24T13:16:33Z")

</div>

I cannot build CPLEX in julia. I was just saying I think my CPLEX installation is appropriate for my environement.

---

<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: [March 24, 2024, 7:21pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/9 "2024-03-24T19:21:57Z")

</div>

@mposs, you have installed the Intel x86 version of CPLEX. It can run because of the Rosetta compatibility layer. To use with Julia, you must also use the x86 version of Julia.

---

<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: [March 24, 2024, 7:24pm UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/10 "2024-03-24T19:24:05Z")

</div>

@Sharara Your `CPLEX_STUDIO_BINARIES` isn’t the correct path. It should be the directory, not the file. See the example in the error message.

> which I could not solve during the last 2 weeks!

Oh no! In future please feel free to ask questions earlier. It’s not fun trying to solve a problem without success

---

<div class="post-metadata">

### Author: ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)
#### Post date: [March 25, 2024, 6:56am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/11 "2024-03-25T06:56:55Z")

</div>

Thank you. Removing the `julia` version I had installed with juliaup, and installing manually the x86 version works. I wonder if this shouldn’t be documented somewhere? Or had I done spmething “wrong”?

---

<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: [March 25, 2024, 7:02am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/12 "2024-03-25T07:02:23Z")

</div>

If you use juliaup, then you can install the x86-64 version with `juliaup add 1~x64`, and then start it with `julia +1~x64`.

> I wonder if this shouldn’t be documented somewhere?

We could add this to the CPLEX README. The question does come up from time to time. It’s not specific to CPLEX or Julia though. If you’re downloading any binaries on an M machine, you need to make sure that any interoperations use the same architecture.

---

<div class="post-metadata">

### Author: ![Sharara](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Sharara](https://discourse.julialang.org/u/Sharara)
#### Post date: [March 25, 2024, 7:20am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967/13 "2024-03-25T07:20:23Z")

</div>

You are right, I never have seen a support team like Julia before (for other software)  
Maybe, that’s why I was not comfortable to ask sooner,

About CPLEX, the problem is solved on my side, too.  
But, to be honest, I do not know how!!!

I deleted and installed Julia and CPLEX several times, several versions, and several pairs.  
non of them worked, but suddenly it worked! passed the Error and showed another error related to the code!
