From 41a0623fcc82c9ea9339e213fb0a7eacc86b900d Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Wed, 23 Jun 2021 20:14:55 +0200 Subject: [PATCH] feat: Require DDS 3.5.13.7 --- cmake/FairMQDependencies.cmake | 2 +- examples/dds/fairmq-start-ex-dds.sh.in | 8 +-- examples/n-m/fairmq-start-ex-n-m-dds.sh.in | 8 +-- .../n-m/fairmq-start-ex-n-m-pair-dds.sh.in | 8 +-- examples/qc/fairmq-start-ex-qc.sh.in | 9 +-- fairmq/sdk/DDSEnvironment.cxx | 56 +------------------ 6 files changed, 6 insertions(+), 85 deletions(-) diff --git a/cmake/FairMQDependencies.cmake b/cmake/FairMQDependencies.cmake index 6c25cf00..46fdbf44 100644 --- a/cmake/FairMQDependencies.cmake +++ b/cmake/FairMQDependencies.cmake @@ -28,7 +28,7 @@ if(BUILD_SDK_COMMANDS) endif() if(BUILD_DDS_PLUGIN OR BUILD_SDK) - find_package2(PRIVATE DDS REQUIRED VERSION 3.5.3) + find_package2(PRIVATE DDS REQUIRED VERSION 3.5.13.7) set(DDS_Boost_COMPONENTS system log log_setup regex filesystem thread) set(DDS_Boost_VERSION 1.67) endif() diff --git a/examples/dds/fairmq-start-ex-dds.sh.in b/examples/dds/fairmq-start-ex-dds.sh.in index bcadf6e5..93c3218e 100755 --- a/examples/dds/fairmq-start-ex-dds.sh.in +++ b/examples/dds/fairmq-start-ex-dds.sh.in @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ -# Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -18,12 +18,6 @@ cleanup() { echo "CLEANUP PERFORMED" } -if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then - source @DDS_INSTALL_PREFIX@/DDS_env.sh -elif command -v DDS_env.sh &> /dev/null; then - source DDS_env.sh -fi - export PATH=@BIN_DIR@:$PATH plugin=${1:-localhost} diff --git a/examples/n-m/fairmq-start-ex-n-m-dds.sh.in b/examples/n-m/fairmq-start-ex-n-m-dds.sh.in index 35fc3835..1173df7c 100755 --- a/examples/n-m/fairmq-start-ex-n-m-dds.sh.in +++ b/examples/n-m/fairmq-start-ex-n-m-dds.sh.in @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ -# Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -15,12 +15,6 @@ cleanup() { echo "CLEANUP PERFORMED" } -if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then - source @DDS_INSTALL_PREFIX@/DDS_env.sh -elif command -v DDS_env.sh &> /dev/null; then - source DDS_env.sh -fi - export PATH=@BIN_DIR@:$PATH exec 5>&1 diff --git a/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in b/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in index 9cd4dc1e..412f2e78 100755 --- a/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in +++ b/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ -# Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -15,12 +15,6 @@ cleanup() { echo "CLEANUP PERFORMED" } -if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then - source @DDS_INSTALL_PREFIX@/DDS_env.sh -elif command -v DDS_env.sh &> /dev/null; then - source DDS_env.sh -fi - export PATH=@BIN_DIR@:$PATH exec 5>&1 diff --git a/examples/qc/fairmq-start-ex-qc.sh.in b/examples/qc/fairmq-start-ex-qc.sh.in index 40d8baeb..ab7b2566 100755 --- a/examples/qc/fairmq-start-ex-qc.sh.in +++ b/examples/qc/fairmq-start-ex-qc.sh.in @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ -# Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -17,13 +17,6 @@ cleanup() { echo "CLEANUP PERFORMED" } - -if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then - source @DDS_INSTALL_PREFIX@/DDS_env.sh -elif command -v DDS_env.sh &> /dev/null; then - source DDS_env.sh -fi - export PATH=@BIN_DIR@:$PATH exec 5>&1 diff --git a/fairmq/sdk/DDSEnvironment.cxx b/fairmq/sdk/DDSEnvironment.cxx index c5331735..939c3f52 100644 --- a/fairmq/sdk/DDSEnvironment.cxx +++ b/fairmq/sdk/DDSEnvironment.cxx @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (C) 2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * + * Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * @@ -27,27 +27,10 @@ struct DDSEnvironment::Impl : fLocation(DDSInstallPrefix) , fConfigHome(std::move(configHome)) { - SetupLocation(); - SetupDynamicLoader(); SetupPath(); SetupConfigHome(); } - auto SetupLocation() -> void - { - std::string location(GetEnv("DDS_LOCATION")); - if (location != DDSInstallPrefix) { - if (location.empty()) { - setenv("DDS_LOCATION", DDSInstallPrefix.c_str(), 1); - } else { - LOG(debug) << "$DDS_LOCATION appears to point to a different installation than this" - << "program was linked against. Things might still work out, so not" - << "touching it."; - fLocation = location; - } - } - } - auto SetupConfigHome() -> void { if (fConfigHome.empty()) { @@ -55,22 +38,6 @@ struct DDSEnvironment::Impl } else { setenv("HOME", fConfigHome.c_str(), 1); } - - std::stringstream cmd; -#ifdef __APPLE__ - // On macOS System Integrity Protection might filter out the DYLD_LIBRARY_PATH, so we pass it - // through explicitely here. - cmd << "export " << fgLdVar << "=" << GetEnv(fgLdVar) << "\n"; -#endif - cmd << "DDS_CFG=`dds-user-defaults --ignore-default-sid -p`\n" - "if [ -z \"$DDS_CFG\" ]; then\n" - " mkdir -p \"$HOME/.DDS\"\n" - " dds-user-defaults --ignore-default-sid -d -c \"$HOME/.DDS/DDS.cfg\"\n" - "fi\n"; - auto rc(std::system(cmd.str().c_str())); - if (rc != 0) { - LOG(warn) << "DDSEnvironment::SetupConfigHome failed"; - } } auto SetupPath() -> void @@ -81,22 +48,6 @@ struct DDSEnvironment::Impl setenv("PATH", path.c_str(), 1); } - auto GenerateDDSLibDir() const -> Path - { - return {(fLocation == DDSInstallPrefix) ? DDSLibraryDir : fLocation / Path("lib")}; - } - - auto SetupDynamicLoader() -> void - { - std::string ld(GetEnv(fgLdVar)); - if (ld.empty()) { - ld = GenerateDDSLibDir().string(); - } else { - ld = GenerateDDSLibDir().string() + std::string(":") + ld; - } - setenv(fgLdVar.c_str(), ld.c_str(), 1); - } - auto GetEnv(const std::string& key) const -> std::string { auto value = std::getenv(key.c_str()); @@ -112,11 +63,6 @@ struct DDSEnvironment::Impl Path fLocation; Path fConfigHome; -#ifdef __APPLE__ - std::string const fgLdVar = "DYLD_LIBRARY_PATH"; -#else - std::string const fgLdVar = "LD_LIBRARY_PATH"; -#endif }; DDSEnvironment::DDSEnvironment()