Cannot build CPLEX 22.11 in Julia 1.6.7 (Mac)

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>** 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

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.
1 Like

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.

1 Like