[packages/dmlc-core] - added azure storage support
qboosh
qboosh at pld-linux.org
Sun May 17 10:14:49 CEST 2026
commit de8a6ee9ba209ee63df1dc68cea73e9f201d7d49
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun May 17 10:14:46 2026 +0200
- added azure storage support
dmlc-core-azure.patch | 32 ++++++++++++++++++++++++++++++++
dmlc-core.spec | 7 ++++++-
2 files changed, 38 insertions(+), 1 deletion(-)
---
diff --git a/dmlc-core.spec b/dmlc-core.spec
index 3e5c9a3..8918574 100644
--- a/dmlc-core.spec
+++ b/dmlc-core.spec
@@ -1,10 +1,10 @@
# TODO:
# USE_HDFS (BR: hdfs.h, libhdfs, hadoop executable, JDK/JNI)
-# USE_AZURE (BR: cpprestsdk, azure-storage-cpp)
#
# Conditional build:
%bcond_without apidocs # API documentation
%bcond_without openmp # OpenMP support
+%bcond_without azure # Azure Storage support
%bcond_without s3 # S3 storage support
#
Summary: Distributed Machine Learning Common Codebase
@@ -18,8 +18,11 @@ Group: Libraries
Source0: https://github.com/dmlc/dmlc-core/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: 5b2b24ab4dd39db51c53ef5e780ed8e2
Patch0: %{name}-no-forced-sse2.patch
+Patch1: %{name}-azure.patch
URL: https://github.com/dmlc/dmlc-core
+%{?with_azure:BuildRequires: azure-storage-cpp-devel}
BuildRequires: cmake >= 3.2
+%{?with_azure:BuildRequires: cpprestsdk-devel}
%{?with_s3:BuildRequires: curl-devel}
%{?with_openmp:BuildRequires: libgomp-devel}
BuildRequires: libstdc++-devel >= 6:5
@@ -73,12 +76,14 @@ Dokumentacja API biblioteki DMLC-Core.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
%build
install -d build
cd build
%cmake .. \
-DDMLC_HDFS_SHARED=ON \
+ %{?with_azure:-DUSE_AZURE=ON} \
%{!?with_openmp:-DUSE_OPENMP=OFF} \
%{?with_s3:-DUSE_S3=ON} \
-DUSE_CXX14_IF_AVAILABLE=ON
diff --git a/dmlc-core-azure.patch b/dmlc-core-azure.patch
new file mode 100644
index 0000000..e72227a
--- /dev/null
+++ b/dmlc-core-azure.patch
@@ -0,0 +1,32 @@
+--- dmlc-core-0.5/src/io/azure_filesys.cc.orig 2026-05-17 09:25:48.862464629 +0200
++++ dmlc-core-0.5/src/io/azure_filesys.cc 2026-05-17 09:47:42.482014807 +0200
+@@ -5,7 +5,6 @@
+ * \author Mu Li
+ */
+ #include "./azure_filesys.h"
+-#include "stdafx.h"
+
+ #include "was/storage_account.h"
+ #include "was/blob.h"
+@@ -31,9 +30,9 @@ std::vector<std::string> split(std::stri
+ AzureFileSystem::AzureFileSystem() {
+ const char *name = getenv("AZURE_STORAGE_ACCOUNT");
+ const char* key = getenv("AZURE_STORAGE_ACCESS_KEY");
+- CHECK_NE(name, NULL)
++ CHECK(name != nullptr) // CHECK_NE(name, nullptr) with nullptr requires C++17
+ << "Need to set enviroment variable AZURE_STORAGE_ACCOUNT to use Azure";
+- CHECK_NE(key, NULL)
++ CHECK(key != nullptr)
+ << "Need to set enviroment variable AZURE_STORAGE_ACCESS_KEY to use Azure";
+ azure_account_ = name;
+ azure_key_ = key;
+--- dmlc-core-0.5/CMakeLists.txt.orig 2026-05-17 10:00:33.134506491 +0200
++++ dmlc-core-0.5/CMakeLists.txt 2026-05-17 10:00:57.081043428 +0200
+@@ -97,6 +97,7 @@ endif()
+ # Azure configurations
+ if(USE_AZURE)
+ target_compile_definitions(dmlc PRIVATE -DDMLC_USE_AZURE=1)
++ target_link_libraries(dmlc PRIVATE azurestorage)
+ else()
+ target_compile_definitions(dmlc PRIVATE -DDMLC_USE_AZURE=0)
+ endif()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dmlc-core.git/commitdiff/de8a6ee9ba209ee63df1dc68cea73e9f201d7d49
More information about the pld-cvs-commit
mailing list