Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add OpenFHE.jl package #43

Closed
ArseniyKholod opened this issue Apr 9, 2024 · 11 comments
Closed

Unable to add OpenFHE.jl package #43

ArseniyKholod opened this issue Apr 9, 2024 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@ArseniyKholod
Copy link
Collaborator

ArseniyKholod commented Apr 9, 2024

When I'm trying to add OpenFHE.jl, I get the following error. The same error appears in my new PR to SecureArithmetic.jl

(run) pkg> add OpenFHE
    Updating registry at `D:\work\.julia\registries\General.toml`
   Resolving package versions...
    Updating `D:\work\homomorphic_encryption\SecureArithmetic.jl\run\Project.toml`
  [77ce9b8e] + OpenFHE v0.1.8
  No Changes to `D:\work\homomorphic_encryption\SecureArithmetic.jl\run\Manifest.toml`
Precompiling project...
  ✗ OpenFHE
  ✗ SecureArithmetic
  4 dependencies successfully precompiled in 22 seconds. 5 already precompiled.
  2 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> using OpenFHE
Precompiling OpenFHE
        Info Given OpenFHE was explicitly requested, output will be shown live
ERROR: LoadError: InitError: could not load library "D:\work\.julia\artifacts\9c7091bbb96042c2b6a9b9529a039f68cd20a8c5\bin\libopenfhe_julia.dll"
The specified procedure could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:116
  [3] macro expansion
    @ D:\work\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
  [4] __init__()
    @ openfhe_julia_jll D:\work\.julia\packages\openfhe_julia_jll\PPTIE\src\wrappers\x86_64-w64-mingw32-cxx11-julia_version+1.10.0.jl:11
  [5] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
 [11] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [12] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [14] macro expansion
    @ .\loading.jl:1790 [inlined]
 [15] macro expansion
    @ .\lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [17] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [20] include
    @ .\Base.jl:495 [inlined]
 [21] 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
 [22] top-level scope
    @ stdin:3
during initialization of module openfhe_julia_jll
in expression starting at D:\work\.julia\packages\OpenFHE\DTU0L\src\OpenFHE.jl:1
in expression starting at stdin:3
  ✗ OpenFHE
  0 dependencies successfully precompiled in 3 seconds. 9 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95]

Failed to precompile OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95] to "D:\\work\\.julia\\compiled\\v1.10\\OpenFHE\\jl_F4E3.tmp".
ERROR: LoadError: InitError: could not load library "D:\work\.julia\artifacts\9c7091bbb96042c2b6a9b9529a039f68cd20a8c5\bin\libopenfhe_julia.dll"
The specified procedure could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:116
  [3] macro expansion
    @ D:\work\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
  [4] __init__()
    @ openfhe_julia_jll D:\work\.julia\packages\openfhe_julia_jll\PPTIE\src\wrappers\x86_64-w64-mingw32-cxx11-julia_version+1.10.0.jl:11
  [5] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1067
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1581
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1938
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
 [11] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [12] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [14] macro expansion
    @ .\loading.jl:1790 [inlined]
 [15] macro expansion
    @ .\lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [17] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [20] include
    @ .\Base.jl:495 [inlined]
 [21] 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
 [22] top-level scope
    @ stdin:3
during initialization of module openfhe_julia_jll
in expression starting at D:\work\.julia\packages\OpenFHE\DTU0L\src\OpenFHE.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\Lenovo\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\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 C:\Users\Lenovo\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\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 C:\Users\Lenovo\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
  [4] precompile
    @ C:\Users\Lenovo\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
  [5] #precompile#114
    @ C:\Users\Lenovo\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\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
Some type information was truncated. Use `show(err)` to see complete types.
@ArseniyKholod ArseniyKholod added the bug Something isn't working label Apr 9, 2024
@sloede
Copy link
Member

sloede commented Apr 9, 2024

I can reproduce with Julia v1.10 on Linux with

julia -e 'using Pkg; Pkg.activate(; temp=true); Pkg.add("openfhe_julia_jll"); using openfhe_julia_jll'

