Packaging VrpSolver

So I want to be able to play with and run VrpSolver as a necessary work of my PhD research. VrpSolver is a classic solver for many VRP problems used mainly for benchmarking purposes.

They propose a docker image where much manual work is still required so I guess trying to make a proper derivation for others to use and install using Nix would be quite beneficial.

Licensing

As a disclaimer, VrpSolver uses BaPCoD which has a particular Inria license where it is mentioned that: “5.4 The Software and the Modified Software cannot be distributed without the authorization of the Owner (contact: stip-bso@inria.fr).” Other than that, this software is intended for academic use only.

I will contact the people behind BaPCoD, and for now, require manual install in the flake for now to comply with the license.

Packaging

For now, I want to be able to make a Nixos-friendly fork of BaPCodVRPSolver.jl, see fork here. This discussion chat is here to document and get help since I have never try writing a flake for such a complex project requiring many outdated dependencies. Any help / advice appreciated.

The first thing I’m struggling with is getting Julia 1.5.4. This version is indeed quite outdated and unavailable on nixpkgs github:nixos/nixpkgs/nixpkgs-unstable.

I couldn’t find an easy answer to use an outdated package, and I’m unsure of the procedure to use. Note that I need some packages within Julia that need to be handled by the integrated package manager within Julia.

So I’m indeed trying to make a derivation for this specific version of Julia. The original author of the package also mention that building Julia from source is better to avoid a libc++ error (written in the README.md file).

Here is my flake:

{
  description = "Julia environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    flake-utils.url = github:numtide/flake-utils;
  };

  outputs = { self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        # Override the Nix package set to allow unfree packages
        pkgs = import nixpkgs {
          system = system; 
          config.allowUnfree = true; 
        };

        # WARN: Nix packaging system doesn't support all packages, so rely on Julia package manager instead.
        # Use Julia in REPL mode, then package mode and install packages that way.
        # WARN: Using a specific version of Julia to avoid compatibility issues.
        julia_15 = pkgs.stdenv.mkDerivation {
          name = "julia-1.5.4";
          src = pkgs.fetchurl {
            url = "https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.4-linux-x86_64.tar.gz";
            sha256 = "sha256-gN7DUdGlk+itFSY2lxpI0Mgb/Pq5LIfzYEZjYW8ei8U=";
          };
          installPhase = ''
            mkdir -p $out
            cp -r * $out
          '';
        };
      in
      {
        # development environment
        devShells.default = pkgs.mkShell {
          packages = [
            julia_15
          ];

          shellHook = ''
            export JULIA_NUM_THREADS="auto"
            export JULIA_PROJECT="turing"
            export JULIA_BINDIR=${julia_15}/bin
            export JULIA_EDITOR="code"
            echo "Nix shell loaded."
          '';
        };
      }
    );
}

But I might be missing something since I get the infamous error:

 ❮onyr ★ nixos❯ ❮BaPCodVRPSolver.jl❯❯ nix develop 
Nix shell loaded.
 ❮onyr ★ nixos❯ ❮BaPCodVRPSolver.jl❯❯ julia
Could not start dynamically linked executable: julia
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

Any help / advice / readings welcomed.

EDIT 1

So I managed to find a commit hash for nixpkgs with the version of Julia I’m looking for and it just works. Continuing on the packaging process…

Now I need to get CPLEX 12.10 which is another challenge.

So, I guess I managed to go pretty far. Both BaPCod and CPLEX are installed, and I just tried to run VrpSolver julia interface. But I get:

 ❮onyr ★ nixos❯ ❮BaPCodVRPSolver.jl❯❯ julia vrpsolver/src/run.jl vrpsolver/data/100/C204.txt --cfg vrpsolver/config/VRPTW_set_2.cfg
Application parameters:
  batch  =>  nothing
  tikz  =>  nothing
  instance  =>  "vrpsolver/data/100/C204.txt"
  out  =>  nothing
  nosolve  =>  false
  ub  =>  1.0e7
  sol  =>  nothing
  cfg  =>  "vrpsolver/config/VRPTW_set_2.cfg"
  enable_cap_res  =>  false
 solve 
