From 2407381c3d3ebbf56b093701a9d9cb066216ebf8 Mon Sep 17 00:00:00 2001 From: kiwiwarmnfuzzy <108398132+kiwiwarmnfuzzy@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:24:22 +0200 Subject: [PATCH] Force auc.cc to be statically linked (#8039) --- src/metric/auc.cc | 2 ++ src/metric/metric.cc | 1 + 2 files changed, 3 insertions(+) diff --git a/src/metric/auc.cc b/src/metric/auc.cc index 0750e9936..d7a7fff4a 100644 --- a/src/metric/auc.cc +++ b/src/metric/auc.cc @@ -25,6 +25,8 @@ namespace xgboost { namespace metric { +// tag the this file, used by force static link later. +DMLC_REGISTRY_FILE_TAG(auc); /** * Calculate AUC for binary classification problem. This function does not normalize the * AUC by 1 / (num_positive * num_negative), instead it returns a tuple for caller to diff --git a/src/metric/metric.cc b/src/metric/metric.cc index e2ee04cf4..f6c1d53bb 100644 --- a/src/metric/metric.cc +++ b/src/metric/metric.cc @@ -78,6 +78,7 @@ DMLC_REGISTRY_ENABLE(::xgboost::MetricGPUReg); namespace xgboost { namespace metric { // List of files that will be force linked in static links. +DMLC_REGISTRY_LINK_TAG(auc); DMLC_REGISTRY_LINK_TAG(elementwise_metric); DMLC_REGISTRY_LINK_TAG(multiclass_metric); DMLC_REGISTRY_LINK_TAG(survival_metric);