<commit_before># Since Julia recently changed its behavior so that it cannot automatically
# resolve shared libraries in the same directory as the library being loaded,
# this file now hackily attempts to optionally load libEl's dependencies
# before requiring that libEl loads

macro checked_lib_opt(lib)
    libname = join((lib, Libdl.dlext), ".")
    libdir  = abspath(joinpath(dirname(@__FILE__), "usr", "lib"))
    libpath = joinpath(libdir, libname)
    if Libdl.dlopen_e(libpath) != C_NULL
      return quote
          const $(esc(lib)) = $libpath
      end
    end
end

macro checked_lib(lib)
    libname = join((lib, Libdl.dlext), ".")
    libdir  = abspath(joinpath(dirname(@__FILE__), "usr", "lib"))
    libpath = joinpath(libdir, libname)
    if Libdl.dlopen_e(libpath) == C_NULL
        error("Unable to load $libname\n($libpath)\nPlease re-run Pkg.build(\"Elemental\"), and restart Julia.")
    end
    return quote
        const $(esc(lib)) = $libpath
    end
end
@checked_lib_opt libmetis
@checked_lib_opt libparmetis
@checked_lib_opt libpmrrr<commit_msg>Removing manual loading of library dependencies due to Julia's dlopen behaviour being improved<commit_after># Since Julia recently changed its behavior so that it cannot automatically
# resolve shared libraries in the same directory as the library being loaded,
# this file now hackily attempts to optionally load libEl's dependencies
# before requiring that libEl loads
#
# NOTE: This behaviour was fixed by <NAME>; the fix will be left
#       commented out in case of a future regression

macro checked_lib_opt(lib)
    libname = join((lib, Libdl.dlext), ".")
    libdir  = abspath(joinpath(dirname(@__FILE__), "usr", "lib"))
    libpath = joinpath(libdir, libname)
    if Libdl.dlopen_e(libpath) != C_NULL
      return quote
          const $(esc(lib)) = $libpath
      end
    end
end

macro checked_lib(lib)
    libname = join((lib, Libdl.dlext), ".")
    libdir  = abspath(joinpath(dirname(@__FILE__), "usr", "lib"))
    libpath = joinpath(libdir, libname)
    if Libdl.dlopen_e(libpath) == C_NULL
        error("Unable to load $libname\n($libpath)\nPlease re-run Pkg.build(\"Elemental\"), and restart Julia.")
    end
    return quote
        const $(esc(lib)) = $libpath
    end
end
#@checked_lib_opt libmetis
#@checked_lib_opt libparmetis
#@checked_lib_opt libpmrrr
{'fraction_non_alphanumeric': 0.10528559249786872, 'fraction_numerical': 0.0, 'mean_word_length': 3.930672268907563, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5469178', 'n_tokens_mistral': 745, 'n_tokens_neox': 731, 'n_words': 233}