ERROR: LoadError: could not load library "/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so"
/nix/store/26v9009yj6yyz60261523pzvbj2vv4jc-gfortran-9.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so)
Stacktrace:
 [1] macro expansion at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/bapcod/bc_common.jl:12 [inlined]
 [2] new!(::String, ::Bool, ::Bool, ::Bool, ::Int32, ::Array{String,1}) at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/bapcod/wrapper/model.jl:19
 [3] BaPCodVRPSolver.BaPCod.BcModel(; param_file::String, print_param::Bool, integer_objective::Bool, baptreedot_file::String, user_params::String) at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/bapcod/bc_model.jl:20
 [4] BaPCodVRPSolver.BaPCod.BcMathProgModel(::BaPCodVRPSolver.BaPCod.BaPCodSolver) at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/bapcod/BaPCodSolverInterface.jl:132
 [5] LinearQuadraticModel at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/bapcod/BaPCodSolverInterface.jl:134 [inlined]
 [6] build(::Model; suppress_warnings::Bool, relaxation::Bool, traits::JuMP.ProblemTraits) at /home/onyr/.julia/packages/JuMP/I7whV/src/solvers.jl:358
 [7] solve(::Model; suppress_warnings::Bool, ignore_solve_hook::Bool, relaxation::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/onyr/.julia/packages/JuMP/I7whV/src/solvers.jl:168
 [8] vrp_hook(::Model; suppress_warnings::Bool, relaxation::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/BaPCodVRPSolver.jl:2425
 [9] solve(::Model; suppress_warnings::Bool, ignore_solve_hook::Bool, relaxation::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/onyr/.julia/packages/JuMP/I7whV/src/solvers.jl:151
 [10] solve at /home/onyr/.julia/packages/JuMP/I7whV/src/solvers.jl:150 [inlined]
 [11] optimize!(::VrpOptimizer) at /home/onyr/code/phd/BaPCodVRPSolver.jl/src/BaPCodVRPSolver.jl:1767
 [12] run_vrptw(::Dict{String,Any}) at /home/onyr/code/phd/BaPCodVRPSolver.jl/vrpsolver/src/run.jl:61
 [13] main(::Array{String,1}) at /home/onyr/code/phd/BaPCodVRPSolver.jl/vrpsolver/src/run.jl:101
 [14] top-level scope at /home/onyr/code/phd/BaPCodVRPSolver.jl/vrpsolver/src/run.jl:108
 [15] include(::Function, ::Module, ::String) at /nix/store/s5ydxxzjjahgq3jj6jissi2m5qgwh1hw-julia-1.5.4/lib/julia/sys.so:? (repeats 2 times)
 [16] exec_options(::Base.JLOptions) at /nix/store/s5ydxxzjjahgq3jj6jissi2m5qgwh1hw-julia-1.5.4/lib/julia/sys.so:?
 [17] _start() at /nix/store/s5ydxxzjjahgq3jj6jissi2m5qgwh1hw-julia-1.5.4/lib/julia/sys.so:?
in expression starting at /home/onyr/code/phd/BaPCodVRPSolver.jl/vrpsolver/src/run.jl:105

Indeed, I was expecting something like that to happen since the README says:

Troubleshooting

On Linux, you may have error:


ERROR: LoadError: could not load library "<path to>/libbapcod-shared.so"

<path to Julia>/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by "<path to>/libbapcod-shared.so")

This is because Julia comes with an older version of the libstdc++.so.6 library. One solution is build Julia from sources.

An easier solution is to replace file <path to Julia>/lib/julia/libstdc++.so.6 with your system libstdc++.so.6 file. For local machines it is usually located in the folder /usr/lib/x86_64-linux-gnu/.

Which rises from this code snippet:

if !haskey(ENV, "BAPCOD_RCSP_LIB")
  error("The env. variable BAPCOD_RCSP_LIB was not set with the BaPCod+RCSP library path!")
end

libdevjulia = ENV["BAPCOD_RCSP_LIB"]

## ccall redef
macro bcm_ccall(func, args...)
  f = "bcInterfaceModel_$(func)"
  args = map(esc, args)
  return quote
    ccall(($f, $libdevjulia), $(args...))
  end
end

This calls the BaPCod libbapcod-shared.so file.

So I have two options:

  1. Find a way to change the path that Julia is looking for, directly in my flake, although since julia packages are immutable, I doubt this is even possible…
  2. Modify julia derivation so it builds a version that has a working libstdc++.so.6… The README doesn’t really specify which version to use but since so far everything works using Nixpkgs channel "github:NixOS/nixpkgs/nixos-22.11" I guess using a depencency for gfortran from this channel would work.

Looking at the build file for Julia 1.5.4 directly from an old commit of Nixpkgs (see on GitHub) I see:

{ lib, stdenv, fetchzip
# build tools
, gfortran, m4, makeWrapper, patchelf, perl, which, python2, cmake
# libjulia dependencies
, libunwind, readline, utf8proc, zlib
# standard library dependencies
, curl, fftwSinglePrec, fftw, libgit2, mpfr, openlibm, openspecfun, pcre2
# linear algebra
, blas, lapack, arpack
# Darwin frameworks
, CoreServices, ApplicationServices
}:

So indeed, Julia 1.5.4 depends on gfortran. How could I override it so that it uses gfortran from channel nixos-22.11 instead of this older derivation ?

Here is my flake so far:

{
  description = "Julia 1.5 environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";

    nixpkgs-julia-15.url = "github:NixOS/nixpkgs/75a93dfecc6c77ed7c35cc7f906175aca93facb4"; # Pin to the specific commit

    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, nixpkgs-julia-15, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlay-nixpkgs-julia-15 = final: prev: {
          # Use the non-flake store path
          pkgs-julia-15 = import nixpkgs-julia-15 { inherit system; };
        };

        pkgs = import nixpkgs {
          system = system;
          config.allowUnfree = true; # Allow unfree packages if needed
          overlays = [ overlay-nixpkgs-julia-15 ];
        };

        julia_15 = pkgs.pkgs-julia-15.julia_15.overrideDerivation (oldAttrs: { doInstallCheck = false; });
      in {
        devShells.default = pkgs.mkShell {
          packages = [
            julia_15 # Use specific Julia 1.5.4

            pkgs.cmake
            pkgs.gcc
            pkgs.gdb
            pkgs.zlib
            pkgs.unzip

          ];

          shellHook = ''
            export JULIA_NUM_THREADS="auto"
            export JULIA_PROJECT="."
            export JULIA_BINDIR=${julia_15}/bin
            export JULIA_EDITOR="code"
            alias julia=${julia_15}/bin/julia
            export LD_LIBRARY_PATH=/home/onyr/cplex1210/cplex/bin/x86-64_linux:$LD_LIBRARY_PATH
            export CPLEX_ROOT=/home/onyr/cplex1210
            export BAPCOD_ROOT=/home/onyr/bapcod/bapcod-0.82.8
            export BOOST_ROOT=/home/onyr/bapcod/bapcod-0.82.8/Tools/boost_1_76_0/build
            export BAPCOD_RCSP_LIB=/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so
            echo "Julia 1.5 Nix shell loaded."
          '';
        };
      });
}

I want to patch Julia 1.5.4 so it uses the lib from gcc11 !

I get the error:

ERROR: LoadError: could not load library "/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so"
/nix/store/26v9009yj6yyz60261523pzvbj2vv4jc-gfortran-9.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so)

