Make LMDB an optional dependency#473
Open
sruthi0107 wants to merge 2 commits into
Open
Conversation
LMDB is only needed for Caffe/Caffe2 LMDB readers. Gate all LMDB-dependent code behind ROCAL_LMDB, which CMake defines automatically when liblmdb is found. When LMDB is not present, the build succeeds and LMDB reader APIs return clear error messages at runtime. Changes: - CMake: LMDB discovery is no longer fatal; sets -DROCAL_LMDB when found - C++ headers/sources: wrap Caffe/Caffe2 LMDB readers and metadata readers with #ifdef ROCAL_LMDB - API layer: LMDB data loader and metadata functions throw descriptive errors when called without LMDB support - Pybind: conditionally expose LMDB bindings; Python layer checks availability with hasattr() before calling - Packaging: remove liblmdb-dev/lmdb-devel from required package lists - Setup script: comment out LMDB packages (now optional)
LMBD → LMDB, and note that it is only needed for Caffe/Caffe2 LMDB reader support.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #473 +/- ##
===========================================
+ Coverage 75.67% 75.69% +0.02%
===========================================
Files 318 318
Lines 26277 26289 +12
===========================================
+ Hits 19885 19899 +14
+ Misses 6392 6390 -2
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On some OS configurations, LMDB may not be available, causing the rocAL build to fail even though LMDB is only needed for
Caffe/Caffe2 LMDB readers. This change makes LMDB an optional dependency. When LMDB is not present, the build succeeds and LMDB reader APIs return clear error messages at runtime.
Technical Details
Test Plan
Three-phase validation:
develop, LMDB present)Each phase verifies:
web_dataset_reader, external_source, pipeline, pipeline_serialize, caffe_reader x2, caffe2_reader x2)
Test Result
Without LMDB, Caffe/Caffe2 reader tests produce clear RuntimeError: rocAL was built without LMDB support. No segfaults or undefined symbols.