which gives me

  Activating new project at `/tmp/jl_rP1mHu`
   Resolving package versions...
    Updating `/mnt/hd1/tmp/jl_rP1mHu/Project.toml`
  [e5e97983] + openfhe_julia_jll v0.2.9+0
    Updating `/mnt/hd1/tmp/jl_rP1mHu/Manifest.toml`
  [692b3bcd] + JLLWrappers v1.5.0
  [21216c6a] + Preferences v1.4.3
  [1d63c593] + LLVMOpenMP_jll v15.0.7+0
  [a2687184] + OpenFHE_jll v1.1.4+0
⌅ [3eaa8342] + libcxxwrap_julia_jll v0.11.2+1
  [e5e97983] + openfhe_julia_jll v0.2.9+0
  [56f22d72] + Artifacts
  [ade2ca70] + Dates
  [8f399da3] + Libdl
  [de0858da] + Printf
  [fa267f1f] + TOML v1.0.3
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.5+1
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
ERROR: InitError: could not load library "/home/mschlott/.julia/artifacts/348fa4509f18d6a3a8b97ec83fd44919e60ad6b8/lib/libopenfhe_julia.so"
/home/mschlott/.julia/artifacts/348fa4509f18d6a3a8b97ec83fd44919e60ad6b8/lib/libopenfhe_julia.so: undefined symbol: _ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1_5ubintImEEEEE2atEj
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined]
  [4] __init__()
    @ openfhe_julia_jll ~/.julia/packages/openfhe_julia_jll/PPTIE/src/wrappers/x86_64-linux-gnu-cxx11-julia_version+1.10.0.jl:11
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1128
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1116
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1575
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1932
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [11] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [12] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [14] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [15] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [17] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [18] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
during initialization of module openfhe_julia_jll

@sloede
Copy link
Member

sloede commented Apr 9, 2024

OK, I think I found the problem: I updated OpenFHE_jll.jl to v1.1.4 on Yggdrasil (https://github.com/JuliaPackaging/Yggdrasil/blob/master/O/OpenFHE/build_tarballs.jl). However, our version of openfhe_julia_jll.jl was built against v1.1.2, which seems to be incompatible (uhhh, what about semver? 🙈). Thus, there are three steps to go forward:

  1. For an immediate local fix, restrict OpenFHE_jll.jl to v1.1.2, e.g., by explicitly calling
    ] add OpenFHE@1.1.2
    in your REPL.
  2. As a temporary, global fix, explicitly add OpenFHE_jll as a dependency to OpenFHE.jl in the Project.toml and restrict it to version v1.1.2 by using "=1.1.2" as the compat setting.
  3. For a permanent, proper solution, recompile the whole openfhe_julia_jll. This would be useful anyways, since in March there were new releases for libcxxwrap-julia and CxxWrap.jl. Thus, the required steps would be
    1. Create a new release of openfhe_julia_jll.jl on Yggdrasil, keeping the version number v0.2.9 but updating the compat setting for libcxxwrap-julia to v0.12.2 here and for libjulia_jll to v1.10.9 here (to match this line)
    2. Update compat settings in OpenFHE.jl's Project.toml accordingly.

@ArseniyKholod could you maybe take care of this since I don't have the time to tackle this right now? Regarding step 3), I recommend to test this locally first on Rocinante.

@ArseniyKholod
Copy link
Collaborator Author

ArseniyKholod commented Apr 9, 2024

Sure, I will take care of it.

@ArseniyKholod
Copy link
Collaborator Author

ArseniyKholod commented Apr 10, 2024

Sorry, I am a bit lost. Do I understand correctly, that to test 3) on Rocinante I need to compile last version of OpenFHE-development v1.1.4, libcxxwrap-julia v0.12.2 and then recompile openfhe-julia? After compilation of openfhe-julia I got new .so library and set it as default using OpenFHE.set_library!("/abs/path/to/library.so"). But I'm still getting analogical error, but undefined symbol is changed...

julia> using OpenFHE
Precompiling OpenFHE
        Info Given OpenFHE was explicitly requested, output will be shown live