When trying to run the Julia interface to BapCod (VrpSolver).

I have spent a great deal of time understanding the problem. So the issue is that I’m compiling BaPCod using pkgs.gcc11, and using julia 1.5.4 that links an outdated libstdc++.so.6.

So I need to rebuild or patch Julia 1.5.4 to update this file. I tried forcing the rebuild of Julia using gcc11 but it doesn’t work. Julia 1.5 on Nix typically ships (or references) a “private” libstdc++: /nix/store/26v9009yj6yyz60261523pzvbj2vv4jc-gfortran-9.3.0-lib/lib/libstdc++.so.6. Even if I rebuilt Julia with a newer GCC, or replaced one library, there may still be references to the old gfortran-9.3.0 store path in either:

  • Julia’s own libraries (e.g. libjulia.so, sys.so, or an embedded libstdc++.so.6).
  • Transitive dependencies that were not recompiled in your new derivation.

Then, when Julia loads libbapcod-shared.so (which wants a newer GLIBCXX_3.4.29), the dynamic linker sees that Julia already loaded an older libstdc++.so.6 from GCC 9.3.0, and tries to resolve symbols from there—leading to the mismatch.

Here is what I have so far:

{
  description = "Julia 1.5 environment with post-fixup patching of old libstdc++ references, no full rebuild";

  # We only support x86_64-linux to simplify
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
    # Pin an old Nixpkgs commit which has Julia 1.5
    nixpkgs-julia-15.url = "github:NixOS/nixpkgs/75a93dfecc6c77ed7c35cc7f906175aca93facb4";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, nixpkgs-julia-15, flake-utils, ... }:
    flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
    let
      # An overlay that imports the old Julia 1.5 expression
      # and patches references to libstdc++.so.6 in postFixup
      overlayNixpkgsJulia15 = final: prev: {
        pkgs-julia-15 = import nixpkgs-julia-15 {
          inherit (final) system;
          overlays = [
            (final2: prev2: {
              # 1) We get the *original* Julia 1.5 derivation
              # 2) Then overrideAttrs to inject patchelf and do a manual replace
              julia_15 = prev2.julia_15.overrideAttrs (old: {
                nativeBuildInputs =
                  (old.nativeBuildInputs or [])
                  ++ [ final2.patchelf ];  # so we can run patchelf in postFixup

                postFixup = (old.postFixup or "") + ''
                  echo "=== Patching Julia references to old libstdc++.so.6 ==="
                  
                  # Path to the new libstdc++ from GCC 11 in nixpkgs 22.11:
                  newLibstdcxx="${pkgs.gcc11.cc.lib}/lib/libstdc++.so.6"

                  # check if file exists
                  if [ ! -f "$newLibstdcxx" ]; then
                    echo "ERROR: New libstdc++ not found at: $newLibstdcxx"
                    exit 1
                  fi

                  # We just replace ANY use of "libstdc++.so.6" with the new path.
                  # This is a brute-force approach that works if the old reference is also named libstdc++.so.6
                  # (If it references the *full store path*, see further below.)
                  #
                  # Usually we want to patch:
                  #   - $out/bin/julia
                  #   - any .so's in $out/lib/julia/

                  for f in $out/bin/* $out/lib/julia/*; do
                    if [ -f "$f" ]; then
                      # Check if it's an ELF binary first:
                      if file "$f" | grep -q ELF; then
                        echo "Patching $f ..."
                        patchelf --replace-needed \
                          libstdc++.so.6 \
                          "$newLibstdcxx" \
                          "$f" || true
                      fi
                    fi
                  done

                  echo "=== Finished patching Julia ==="
                '';
              });
            })
          ];
        };
      };

      # Bring in main nixpkgs with overlays
      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true;
        overlays = [ overlayNixpkgsJulia15 ];
      };

      # Our "patched" Julia 1.5 derivation
      julia15Patched = pkgs.pkgs-julia-15.julia_15;

    in {
      # We create a devShell that uses the patched Julia plus some other tools
      devShells.default = pkgs.mkShell {
        packages = [
          julia15Patched

          pkgs.cmake
          pkgs.gcc   # includes gcc11 if you want to compile BaPCod in this shell
          pkgs.gdb
          pkgs.zlib
          pkgs.unzip
        ];

        shellHook = ''
          export JULIA_NUM_THREADS="auto"
          export JULIA_PROJECT="."
          export JULIA_BINDIR='${julia15Patched}/bin'
          alias julia='${julia15Patched}/bin/julia'
          export JULIA_EDITOR="code"

          echo "Julia 1.5 (post-fixup patched) is at: ${julia15Patched}"
          echo "Julia dev shell loaded."

          # If you need your custom libraries:
          export LD_LIBRARY_PATH=/home/onyr/cplex1210/cplex/bin/x86-64_linux:$LD_LIBRARY_PATH
          export CPLEX_ROOT=/home/onyr/cplex1210
          export BAPCOD_ROOT=/home/onyr/bapcod/bapcod-0.82.8
          export BOOST_ROOT=/home/onyr/bapcod/bapcod-0.82.8/Tools/boost_1_76_0/build
          export BAPCOD_RCSP_LIB=/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so

          echo "Done entering dev shell."
        '';
      };
    }
  );
}

This flake doesn’t succeed to rebuild and correctly patch Julia. I don’t succeed with patchelf

Here are a lot of logs to get more info on the issue:

 ❮onyr ★ nixos❯ ❮~❯❯ nix-shell -p patchelf

[nix-shell:~]$ patchelf --print-needed /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so
libcplex12100.so
libcplex12100mpitransport.so
libcplex12100mpiworker.so
libcplex12100processtransport.so
libcplex12100processworker.so
libcplex12100remote.so
libcplex12100remotejni.so
libcplex12100tcpiptransport.so
libcplex12100tcpipworker.so
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6

[nix-shell:~]$ patchelf --print-rpath /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so
/home/onyr/bapcod/bapcod-0.82.8/Tools/boost_1_76_0/build/include:/home/onyr/bapcod/bapcod-0.82.8/Tools/rcsp/lib:/home/onyr/cplex1210/cplex/bin/x86-64_linux:/home/onyr/code/phd/BaPCodVRPSolver.jl/outputs/out/lib64:/home/onyr/code/phd/BaPCodVRPSolver.jl/outputs/out/lib:/nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib:/nix/store/6plx60y4x4q2lfp6n7190kaihyxr7m1w-gcc-11.3.0-lib/lib

[nix-shell:~]$ ldd /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libpthread.so.0)
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libpthread.so.0)
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libdl.so.2)
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libdl.so.2)
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/librt.so.1)
/home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so: /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/librt.so.1)
	linux-vdso.so.1 (0x00007fff760a5000)
	libcplex12100.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100.so (0x00007f513a800000)
	libcplex12100mpitransport.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100mpitransport.so (0x00007f513a400000)
	libcplex12100mpiworker.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100mpiworker.so (0x00007f5139e00000)
	libcplex12100processtransport.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100processtransport.so (0x00007f5139a00000)
	libcplex12100processworker.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100processworker.so (0x00007f5139400000)
	libcplex12100remote.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100remote.so (0x00007f5138e00000)
	libcplex12100remotejni.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100remotejni.so (0x00007f5136800000)
	libcplex12100tcpiptransport.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100tcpiptransport.so (0x00007f5136400000)
	libcplex12100tcpipworker.so => /home/onyr/cplex1210/cplex/bin/x86-64_linux/libcplex12100tcpipworker.so (0x00007f5135e00000)
	libstdc++.so.6 => /nix/store/6plx60y4x4q2lfp6n7190kaihyxr7m1w-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007f5135a00000)
	libm.so.6 => /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libm.so.6 (0x00007f513d4e3000)
	libgcc_s.so.1 => /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libgcc_s.so.1 (0x00007f513d4c9000)
	libc.so.6 => /nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6 (0x00007f5135600000)
	libpthread.so.0 => /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libpthread.so.0 (0x00007f513d4c4000)
	libdl.so.2 => /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libdl.so.2 (0x00007f513d4bd000)
	librt.so.1 => /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/librt.so.1 (0x00007f513d4b8000)
	/nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib64/ld-linux-x86-64.so.2 (0x00007f513d5c9000)

[nix-shell:~]$ objdump -T /home/onyr/bapcod/bapcod-0.82.8/build/Bapcod/libbapcod-shared.so | grep GLIBCXX_ | head -n 10
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _Znam
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _ZNSo3putEc
0000000000000000      DO *UND*	0000000000000000 (GLIBCXX_3.4.21) _ZTINSt8ios_base7failureB5cxx11E
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4.15) _ZNSt8__detail15_List_node_base7_M_hookEPS0_
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4.21) _ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
0000000000000000      DO *UND*	0000000000000000 (GLIBCXX_3.4) _ZTVSt9basic_iosIcSt11char_traitsIcEE
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _ZNSt7codecvtIwc11__mbstate_tEC2Em
0000000000000000      DF *UND*	0000000000000000 (GLIBCXX_3.4) _ZNSt15basic_streambufIcSt11char_traitsIcEE9pbackfailEi

[nix-shell:~]$ objdump -T /nix/store/6plx60y4x4q2lfp6n7190kaihyxr7m1w-gcc-11.3.0-lib/lib/libstdc++.so.6 | grep GLIBCXX_ | head -n 10
00000000000f8fa0  w   DF .text	000000000000000c  GLIBCXX_3.4 _ZNKSbIwSt11char_traitsIwESaIwEE8capacityEv
000000000020b7a0  w   DO .data.rel.ro	0000000000000068  GLIBCXX_3.4.21 _ZTVNSt7__cxx1117moneypunct_bynameIwLb0EEE
00000000000f5e30  w   DF .text	0000000000000013  GLIBCXX_3.4 _ZNSsC1Ev
000000000015dfe0  w   DF .text	0000000000000021  GLIBCXX_3.4.21 _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv
0000000000124d90  w   DF .text	0000000000000024  GLIBCXX_3.4 _ZNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEED0Ev
000000000019e360 g    DO .rodata	0000000000000001  GLIBCXX_3.4 _ZNSt14numeric_limitsIjE15tinyness_beforeE
0000000000102190  w   DF .text	000000000000000a  GLIBCXX_3.4.21 _ZNKSt7__cxx118time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE8get_dateES4_S4_RSt8ios_baseRSt12_Ios_IostateP2tm
0000000000106590  w   DF .text	0000000000000102  GLIBCXX_3.4.21 _ZNSt7__cxx1115messages_bynameIcEC2EPKcm
00000000000c21a0  w   DF .text	00000000000001ca  GLIBCXX_3.4 _ZStrsIfwSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E
0000000000146b10  w   DF .text	000000000000000a  GLIBCXX_3.4 _ZNSt15basic_streambufIcSt11char_traitsIcEE8overflowEi

[nix-shell:~]$ objdump -T /nix/store/26v9009yj6yyz60261523pzvbj2vv4jc-gfortran-9.3.0-lib/lib/libstdc++.so.6 | grep GLIBCXX_ | head -n 10
00000000000efd90  w   DF .text	0000000000000008  GLIBCXX_3.4 _ZNKSbIwSt11char_traitsIwESaIwEE8capacityEv
00000000001d6900  w   DO .data.rel.ro	0000000000000068  GLIBCXX_3.4.21 _ZTVNSt7__cxx1117moneypunct_bynameIwLb0EEE
00000000000ece00  w   DF .text	000000000000000f  GLIBCXX_3.4 _ZNSsC1Ev
0000000000156da0  w   DF .text	0000000000000019  GLIBCXX_3.4.21 _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_disposeEv
000000000011a480  w   DF .text	0000000000000020  GLIBCXX_3.4 _ZNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEED0Ev
000000000018b4c0 g    DO .rodata	0000000000000001  GLIBCXX_3.4 _ZNSt14numeric_limitsIjE15tinyness_beforeE
00000000000f8440  w   DF .text	0000000000000006  GLIBCXX_3.4.21 _ZNKSt7__cxx118time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE8get_dateES4_S4_RSt8ios_baseRSt12_Ios_IostateP2tm
00000000000fc940  w   DF .text	00000000000000fe  GLIBCXX_3.4.21 _ZNSt7__cxx1115messages_bynameIcEC2EPKcm
00000000000bc190  w   DF .text	00000000000001c6  GLIBCXX_3.4 _ZStrsIfwSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E
000000000013f310  w   DF .text	0000000000000006  GLIBCXX_3.4 _ZNSt15basic_streambufIcSt11char_traitsIcEE8overflowEi

 ❮onyr ★ nixos❯ ❮VehicleRoutingWithTimeWindowsDemo❯❯ file $(which julia)
/nix/store/s5ydxxzjjahgq3jj6jissi2m5qgwh1hw-julia-1.5.4/bin/julia: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/v8q6nxyppy1myi3rxni2080bv8s9jxiy-glibc-2.32-40/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped

I’m really struggling with patching / rebuilding Julia, so any tips or help on how to update its ELF to reference the newer lib from gcc11 is welcomed.