# Cannot build CPLEX 22.11 in Julia 1.6.7 (Mac)

**URL:** <https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825>\
**Category:** Optimization (Mathematical)\
**Created:** [June 26, 2023, 2:02am UTC](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825 "2023-06-26T02:02:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlozano](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mlozano](https://discourse.julialang.org/u/mlozano)\
**Post date:** [June 26, 2023, 2:02am UTC](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825/1 "2023-06-26T02:02:27Z")

</div>

Hello, I think there’s a file type mismatch between the CPLEX download and what Julia is expecting. Specifically, I downloaded the version of both programs for Mac OSX, but it appears that Julia wants the version that is formatted for Linux. I get the following error after adding and updating CPLEX. Thank you in advance for any help you may offer.

```julia
**julia>** Pkg.precompile()

**Precompiling** project...

✗ CPLEX

0 dependencies successfully precompiled in 1 seconds (37 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/mlozano/.julia/compiled/v1.6/CPLEX/jl_jz5MvZ.

**ERROR:** LoadError: could not load library "/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/libcplex2211.dylib"

dlopen(/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/libcplex2211.dylib, 0x0001): tried: '/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/libcplex2211.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/libcplex2211.dylib' (no such file), '/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/libcplex2211.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Stacktrace:

[1] **_get_version_number()**

@ CPLEX ~/.julia/packages/CPLEX/Vd1Gd/src/CPLEX.jl:23

[2] top-level scope

@ ~/.julia/packages/CPLEX/Vd1Gd/src/CPLEX.jl:30

[3] **include**

@ ./Base.jl:384 [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, UInt64}}, source::Nothing**)**

@ Base ./loading.jl:1235

[5] top-level scope

@ none:1

[6] **eval**

@ ./boot.jl:360 [inlined]

[7] **eval(**x::Expr**)**

@ Base.MainInclude ./client.jl:446

[8] top-level scope

@ none:1

in expression starting at /Users/mlozano/.julia/packages/CPLEX/Vd1Gd/src/CPLEX.jl:6

Stacktrace:

[1] **pkgerror(**msg::String**)**

@ Pkg.Types /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55

[2] **precompile(**ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}**)**

@ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1265

[3] **precompile**

@ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:921 [inlined]

[4] **#precompile#196**

@ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919 [inlined]

[5] **precompile()**

@ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919

[6] top-level scope

@ REPL[8]:1

```

---

<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:** [June 26, 2023, 2:39am UTC](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825/2 "2023-06-26T02:39:52Z")

</div>

Hi there @mlozano, welcome to the forum.

This error is because of a mis-match between the build of Julia that you are using and the build of CPLEX that you downloaded from IBM.

(You have installed the arm64 (Apple silicon) version of CPLEX, but you are using an x86\_64 (Intel) build of Julia.)

You have two options:

- If you want to stay on Julia 1.6, you’ll need to download and install the x86\_64 (Intel) version of CPLEX 22.11 from IBM.
- Alternatively, you can install the `macOS (Apple Silicon)` build of Julia v1.9 and use your currently installed version of CPLEX.

---

<div class="post-metadata">

**Author:** ![mlozano](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mlozano](https://discourse.julialang.org/u/mlozano)\
**Post date:** [June 26, 2023, 1:44pm UTC](https://discourse.julialang.org/t/cannot-build-cplex-22-11-in-julia-1-6-7-mac/100825/3 "2023-06-26T13:44:20Z")

</div>

Hi, thank you for the prompt reply. Turns out I am able to use a later version of Julia for my model so I’ll be doing that.