ERROR: LoadError: could not load library "/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so"
/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so: undefined symbol: _ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1_5ubintImEEEEE23DropLastElementAndScaleERKSt6vectorIN6intnat14NativeIntegerTImEESaISA_EESE_
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen
   @ Base.Libc.Libdl ./libdl.jl:116 [inlined]
 [3] readmodule(so_path_cb::OpenFHE.var"#1#2", funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:750
 [4] wrapmodule(so_path_cb::Function, funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:761
 [5] top-level scope
   @ ~/.julia/packages/OpenFHE/DTU0L/src/OpenFHE.jl:11
 [6] include
   @ Base ./Base.jl:495 [inlined]
 [7] 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:2216
 [8] top-level scope
   @ stdin:3
in expression starting at /home/kholod/.julia/packages/OpenFHE/DTU0L/src/OpenFHE.jl:1
in expression starting at stdin:3
  ✗ OpenFHE
  0 dependencies successfully precompiled in 2 seconds. 9 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95]

Failed to precompile OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95] to "/home/kholod/.julia/compiled/v1.10/OpenFHE/jl_8AYoQB".
ERROR: LoadError: could not load library "/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so"
/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so: undefined symbol: _ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1_5ubintImEEEEE23DropLastElementAndScaleERKSt6vectorIN6intnat14NativeIntegerTImEESaISA_EESE_
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen
   @ Base.Libc.Libdl ./libdl.jl:116 [inlined]
 [3] readmodule(so_path_cb::OpenFHE.var"#1#2", funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:750
 [4] wrapmodule(so_path_cb::Function, funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:761
 [5] top-level scope
   @ ~/.julia/packages/OpenFHE/DTU0L/src/OpenFHE.jl:11
 [6] include
   @ Base ./Base.jl:495 [inlined]
 [7] 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:2216
 [8] top-level scope
   @ stdin:3
in expression starting at /home/kholod/.julia/packages/OpenFHE/DTU0L/src/OpenFHE.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /mnt/hd1/opt/julia/1.10.0/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 /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:1656
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] #invokelatest#2
    @ Base ./essentials.jl:889 [inlined]
  [7] invokelatest
    @ Base ./essentials.jl:884 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1957
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [10] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [11] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [13] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [14] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [16] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [17] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
Some type information was truncated. Use `show(err)` to see complete types.

julia>

@ArseniyKholod
Copy link
Collaborator Author

ArseniyKholod commented Apr 10, 2024

CxxWrap.jl also published recently new version, OpenFHE.jl uses the previous one because of constrain in Project.toml, so shouldn't be a problem...

@sloede
Copy link
Member

sloede commented Apr 10, 2024

Do I understand correctly, that to test 3) on Rocinante I need to compile last version of OpenFHE-development v1.1.4, libcxxwrap-julia v0.12.2 and then recompile openfhe-julia?

Yes. If using CxxWrap.jl, you also need to make sure that you're using the latest version v0.15, as it is the only one compatible with libcxxwrap-julia v0.12 (see https://github.com/JuliaInterop/CxxWrap.jl#breaking-changes-in-v015).

Maybe this fixes your error if you force to use the custom libcxxwrap-julia version and the most recent CxxWrap.jl version?

@ArseniyKholod
Copy link
Collaborator Author

ArseniyKholod commented Apr 11, 2024

Just to keep up-to-date and document a bit my way.
I'm still trying to make everything work together. New error appeared today when build on Rocinante using following commands.

  1. Build openfhe-development version 1.1.4
cd openfhe-development
git checkout v1.1.4
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install \
    -DBUILD_BENCHMARKS=OFF -DBUILD_UNITTESTS=OFF \
    -DLIBINSTALL="$(dirname $(pwd))/install/lib"
make -j 4
make install
  1. Build libcxxwrap-julia version 0.12.2
cd libcxxwrap-julia
git checkout v0.12.2
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make -j 4
make install
  1. Build openfhe-julia version 0.2.9
cd openfhe-julia
git checkout v0.2.9
mkdir build && cd build
prefix_path="$(pwd)/../../libcxxwrap-julia/install/;$(pwd)/../../openfhe-development/install/"
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_PREFIX_PATH="$prefix_path"
make -j 4

Already openfhe-julia produces an error while compiling

