From nobody Thu Dec 14 17:03:37 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SrdwV3crgz52kpy; Thu, 14 Dec 2023 17:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrdwV1SRnz3Zkv; Thu, 14 Dec 2023 17:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702573418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8sfEDjmcp+47KzeIaLnmiq+KPfnzXRhvbp2T4mP324U=; b=hchfede6CTlI7YqEb+yjuBauYgIx8JoWn/5hEtSNzeLWr1pA1sarS2VX2+AzIPbTcFjIga 1LYYv3FJzoEolowtaSxJF13qCBvgj5ZVy2scPD0XjilsvMd9jVjuK4l7wPyx3ShxlezzeD 3h0AwIMKEjAfbdnPrzUrMQTNb+3HIQETwFB/HHmNK1Iis7UHzpoGKVSqzjZMkgIpz4W60I C4UhjkeSkvUwyLuVVD/JHFLwWnbQvvT5uvos2qE/62VVFppuou+pnSQJpxgyyo27qQ01FD 9ukwELv3lYrSjGyzf3KVIjvHgCgd1HWYZSv4Ppbd/CM/jnS74eLKiit+UxUq4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702573418; a=rsa-sha256; cv=none; b=B9u42ENWm/lYyiCmcRwXSACnqX3b5yLWpbnZ2QTOu5qzbTP+oi61wxiC0cOR+ZRkwyMoUC tYSfAmoUZuI8NwxjK24oZA15JNluXz790zIyeAsWzw+wqiLjzf1NP0VZc/GBnDXY/pTfKL +sM/qgEQWtvIjw6Qy615WC9ATloX+sYy21lvHCRBqCU+R5BLdS8QQ+Tujxzzse/BRoTDkt cHuz+dfRRFkvjm8z+BXEAhFwUbAcyn9JwlDlBTii7tomEIHXqKRNkpbt9Pe6Sz1a7tnrms PCZcw8BsBNeduP81dfEQX0vamg8TlSp1qqBFBatUpd65SqQngiGPM1bXDRz7Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702573418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8sfEDjmcp+47KzeIaLnmiq+KPfnzXRhvbp2T4mP324U=; b=I4jYbzWXXsGa4Aj35765fQDYZgcxkOcPq1Y+Wzs+PBCbMuIMk9MuM6Cdfh69c0xgwPxmWo Ji+T0tjvj68THsJVXV/UiMYGG7AiZ8Y9wt2HEJETgII/ER2dBAA8btVmIRk48cBfxYmjvX v36Ozs53aMdlMN6Ab51o3WTAdWaJdZ68KXtxmUEqA1iVEXFa9qvc4Hu3wAYHQTh6rlvSsy yH8PNyY4jFGelubBmiY0nYOXugGafg2YAuD+u99tziEqNDfnd14DXgk66XRKvkiE7BoxiP WQ5aSXUpkwJTvWM2P4fJKW2HpI5BuM3iTu1oWgrNNtLRF+cKeEsjpFNJZB4naQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SrdwV0Z2rzbWg; Thu, 14 Dec 2023 17:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEH3bk3017154; Thu, 14 Dec 2023 17:03:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEH3bpr017150; Thu, 14 Dec 2023 17:03:37 GMT (envelope-from git) Date: Thu, 14 Dec 2023 17:03:37 GMT Message-Id: <202312141703.3BEH3bpr017150@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 22f31cfa3606 - main - misc/lbann: Fix build with protobuf 22+ List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22f31cfa360640812df820452e62c8de2e6cf795 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=22f31cfa360640812df820452e62c8de2e6cf795 commit 22f31cfa360640812df820452e62c8de2e6cf795 Author: Po-Chuan Hsieh AuthorDate: 2023-12-14 16:22:39 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-12-14 17:03:06 +0000 misc/lbann: Fix build with protobuf 22+ - While I'm here, remove patch-cmake_modules_SetupProtobuf.cmake which is no longer needed now --- misc/lbann/Makefile | 5 +- .../files/patch-cmake_modules_SetupProtobuf.cmake | 13 ---- misc/lbann/files/patch-protobuf | 78 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 15 deletions(-) diff --git a/misc/lbann/Makefile b/misc/lbann/Makefile index 1f145f969d1c..86a29e0283a7 100644 --- a/misc/lbann/Makefile +++ b/misc/lbann/Makefile @@ -21,7 +21,7 @@ LIB_DEPENDS= libconduit.so:science/conduit \ libprotobuf.so:devel/protobuf \ libsiloh5.so:science/silo -USES= cmake:testing compiler:c++17-lang localbase pkgconfig +USES= cmake:testing compiler:c++17-lang localbase:ldflags pkgconfig USE_GITHUB= yes GH_ACCOUNT= LLNL @@ -41,7 +41,8 @@ CMAKE_OFF= LBANN_WITH_CNPY \ CMAKE_ON= LBANN_USE_PROTOBUF_MODULE CMAKE_TESTING_ON= LBANN_WITH_UNIT_TESTING # requires MPI cluster -LDFLAGS+= -lexecinfo +LDFLAGS+= -labsl_hash -labsl_log_internal_message -labsl_log_internal_nullguard -labsl_spinlock_wait -lexecinfo +USE_CXXSTD= c++17 OPTIONS_SINGLE= MPI OPTIONS_SINGLE_MPI= MPICH OPENMPI diff --git a/misc/lbann/files/patch-cmake_modules_SetupProtobuf.cmake b/misc/lbann/files/patch-cmake_modules_SetupProtobuf.cmake deleted file mode 100644 index 7ad9e788ca42..000000000000 --- a/misc/lbann/files/patch-cmake_modules_SetupProtobuf.cmake +++ /dev/null @@ -1,13 +0,0 @@ -- https://gitlab.kitware.com/cmake/cmake/-/issues/24218 - ---- cmake/modules/SetupProtobuf.cmake.orig 2022-12-02 19:45:09 UTC -+++ cmake/modules/SetupProtobuf.cmake -@@ -65,7 +65,7 @@ else () - PATH_SUFFIXES lib64/cmake/protobuf lib/cmake/protobuf - NO_DEFAULT_PATH) - if(NOT Protobuf_FOUND) -- find_package(Protobuf "${PROTOBUF_MIN_VERSION}" CONFIG QUIET REQUIRED) -+ find_package(Protobuf "${PROTOBUF_MIN_VERSION}" QUIET REQUIRED) - endif () - message(STATUS "Found Protobuf: ${Protobuf_DIR}") - endif () diff --git a/misc/lbann/files/patch-protobuf b/misc/lbann/files/patch-protobuf new file mode 100644 index 000000000000..fae535a200d7 --- /dev/null +++ b/misc/lbann/files/patch-protobuf @@ -0,0 +1,78 @@ +--- src/utils/protobuf.cpp.orig 2022-11-12 00:17:51 UTC ++++ src/utils/protobuf.cpp +@@ -41,9 +41,8 @@ + // should be refactored to use the specialized "zero-copy" streams + // that ship with protobuf. + +-namespace pb = google::protobuf; +-static pb::FieldDescriptor const* +-get_oneof_field_descriptor(pb::Message const& msg, ++static google::protobuf::FieldDescriptor const* ++get_oneof_field_descriptor(google::protobuf::Message const& msg, + std::string const& oneof_name) + { + auto oneof_handle = msg.GetDescriptor()->FindOneofByName(oneof_name); +@@ -52,14 +51,14 @@ get_oneof_field_descriptor(pb::Message const& msg, + return msg.GetReflection()->GetOneofFieldDescriptor(msg, oneof_handle); + } + +-bool lbann::protobuf::has_oneof(pb::Message const& msg, ++bool lbann::protobuf::has_oneof(google::protobuf::Message const& msg, + std::string const& oneof_name) + { + return (bool)get_oneof_field_descriptor(msg, oneof_name); + } + +-pb::Message const& +-lbann::protobuf::get_oneof_message(pb::Message const& msg, ++google::protobuf::Message const& ++lbann::protobuf::get_oneof_message(google::protobuf::Message const& msg, + std::string const& oneof_name) + { + auto oneof_field = get_oneof_field_descriptor(msg, oneof_name); +@@ -71,7 +70,7 @@ lbann::protobuf::get_oneof_message(pb::Message const& + "}\n"); + } + +- if (oneof_field->type() != pb::FieldDescriptor::TYPE_MESSAGE) { ++ if (oneof_field->type() != google::protobuf::FieldDescriptor::TYPE_MESSAGE) { + LBANN_ERROR("Oneof \"", + oneof_name, + "\" has field \"", +@@ -105,15 +104,15 @@ static std::string remove_scope_from_type(std::string + return type.substr(pos + 1); + } + +-std::string lbann::protobuf::message_type(pb::Message const& msg) ++std::string lbann::protobuf::message_type(google::protobuf::Message const& msg) + { + return msg.GetDescriptor()->name(); + } + +-std::string lbann::protobuf::message_type(pb::Any const& msg) ++std::string lbann::protobuf::message_type(google::protobuf::Any const& msg) + { + std::string full_type; +- pb::Any::ParseAnyTypeUrl(msg.type_url(), &full_type); ++ google::protobuf::Any::ParseAnyTypeUrl(msg.type_url(), &full_type); + return remove_scope_from_type(full_type); + } + +@@ -171,7 +170,7 @@ void lbann::protobuf::text::fill(std::istream& is, + void lbann::protobuf::text::fill(std::string const& str, + google::protobuf::Message& msg) + { +- if (!pb::TextFormat::ParseFromString(str, &msg)) ++ if (!google::protobuf::TextFormat::ParseFromString(str, &msg)) + LBANN_ERROR("Unable to parse prototext from string."); + } + +@@ -187,7 +186,7 @@ void lbann::protobuf::text::write(std::ostream& os, + google::protobuf::Message const& msg) + { + google::protobuf::io::OstreamOutputStream output(&os); +- if (!pb::TextFormat::Print(msg, &output)) ++ if (!google::protobuf::TextFormat::Print(msg, &output)) + LBANN_ERROR("Failed to print prototext to stream."); + } +