|
Entropic 2.3.8
Local-first agentic inference engine
|
Bundled data directory resolution. More...
#include <entropic/config/loader.h>#include <entropic/entropic_config.h>#include <entropic/types/logging.h>#include <cstdlib>#include <vector>#include <dlfcn.h>
Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| static std::filesystem::path | entropic::config::share_dir_from_library () |
Locate librentropic.so on disk and derive its sibling share dir. | |
| ENTROPIC_EXPORT std::filesystem::path | entropic::config::resolve_data_dir (const ParsedConfig &config) |
| Resolve the bundled data directory. | |
Variables | |
| static auto | s_log = entropic::log::get("config") |
| std::filesystem::path entropic::config::resolve_data_dir | ( | const ParsedConfig & | config | ) |
Resolve the bundled data directory.
Priority:
| config | Parsed config. |
Priority (v2.0.5.1):
ENTROPIC_DATA_DIR env var (explicit operator override)config.config_dir / "data" (project-specific override)<prefix>/share/entropic derived from librentropic.so's on-disk location. Portable across install prefixes regardless of build-time CMAKE_INSTALL_PREFIX.CONFIG_ENTROPIC_DATA_DIR (compile-time install path, last resort; historically unreliable for relocated installs).CONFIG_ENTROPIC_SOURCE_DATA_DIR + CWD-relative data/ (development fallback when running from the build tree).First path that is_directory() on disk wins.
| config | Parsed config. |
Definition at line 81 of file data_dir.cpp.
|
static |
Locate librentropic.so on disk and derive its sibling share dir.
The install layout is <prefix>/lib/librentropic.so + <prefix>/share/entropic/. dladdr() on any symbol within librentropic resolves to the .so's on-disk path, from which we can compute ../share/entropic relative to the library. This makes the installed package portable: no absolute paths baked at build time, no dependency on the consumer extracting to the same prefix the packager built with.
<prefix>/share/entropic path, or empty if dladdr fails (e.g. statically linked with no exported symbols). Definition at line 37 of file data_dir.cpp.
|
static |
Definition at line 17 of file data_dir.cpp.