# Install CPLEX in Julia 1.4.2 32 bits

**URL:** <https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package\
**Created:** [July 23, 2020, 4:16pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564 "2020-07-23T16:16:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Tormo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis_tormo/32/16500_2.png) [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Post date:** [July 23, 2020, 4:16pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/1 "2020-07-23T16:16:49Z")

</div>

Do you know if there is any way to install CPLEX on Julia 1.4.2 32 bit? I know I need one of the latest versions of CPLEX in 32 bit. I tried to install CPLEX 12.6.3 32bit but it gave me a lot of problems and I didn’t get anything.

---

<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 23, 2020, 4:30pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/2 "2020-07-23T16:30:31Z")

</div>

> I tried to install CPLEX 12.6.3

You need CPLEX 12.9 or 12.10.

The wider issue is that I’m not sure if this is tested. You will need CPLEX 32-bit and Julia 32-bit. There may be a range of bugs that you will need to fix.

A post of the errors you are seeing would be helpful.

Why the need for 32bit?

---

<div class="post-metadata">

**Author:** ![Luis\_Tormo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis_tormo/32/16500_2.png) [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Post date:** [July 23, 2020, 5:47pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/3 "2020-07-23T17:47:33Z")

</div>

I want to establish a communication between a simulator and Julia. Julia has to call CPLEX, the problem is that the simulator is 32 bits and I have an error if Julia is 64.

This is the error:

```julia
   Building CPLEX → `C:\Users\Usuario\.julia\packages\CPLEX\Hxpuk\deps\build.log`
┌ Error: Error building `CPLEX`:
│ ERROR: LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEX.jl README for further instructions.
│ Stacktrace:
│ [1] error(::String) at .\error.jl:33
│ [2] try_local_installation() at C:\Users\Usuario\.julia\packages\CPLEX\Hxpuk\deps\build.jl:64
│ [3] top-level scope at C:\Users\Usuario\.julia\packages\CPLEX\Hxpuk\deps\build.jl:80
│ [4] include(::String) at .\client.jl:439
│ [5] top-level scope at none:5
│ in expression starting at C:\Users\Usuario\.julia\packages\CPLEX\Hxpuk\deps\build.jl:77
└ @ Pkg.Operations D:\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.4\Pkg\src\Operations.jl:899

```

---

<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 23, 2020, 6:12pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/4 "2020-07-23T18:12:39Z")

</div>

See the README for installation instructions: [https://github.com/jump-dev/CPLEX.jl#installation](https://github.com/jump-dev/CPLEX.jl#installation)

---

<div class="post-metadata">

**Author:** ![Luis\_Tormo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis_tormo/32/16500_2.png) [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Post date:** [July 23, 2020, 6:30pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/5 "2020-07-23T18:30:14Z")

</div>

This is my CPLEX.jl:

```julia
__precompile__ ()

module CPLEX
    using Libdl

    @static if Sys.isapple()
        Libdl.dlopen("libstdc++",Libdl.RTLD_GLOBAL)
    end

    if isfile(joinpath(dirname(@ __FILE__ ),"..","deps","deps.jl"))
        include("../deps/deps.jl")
    else
        error("CPLEX not properly installed. Please run Pkg.build(\"CPLEX\")")
    end

    ### imports
    import Base: convert, unsafe_convert, show, copy

    # Standard LP interface
    using MathProgBase.SolverInterface

    # exported functions
    # export is_valid,
    # set_logfile,
    # get_error_msg,
    # read_model,
    # write_model,
    # get_sense,
    # set_sense!,
    # get_obj,
    # set_obj!,
    # set_warm_start!,
    # free_problem,
    # close_CPLEX,
    # get_param_type,
    # set_param!,
    # get_param,
    # add_vars!,
    # add_var!,
    # get_varLB,
    # set_varLB!,
    # get_varUB,
    # set_varUB!,
    # set_vartype!,
    # get_vartype,
    # num_var,
    # add_constrs!,
    # add_constrs_t!,
    # add_rangeconstrs!,
    # add_rangeconstrs_t!,
    # num_constr,
    # get_constr_senses,
    # set_constr_senses!,
    # get_rhs,
    # set_rhs!,
    # get_constrLB,
    # get_constrUB,
    # set_constrLB!,
    # set_constrUB!,
    # get_nnz,
    # get_constr_matrix,
    # set_sos!,
    # add_qpterms!,
    # add_diag_qpterms!,
    # add_qconstr!,
    # optimize!,
    # get_objval,
    # get_solution,
    # get_reduced_costs,
    # get_constr_duals,
    # get_constr_solution,
    # get_infeasibility_ray,
    # get_unbounded_ray,
    # get_status,
    # get_status_code,
    # setcallbackcut,
    # cbcut,
    # cblazy,
    # cbget_mipnode_rel,
    # cbget_mipsol_sol,
    # cplex_model

    using SparseArrays
    using LinearAlgebra

    include("cpx_common.jl")
    include("cpx_env.jl")
    v = version()
    if startswith(v,"12.8")
        include("full_defines_1280.jl")
        include("cpx_params_1280.jl")
    elseif startswith(v,"12.9")
        include("full_defines_1290.jl")
        include("cpx_params_1290.jl")
    elseif startswith(v, "12.10")
        include("full_defines_12100.jl")
        include("cpx_params_12100.jl")
    else
        error("Unsupported CPLEX version $v. Only 12.8, 12.9, and 12.10 are currently supported.")
    end
    include("cpx_model.jl")
    include("cpx_params.jl")
    include("cpx_vars.jl")
    include("cpx_constrs.jl")
    include("cpx_quad.jl")
    include("cpx_solve.jl")
    include("cpx_callbacks.jl")
    include("cpx_highlevel.jl")
    include("cpx_generic_callbacks.jl")

    include("CplexSolverInterface.jl")
    include("MOI/MOI_wrapper.jl")
end

```

---

<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 23, 2020, 6:43pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564/6 "2020-07-23T18:43:05Z")

</div>

Did you follow the instructions in the README?