kholod@pcm016:~/openfhe-julia/build$ make -j 4
Scanning dependencies of target openfhe_julia
[  8%] Building CXX object CMakeFiles/openfhe_julia.dir/src/enums.cpp.o
[  8%] Building CXX object CMakeFiles/openfhe_julia.dir/src/openfhe_julia.cpp.o
[ 12%] Building CXX object CMakeFiles/openfhe_julia.dir/src/ubint.cpp.o
[ 16%] Building CXX object CMakeFiles/openfhe_julia.dir/src/nativeinteger.cpp.o
[ 20%] Building CXX object CMakeFiles/openfhe_julia.dir/src/cryptocontextbfvrns.cpp.o
[ 25%] Building CXX object CMakeFiles/openfhe_julia.dir/src/cryptocontextbgvrns.cpp.o
[ 29%] Building CXX object CMakeFiles/openfhe_julia.dir/src/cryptocontextckksrns.cpp.o
[ 33%] Building CXX object CMakeFiles/openfhe_julia.dir/src/fheckksrns.cpp.o
[ 37%] Building CXX object CMakeFiles/openfhe_julia.dir/src/params.cpp.o
[ 41%] Building CXX object CMakeFiles/openfhe_julia.dir/src/ccparams.cpp.o
[ 45%] Building CXX object CMakeFiles/openfhe_julia.dir/src/serializable.cpp.o
[ 50%] Building CXX object CMakeFiles/openfhe_julia.dir/src/dcrtpoly.cpp.o
[ 54%] Building CXX object CMakeFiles/openfhe_julia.dir/src/privatekeyimpl.cpp.o
[ 58%] Building CXX object CMakeFiles/openfhe_julia.dir/src/publickeyimpl.cpp.o
[ 62%] Building CXX object CMakeFiles/openfhe_julia.dir/src/keypair.cpp.o
[ 66%] Building CXX object CMakeFiles/openfhe_julia.dir/src/plaintextimpl.cpp.o
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp: In instantiation of ‘wrap_PrivateKeyImpl(jlcxx::Module&)::<lambda(auto:2)> [with auto:2 = jlcxx::TypeWrapper<lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > > >]’:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1199:15:   required from ‘int jlcxx::TypeWrapper<T>::apply_internal(FunctorT&&) [with AppliedT = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; FunctorT = wrap_PrivateKeyImpl(jlcxx::Module&)::<lambda(auto:2)>; T = jlcxx::Parametric<jlcxx::TypeVar<1> >]’
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1148:63:   required from ‘jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::apply(FunctorT&&) [with AppliedTypesT = {lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >}; FunctorT = wrap_PrivateKeyImpl(jlcxx::Module&)::<lambda(auto:2)>; T = jlcxx::Parametric<jlcxx::TypeVar<1> >]’
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:20:8:   required from here
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:19:23: error: no matching function for call to ‘jlcxx::TypeWrapper<lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > > >::method(const char [34], uint32_t (*)())’
   19 |         wrapped.method("PrivateKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/privatekeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1091:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, R (CT::*)(ArgsT ...), Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1091 |   TypeWrapper<T>& method(const std::string& name, R(CT::*f)(ArgsT...), Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1091:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:19:23: note:   mismatched types ‘R (CT::*)(ArgsT ...)’ and ‘uint32_t (*)()’ {aka ‘unsigned int (*)()’}
   19 |         wrapped.method("PrivateKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/privatekeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1100:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, R (CT::*)(ArgsT ...) const, Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1100 |   TypeWrapper<T>& method(const std::string& name, R(CT::*f)(ArgsT...) const, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1100:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:19:23: note:   mismatched types ‘R (CT::*)(ArgsT ...) const’ and ‘uint32_t (*)()’ {aka ‘unsigned int (*)(’}
   19 |         wrapped.method("PrivateKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/privatekeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1110:19: note: candidate: ‘template<class LambdaT, class ... Extra, typename std::enable_if<(jlcxx::detail::has_call_operator<LambdaT>::value && (! std::is_member_function_pointer<_Tp>::value)), bool>::type <anonymous> > jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, LambdaT&&, Extra ...) [with LambdaT = LambdaT; Extra = {Extra ...}; typename std::enable_if<(jlcxx::detail::has_call_operator<LambdaT>::value && (! std::is_member_function_pointer<LambdaT>::value)), bool>::type <anonymous> = <anonymous>; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1110 |   TypeWrapper<T>& method(const std::string& name, LambdaT&& lambda, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1110:19: note:   template argument deduction/substitution failed:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1109:132: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
 1109 |            std::enable_if_t<detail::has_call_operator<LambdaT>::value && !std::is_member_function_pointer<LambdaT>::value, bool> = true>
      |                                                                                                                                    ^~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1119:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(R (CT::*)(ArgsT ...), Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1119 |   TypeWrapper<T>& method(R(CT::*f)(ArgsT...), Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1119:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:19:23: note:   mismatched types ‘R (CT::*)(ArgsT ...)’ and ‘const char*’
   19 |         wrapped.method("PrivateKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/privatekeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1126:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(R (CT::*)(ArgsT ...) const, Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1126 |   TypeWrapper<T>& method(R(CT::*f)(ArgsT...) const, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1126:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/privatekeyimpl.cpp:19:23: note:   mismatched types ‘R (CT::*)(ArgsT ...) const’ and ‘const char*’
   19 |         wrapped.method("PrivateKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/privatekeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1136:19: note: candidate: ‘template<class LambdaT, class ... Extra, typename std::enable_if<jlcxx::detail::has_call_operator<LambdaT>::value, bool>::type <anonymous> > jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(LambdaT&&, Extra ...) [with LambdaT = LambdaT; Extra = {Extra ...}; typename std::enable_if<jlcxx::detail::has_call_operator<LambdaT>::value, bool>::type <anonymous> = <anonymous>; T = lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1136 |   TypeWrapper<T>& method(LambdaT&& lambda, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1136:19: note:   template argument deduction/substitution failed:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1135:80: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
 1135 |            std::enable_if_t<detail::has_call_operator<LambdaT>::value, bool> = true>
      |                                                                                ^~~~
/home/kholod/openfhe-julia/src/publickeyimpl.cpp: In instantiation of ‘wrap_PublicKeyImpl(jlcxx::Module&)::<lambda(auto:2)> [with auto:2 = jlcxx::TypeWrapper<lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > > >]’:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1199:15:   required from ‘int jlcxx::TypeWrapper<T>::apply_internal(FunctorT&&) [with AppliedT = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >; FunctorT = wrap_PublicKeyImpl(jlcxx::Module&)::<lambda(auto:2)>; T = jlcxx::Parametric<jlcxx::TypeVar<1> >]’
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1148:63:   required from ‘jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::apply(FunctorT&&) [with AppliedTypesT = {lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >}; FunctorT = wrap_PublicKeyImpl(jlcxx::Module&)::<lambda(auto:2)>; T = jlcxx::Parametric<jlcxx::TypeVar<1> >]’
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:21:8:   required from here
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:20:23: error: no matching function for call to ‘jlcxx::TypeWrapper<lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > > >::method(const char [33], uint32_t (*)())’
   20 |         wrapped.method("PublicKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/publickeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1091:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, R (CT::*)(ArgsT ...), Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1091 |   TypeWrapper<T>& method(const std::string& name, R(CT::*f)(ArgsT...), Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1091:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:20:23: note:   mismatched types ‘R (CT::*)(ArgsT ...)’ and ‘uint32_t (*)()’ {aka ‘unsigned int (*)()’}
   20 |         wrapped.method("PublicKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/publickeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1100:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, R (CT::*)(ArgsT ...) const, Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1100 |   TypeWrapper<T>& method(const std::string& name, R(CT::*f)(ArgsT...) const, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1100:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:20:23: note:   mismatched types ‘R (CT::*)(ArgsT ...) const’ and ‘uint32_t (*)()’ {aka ‘unsigned int (*)()’}
   20 |         wrapped.method("PublicKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/publickeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1110:19: note: candidate: ‘template<class LambdaT, class ... Extra, typename std::enable_if<(jlcxx::detail::has_call_operator<LambdaT>::value && (! std::is_member_function_pointer<_Tp>::value)), bool>::type <anonymous> > jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(const string&, LambdaT&&, Extra ...) [with LambdaT = LambdaT; Extra = {Extra ...}; typename std::enable_if<(jlcxx::detail::has_call_operator<LambdaT>::value && (! std::is_member_function_pointer<LambdaT>::value)), bool>::type <anonymous> = <anonymous>; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1110 |   TypeWrapper<T>& method(const std::string& name, LambdaT&& lambda, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1110:19: note:   template argument deduction/substitution failed:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1109:132: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
 1109 |            std::enable_if_t<detail::has_call_operator<LambdaT>::value && !std::is_member_function_pointer<LambdaT>::value, bool> = true>
      |                                                                                                                                    ^~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1119:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(R (CT::*)(ArgsT ...), Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1119 |   TypeWrapper<T>& method(R(CT::*f)(ArgsT...), Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1119:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:20:23: note:   mismatched types ‘R (CT::*)(ArgsT ...)’ and ‘const char*’
   20 |         wrapped.method("PublicKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/publickeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1126:19: note: candidate: ‘template<class R, class CT, class ... ArgsT, class ... Extra> jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(R (CT::*)(ArgsT ...) const, Extra ...) [with R = R; CT = CT; ArgsT = {ArgsT ...}; Extra = {Extra ...}; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1126 |   TypeWrapper<T>& method(R(CT::*f)(ArgsT...) const, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1126:19: note:   template argument deduction/substitution failed:
/home/kholod/openfhe-julia/src/publickeyimpl.cpp:20:23: note:   mismatched types ‘R (CT::*)(ArgsT ...) const’ and ‘const char*’
   20 |         wrapped.method("PublicKeyImpl__SerializedVersion", &WrappedT::SerializedVersion);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/kholod/libcxxwrap-julia/install/include/jlcxx/jlcxx.hpp:15,
                 from /home/kholod/openfhe-julia/src/publickeyimpl.cpp:1:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1136:19: note: candidate: ‘template<class LambdaT, class ... Extra, typename std::enable_if<jlcxx::detail::has_call_operator<LambdaT>::value, bool>::type <anonymous> > jlcxx::TypeWrapper<T>& jlcxx::TypeWrapper<T>::method(LambdaT&&, Extra ...) [with LambdaT = LambdaT; Extra = {Extra ...}; typename std::enable_if<jlcxx::detail::has_call_operator<LambdaT>::value, bool>::type <anonymous> = <anonymous>; T = lbcrypto::PublicKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<long unsigned int> > > >]’
 1136 |   TypeWrapper<T>& method(LambdaT&& lambda, Extra... extra)
      |                   ^~~~~~
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1136:19: note:   template argument deduction/substitution failed:
/home/kholod/libcxxwrap-julia/install/include/jlcxx/module.hpp:1135:80: error: no type named ‘type’ in ‘struct std::enable_if<false, bool>’
 1135 |            std::enable_if_t<detail::has_call_operator<LambdaT>::value, bool> = true>
      |                                                                                ^~~~
make[2]: *** [CMakeFiles/openfhe_julia.dir/build.make:219: CMakeFiles/openfhe_julia.dir/src/privatekeyimpl.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/openfhe_julia.dir/build.make:232: CMakeFiles/openfhe_julia.dir/src/publickeyimpl.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/openfhe_julia.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

If build all thing in the same way, but use libcxxwrap-julia of the older version 0.11.2 at least openfhe-julia is able to be build. So probably changes in libcxxwrap-julia between 0.11.2 and 0.12.0 are the problem. (Already with 0.12.0 error arises, there are some breaking changes in new version). They changed somehow the way to wrap functions. Some functions are wrapped normally as before, some fails, I'm searching for reasons. First idea is strange behavior of static functions.

Remark: I didn't control versions of CxxWrap.jl yet, because in my understanding it comes in play only with OpenFHE.jl, I didn't get so far yet :) I do not give up and keep thinking)

@sloede
Copy link
Member

sloede commented Apr 12, 2024

Thanks for the report, I was able to reproduce the error 👍

So probably changes in libcxxwrap-julia between 0.11.2 and 0.12.0 are the problem. (Already with 0.12.0 error arises, there are some breaking changes in new version). They changed somehow the way to wrap functions. Some functions are wrapped normally as before, some fails, I'm searching for reasons. First idea is strange behavior of static functions.

I agree. Can you please create an issue with libcxxwrap-julia, referring to this issue here and the speculation that somehow wrapping of static functions become broken in v0.12.0, and also ping @melven (who is the main author of that release, AFAICT?

@ArseniyKholod
Copy link
Collaborator Author

ArseniyKholod commented Apr 16, 2024

To expanding the collection of the errors:)
Now locally compiling openfhe-julia with libcxxwrap-julia v0.12.2 and using compiled library in OpenFHE.jl with CxxWrap.jl v0.15.0 it errors with following.
Great is that we don't even wrap DCRTPolyImpl<...>::DropLastElementAndScale as far as I understand. We only have interface for type DCRTPoly, but not for it member-methods

julia> using OpenFHE
Precompiling OpenFHE
        Info Given OpenFHE was explicitly requested, output will be shown live
ERROR: LoadError: could not load library "/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so"
/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so: undefined symbol: _ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1_5ubintImEEEEE23DropLastElementAndScaleERKSt6vectorIN6intnat14NativeIntegerTImEESaISA_EESE_
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen
   @ Base.Libc.Libdl ./libdl.jl:116 [inlined]
 [3] readmodule(so_path_cb::OpenFHE.var"#1#2", funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/HG6cm/src/CxxWrap.jl:809
 [4] wrapmodule(so_path_cb::Function, funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/HG6cm/src/CxxWrap.jl:820
 [5] top-level scope
   @ /mnt/ssd/home/kholod/OpenFHE.jl/src/OpenFHE.jl:11
 [6] include
   @ Base ./Base.jl:495 [inlined]
 [7] 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:2216
 [8] top-level scope
   @ stdin:3
in expression starting at /mnt/ssd/home/kholod/OpenFHE.jl/src/OpenFHE.jl:1
in expression starting at stdin:3
  ✗ OpenFHE
  0 dependencies successfully precompiled in 2 seconds. 9 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95]

Failed to precompile OpenFHE [77ce9b8e-ecf5-45d1-bd8a-d31f384f2f95] to "/home/kholod/.julia/compiled/v1.10/OpenFHE/jl_3q9lOT".
ERROR: LoadError: could not load library "/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so"
/mnt/ssd/home/kholod/openfhe-julia/build/lib/libopenfhe_julia.so: undefined symbol: _ZN8lbcrypto12DCRTPolyImplIN9bigintdyn9mubintvecINS1_5ubintImEEEEE23DropLastElementAndScaleERKSt6vectorIN6intnat14NativeIntegerTImEESaISA_EESE_
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen
   @ Base.Libc.Libdl ./libdl.jl:116 [inlined]
 [3] readmodule(so_path_cb::OpenFHE.var"#1#2", funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/HG6cm/src/CxxWrap.jl:809
 [4] wrapmodule(so_path_cb::Function, funcname::Symbol, m::Module, flags::Nothing)
   @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/HG6cm/src/CxxWrap.jl:820
 [5] top-level scope
   @ /mnt/ssd/home/kholod/OpenFHE.jl/src/OpenFHE.jl:11
 [6] include
   @ Base ./Base.jl:495 [inlined]
 [7] 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:2216
 [8] top-level scope
   @ stdin:3
in expression starting at /mnt/ssd/home/kholod/OpenFHE.jl/src/OpenFHE.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /mnt/hd1/opt/julia/1.10.0/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 /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:1656
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ Pkg.API /mnt/hd1/opt/julia/1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] #invokelatest#2
    @ Base ./essentials.jl:889 [inlined]
  [7] invokelatest
    @ Base ./essentials.jl:884 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1957
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [10] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [11] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [13] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [14] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [16] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [17] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
Some type information was truncated. Use `show(err)` to see complete types.

@sloede
Copy link
Member

sloede commented Apr 17, 2024

With v0.1.9 released, this should be fixed, right?

@ArseniyKholod
Copy link
Collaborator Author

Exactly! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants