From ba9554834bec6460da3dc491b71ad971f7bf36c2 Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Wed, 24 Jun 2026 14:43:28 -0500 Subject: [PATCH 1/7] Fix to get bin/test.py working on Mac Added function to cml_unit_sim.mk so that the -Wno-nonnull-compare only gets added to TRICK_C/XXFLAGS in a Linux environment as the compile flag is not compatible with Clang Fixed overloading and fpe compile errors for SIM_Test_table. Using SIM_Test_table as the test case to get Mac working with CML. Currently seeing SWIG error where SWIG is attempting to access private things within a class. Refs #16 --- bin/test.py | 22 ++++++++++------- mkspecs/internal/cml_unit_sim.mk | 24 ++++++++++++++++--- .../extended_planetary_derived_state.hh | 2 +- .../range/include/range_computation.hh | 2 +- .../aero/include/aero_executive_table.hh | 4 ++-- .../aero/include/aero_interface_table.hh | 2 +- .../math_utils/include/math_utils_private.hh | 17 +++++++------ 7 files changed, 49 insertions(+), 24 deletions(-) diff --git a/bin/test.py b/bin/test.py index e47f3666..f426a7ad 100755 --- a/bin/test.py +++ b/bin/test.py @@ -44,13 +44,22 @@ def _verify_args(args): ''' Ensure Trick and JEOD areas exist and libs are built. If they aren't, all tests will fail ''' + # We need to know what TRICK_HOST_CPU is to find the libraries, so get that first + cmd = ( os.path.join(args.trick, 'bin/trick-gte') + " TRICK_HOST_CPU") + sys.path.append(os.path.abspath(os.path.join(args.trick, 'share/trick/trickops/'))) + from WorkflowCommon import run_subprocess + trick_host_cpu = run_subprocess(command=cmd,m_shell=True).stdout.strip().split("\n")[-1] + if "Linux" in trick_host_cpu: + trick_build_lib_dir = "lib64" + elif "Darwin" in trick_host_cpu: + trick_build_lib_dir = "lib" if not args.trick or not os.path.exists(args.trick): msg = ("Unable to locate trick directory. Define TRICK_HOME in your environment" " or use --trick=/path/to/trick/ to specify a path to a pre-built Trick" " directory (Requires version 19.5.1 or later)") raise RuntimeError(msg) - if (not os.path.exists(os.path.join(args.trick, 'lib64')) or - not os.listdir(os.path.join(args.trick,'lib64'))): + if (not os.path.exists(os.path.join(args.trick, trick_build_lib_dir)) or + not os.listdir(os.path.join(args.trick, trick_build_lib_dir))): msg = (f"Specified trick directory {args.trick} is missing built libraries. " "Build trick for this platform to resolve this error.") raise RuntimeError(msg) @@ -59,12 +68,7 @@ def _verify_args(args): " or use --jeod=/path/to/jeod/ to specify a path to a JEOD" " directory (Requires version 3.4 or later)") raise RuntimeError(msg) - # We need to know what TRICK_HOST_CPU is to find the libraries, so get that first - cmd = ( os.path.join(args.trick, 'bin/trick-gte') + " TRICK_HOST_CPU") - sys.path.append(os.path.abspath(os.path.join(args.trick, 'share/trick/trickops/'))) - from WorkflowCommon import run_subprocess - trick_host_cpu = run_subprocess(command=cmd,m_shell=True).stdout.strip().split("\n")[-1] - if not os.path.isfile(os.path.join(args.trick, 'lib64/libtrick.a')): + if not os.path.isfile(os.path.join(args.trick, trick_build_lib_dir + '/libtrick.a')): raise RuntimeError(f"Trick hasn't been built. Build {args.trick} and try again.") if not os.path.isfile(os.path.join(args.jeod, 'lib_jeod_' + trick_host_cpu + '/libjeod.a' )): raise RuntimeError(f"JEOD library under {args.jeod} hasn't been built. See README.md for instructions and try again.") @@ -74,7 +78,7 @@ def _verify_args(args): if len(ephem_files) < 1: raise RuntimeError(f"JEOD ephemeris files under {args.jeod} haven't been built. See README.md for instructions and try again.") - return args + return args # Argparsing must happen at global scope since we can't import TrickOps without # figuring out the location of Trick, which can be passed in to this script. diff --git a/mkspecs/internal/cml_unit_sim.mk b/mkspecs/internal/cml_unit_sim.mk index 28ba3076..72a1bdca 100644 --- a/mkspecs/internal/cml_unit_sim.mk +++ b/mkspecs/internal/cml_unit_sim.mk @@ -11,8 +11,26 @@ CML_BUILD_DEBUG := 1 include ${CML_HOME}/mkspecs/cml.mk include ${CML_HOME}/mkspecs/internal/jeod.mk -TRICK_CFLAGS += -g -I. -Wall -Wextra -Werror -Wno-implicit-fallthrough -Wno-format-truncation -Wno-int-in-bool-context -Wno-address -Wno-nonnull-compare -TRICK_CXXFLAGS += -g -I. -std=c++17 -Wall -Wextra -Werror -Wno-implicit-fallthrough -Wno-format-truncation -Wno-int-in-bool-context -Wno-address -Wno-nonnull-compare +# temporary fix for Mac as -Wno-nonnull-compare is not recognized by clang +TRICK_CFLAGS += -g -I. -Wall -Wextra -Werror -Wno-implicit-fallthrough -Wno-format-truncation -Wno-int-in-bool-context -Wno-address +TRICK_CXXFLAGS += -g -I. -Wall -Wextra -Werror -Wno-implicit-fallthrough -Wno-format-truncation -Wno-int-in-bool-context -Wno-address TRICK_SFLAGS += -I${JEOD_HOME}/lib/jeod/JEOD_S_modules -I. -TRICK_CXXFLAGS += -I${JEOD_HOME}/.. +# Try adding -Wno-nonnull-compare only if the compiler supports it +CHECK_CXXFLAG = $(shell \ + $(CXX) -Werror=unknown-warning-option -Wno-nonnull-compare -E - < /dev/null \ + >/dev/null 2>&1 && echo yes || echo no) + +ifeq ($(CHECK_CXXFLAG),yes) +TRICK_CFLAGS += -Wno-nonnull-compare +TRICK_CXXFLAGS += -Wno-nonnull-compare +endif + +# Remove after JEOD 5: +TRICK_CXXFLAGS += -I${JEOD_HOME}/models -I${JEOD_HOME}/.. + +# Strip unneeded -lint from TRICK_EXEC_LINK_LIBS. This originates from python3-config +# and appears to be part of the FSL spack-installed version of python3.X only +# If we can understand/resolve the core issue, this can be removed. +# See: https://gitlab-fsl.jsc.nasa.gov/FSL/Documentation/-/issues/1111 -Jordan 4/2024 +TRICK_EXEC_LINK_LIBS := $(filter-out -lintl,$(TRICK_EXEC_LINK_LIBS)) diff --git a/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh b/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh index 50a62bc7..058d7e09 100644 --- a/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh +++ b/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh @@ -168,7 +168,7 @@ class ExtendedPlanetaryDerivedState : public jeod::PlanetaryDerivedState, ExtendedPlanetaryDerivedState(void); virtual ~ExtendedPlanetaryDerivedState(void){}; - + using SubscriptionBase::initialize; virtual void initialize(jeod::DynBody & subject_body, jeod::DynManager & dyn_manager); virtual void update (void); diff --git a/models/dynamics/state_descriptors/range/include/range_computation.hh b/models/dynamics/state_descriptors/range/include/range_computation.hh index 4d3de54d..ea6f334c 100644 --- a/models/dynamics/state_descriptors/range/include/range_computation.hh +++ b/models/dynamics/state_descriptors/range/include/range_computation.hh @@ -134,7 +134,7 @@ class RangeComputation : public RangeValues, public: RangeComputation(const jeod::PlanetFixedPosition & state_in); virtual ~RangeComputation(){}; - + using SubscriptionBase::initialize; virtual void initialize( const jeod::Planet & planet_in); void set_reference_data_query(); /* external call to determine whether there is sufficient data to diff --git a/models/interactions/aero/include/aero_executive_table.hh b/models/interactions/aero/include/aero_executive_table.hh index 7a193e0e..75189ff9 100644 --- a/models/interactions/aero/include/aero_executive_table.hh +++ b/models/interactions/aero/include/aero_executive_table.hh @@ -174,10 +174,10 @@ public: void change_table(AeroTableSetBase & new_table); void add_table(AeroTableSetBase * new_table); - virtual void initialize(); + virtual void initialize() override; virtual void update() override; protected: - virtual void activate(); + virtual void activate() override; void configure_new_table(AeroTableSetBase *); void trig_functions(); void post_process_table_data(); diff --git a/models/interactions/aero/include/aero_interface_table.hh b/models/interactions/aero/include/aero_interface_table.hh index dfaa6203..471f6a05 100644 --- a/models/interactions/aero/include/aero_interface_table.hh +++ b/models/interactions/aero/include/aero_interface_table.hh @@ -41,7 +41,7 @@ public: const double (&T_struc_to_body_in)[3][3]); virtual ~AeroInterfaceTable(){}; - virtual void initialize(); + virtual void initialize() override; virtual void update() override; protected: virtual void activate() override; diff --git a/models/utilities/math_utils/include/math_utils_private.hh b/models/utilities/math_utils/include/math_utils_private.hh index a30fc866..7215476f 100644 --- a/models/utilities/math_utils/include/math_utils_private.hh +++ b/models/utilities/math_utils/include/math_utils_private.hh @@ -5,7 +5,7 @@ #define _USE_MATH_DEFINES // M_PI #include // abs, isnan, isinf #include // std::max, min -#include // fp exception +#include // fp exception #include // std::numeric_limits::min, epsilon #include "cml/models/utilities/cml_message/include/cml_message.hh" @@ -35,8 +35,9 @@ class MathUtilsPrivate { const T val2, const T ulp) { + std::fenv_t env; //temporary disable fp exceptions - const int fe_prev = fedisableexcept(FE_ALL_EXCEPT); + const int fe_prev = std::feholdexcept(&env); assert(-1 != fe_prev); const T abs_val1 = std::abs(val1); @@ -60,7 +61,7 @@ class MathUtilsPrivate { ); } - feenableexcept(fe_prev); // restore the previous settings of fp exceptions + std::fesetenv(&env); // restore the previous settings of fp exceptions return res; } @@ -74,9 +75,10 @@ class MathUtilsPrivate { const T failed_val, const bool failed_flag) { + std::fenv_t env; // Temporary disable fp exceptions, storing the // set of previously configured exceptions. - const int fe_prev = fedisableexcept(FE_ALL_EXCEPT); + const int fe_prev = std::feholdexcept(&env); assert(-1 != fe_prev); // If -1, there was a failure T res = dividend/divisor; @@ -102,7 +104,7 @@ class MathUtilsPrivate { res = failed_val; } - feenableexcept(fe_prev); // restore the previous settings of fp exceptions + std::fesetenv(&env); // restore the previous settings of fp exceptions return res; } @@ -166,9 +168,10 @@ class MathUtilsPrivate { const bool failed_flag, const bool base10) { + std::fenv_t env; // Temporary disable fp exceptions, storing the set of // previously configured exceptions. - const int fe_prev = fedisableexcept(FE_ALL_EXCEPT); + const int fe_prev = std::feholdexcept(&env); assert(-1 != fe_prev); // If -1, there was a failure T res; @@ -190,7 +193,7 @@ class MathUtilsPrivate { } } - feenableexcept(fe_prev); // restore the previous settings of fp exceptions + std::fesetenv(&env); // restore the previous settings of fp exceptions return res; } }; From 531d849709a8d852aa87cf66d7af40b399aac234 Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Sun, 5 Jul 2026 15:27:51 -0500 Subject: [PATCH 2/7] =?UTF-8?q?Updates=20to=20get=20SIM=5FTest=5Ftable=20t?= =?UTF-8?q?o=20compile=20with=20trick-CP=20CML=5FTRICK=5FBUILD=3D1=20on=20?= =?UTF-8?q?Mac=20Also=20includes=20#ifdef=C2=A0SWIG=20fix=20for=20swig=20a?= =?UTF-8?q?ttempting=20to=20access=20private=20class=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #16 --- mkspecs/cml.mk | 15 ++++++++++++++- .../fhw/effectors/chute/src/xcompute_chute_CDS.c | 5 +++-- .../utilities/cml_message/include/cml_message.hh | 15 ++++++++++----- .../fault_management/include/fault_function.hh | 10 +++++++++- models/utilities/math_utils/src/math_utils.cc | 5 +++-- .../include/generic_multi_input_table.hh | 6 ++++++ .../include/generic_single_input_table.hh | 6 ++++++ .../include/single_input_table_for_angles.hh | 6 ++++++ .../include/single_input_table_for_quaternions.hh | 6 ++++++ .../include/single_input_table_var_with_deriv.hh | 6 ++++++ 10 files changed, 69 insertions(+), 11 deletions(-) diff --git a/mkspecs/cml.mk b/mkspecs/cml.mk index f5daa18f..858884ef 100644 --- a/mkspecs/cml.mk +++ b/mkspecs/cml.mk @@ -58,8 +58,21 @@ endif TRICK_CXXFLAGS += -I${CML_HOME}/.. TRICK_CFLAGS += -I${CML_HOME}/.. -# Include paths and libraries for libxml2 +# Include paths and libraries for libxml2 for linux ifeq ($(shell pkg-config --exists libxml-2.0 && echo $$?),0) TRICK_CXXFLAGS += $(shell pkg-config libxml-2.0 --cflags) TRICK_LDFLAGS += $(shell pkg-config libxml-2.0 --libs) endif + +# Include paths and libraries for libxml2 if installed via homebrew +ifeq ($(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config --exists libxml-2.0 && echo $$?),0) + TRICK_CXXFLAGS += $(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config libxml-2.0 --cflags) + TRICK_LDFLAGS += $(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config libxml-2.0 --libs) +endif + +# Include paths and libraries for libxml2 for non-homebrew installation +SDK_PATH := $(shell xcrun --sdk macosx --show-sdk-path) +ifeq ($(wildcard $(SDK_PATH)/usr/include/libxml2),$(SDK_PATH)/usr/include/libxml2) + TRICK_CXXFLAGS += -I$(SDK_PATH)/usr/include/libxml2 + TRICK_LDFLAGS += -lxml2 +endif diff --git a/models/fhw/effectors/chute/src/xcompute_chute_CDS.c b/models/fhw/effectors/chute/src/xcompute_chute_CDS.c index 2884e1c7..547d9f9d 100644 --- a/models/fhw/effectors/chute/src/xcompute_chute_CDS.c +++ b/models/fhw/effectors/chute/src/xcompute_chute_CDS.c @@ -50,6 +50,7 @@ void xcompute_chute_CDS(INFLATION_DATA *inflation, double sim_local_time ) { + fenv_t env; const char error_msg[] = "\nERROR: Calling argument pointer is NULL in xcompute_chute_CDS \n"; if (!inflation) { printf(error_msg); @@ -127,7 +128,7 @@ void xcompute_chute_CDS(INFLATION_DATA *inflation, if (inflation->work.stage_elasped_time < 0.0) inflation->work.stage_elasped_time = 0.0; //disable the FP exception to allow isnan()/isinf() to work - int fe_prev = fedisableexcept(FE_ALL_EXCEPT); + int fe_prev = feholdexcept(&env); assert(-1 != fe_prev); inflation->work.percent_filled = inflation->work.stage_elasped_time / inflation->work.fill_time; @@ -138,7 +139,7 @@ void xcompute_chute_CDS(INFLATION_DATA *inflation, } //recover the previous settings of FP exceptions - feenableexcept(fe_prev); + fesetenv(&env); // Compute Chute Drag Area during inflation if (inflation->param.use_DCLDYN_Inflation_Model == true) { diff --git a/models/utilities/cml_message/include/cml_message.hh b/models/utilities/cml_message/include/cml_message.hh index 12200f27..4bf743a2 100644 --- a/models/utilities/cml_message/include/cml_message.hh +++ b/models/utilities/cml_message/include/cml_message.hh @@ -27,6 +27,11 @@ Programmers: #include "trick/exec_proto.h" #endif +#ifndef SWIG +inline std::ostream& operator<<(std::ostream& os, const jeod::NamedItem& item) { + return os << item.get_name(); +} +#endif class CMLMessage { @@ -234,9 +239,9 @@ class CMLMessage CMLMessage & operator= (const CMLMessage &); }; -#ifndef SWIG -inline std::ostream& operator<<(std::ostream& os, const jeod::NamedItem& item) { - return os << item.get_name(); -} -#endif +//#ifndef SWIG +//inline std::ostream& operator<<(std::ostream& os, const jeod::NamedItem& item) { +// return os << item.get_name(); +//} +//#endif #endif diff --git a/models/utilities/fault_management/include/fault_function.hh b/models/utilities/fault_management/include/fault_function.hh index 3e0c671c..85fdaa9c 100644 --- a/models/utilities/fault_management/include/fault_function.hh +++ b/models/utilities/fault_management/include/fault_function.hh @@ -32,6 +32,10 @@ class FaultFunctionBase : public Fault, public FaultFunctionParameter { Trianglewave }; +#ifdef SWIG +%immutable; +#endif + FaultFunctionBase(); virtual ~FaultFunctionBase(){} @@ -68,6 +72,10 @@ class FaultFunctionBase : public Fault, public FaultFunctionParameter { double ind_prev; /* (--) The previous value of the independent variable. */ double freq_prev; /* (--) The previous value of the frequency. */ +#ifdef SWIG +%mutable; +#endif + private: FaultFunctionBase(const FaultFunctionBase&); FaultFunctionBase& operator = (const FaultFunctionBase&); @@ -136,4 +144,4 @@ template void FaultFunction::overwrite_value() { } } } -#endif \ No newline at end of file +#endif diff --git a/models/utilities/math_utils/src/math_utils.cc b/models/utilities/math_utils/src/math_utils.cc index b38eb3a8..e60c11b8 100644 --- a/models/utilities/math_utils/src/math_utils.cc +++ b/models/utilities/math_utils/src/math_utils.cc @@ -599,9 +599,10 @@ MathUtils::polynomial( double x, const double failed_val, const bool failed_flag) { + fenv_t env; // Temporary disable fp exceptions, storing the set of // previously configured exceptions. - const int fe_prev = fedisableexcept(FE_ALL_EXCEPT); + const int fe_prev = feholdexcept(&env); assert(-1 != fe_prev); // If -1, there was a failure double x_to_i = 1.0; @@ -628,7 +629,7 @@ MathUtils::polynomial( double x, } sum = failed_val; } - feenableexcept(fe_prev); // restore the previous settings of fp exceptions + fesetenv(&env); // restore the previous settings of fp exceptions return sum; } diff --git a/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh b/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh index ed92d570..fcd977a1 100644 --- a/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh +++ b/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh @@ -35,6 +35,9 @@ Purpose: class GenericMultiInputTable { friend class SingleInputTableVarDeriv; +#ifdef SWIG +%immutable; +#endif protected: bool trivial_case; /* (--) Blocks the table-lookup when all independents have only one value. @@ -120,6 +123,9 @@ class GenericMultiInputTable bool precheck_output(); void generate_trivial_output(); bool index_checks(size_t & idx1, size_t & idx2, std::string func); +#ifdef SWIG +%mutable; +#endif private: bool load_data_internal_check( const SizeVec &dim_list ); diff --git a/models/utilities/table_interp_cpp/include/generic_single_input_table.hh b/models/utilities/table_interp_cpp/include/generic_single_input_table.hh index f106cdd8..74975267 100644 --- a/models/utilities/table_interp_cpp/include/generic_single_input_table.hh +++ b/models/utilities/table_interp_cpp/include/generic_single_input_table.hh @@ -23,6 +23,9 @@ class GenericSingleInputTable : public GenericMultiInputTable { +#ifdef SWIG +%immutable; +#endif friend class SingleInputTableVarDeriv; public: virtual bool initialize() override; @@ -32,6 +35,9 @@ class GenericSingleInputTable : public GenericMultiInputTable protected: virtual void generate_base_values() override; virtual bool generate_output() override; +#ifdef SWIG +%mutable; +#endif private: // Disable the copy/assignment operators GenericSingleInputTable (const GenericSingleInputTable&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh b/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh index 7ec22ef6..8eec527a 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh @@ -31,6 +31,9 @@ PROGRAMMERS: class SingleInputTableForAngles : public GenericSingleInputTable { +#ifdef SWIG +%immutable; +#endif public: bool output_in_radians; /* (--) Flag indicating that the output data will be interpreted as radians. @@ -54,6 +57,9 @@ class SingleInputTableForAngles : public GenericSingleInputTable protected: virtual bool generate_output() override; void bound_to_half_circle( double & angle); +#ifdef SWIG +%mutable; +#endif private: // Disable the copy/assignment operators SingleInputTableForAngles (const SingleInputTableForAngles&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh b/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh index 00e0cf7b..f8a5f559 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh @@ -30,6 +30,9 @@ PROGRAMMERS: class SingleInputTableForQuaternions : public GenericSingleInputTable { +#ifdef SWIG +%immutable; +#endif protected: QuaternionSphericalInterpolator sph_interp; /* (--) Instance of the interpolator.*/ @@ -56,6 +59,9 @@ class SingleInputTableForQuaternions : public GenericSingleInputTable protected: virtual bool generate_output() override; +#ifdef SWIG +%mutable; +#endif private: // Disable the copy/assignment operators SingleInputTableForQuaternions (const SingleInputTableForQuaternions&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh b/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh index 15b47715..7cbb0af0 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh @@ -26,6 +26,9 @@ class SingleInputTableVarDeriv : public GenericSingleInputTable { +#ifdef SWIG +%immutable; +#endif public: GenericSingleInputTable derivs; /* (--) A parallel instance of GenericSingleInputTable used to manage the data @@ -60,6 +63,9 @@ class SingleInputTableVarDeriv : public GenericSingleInputTable virtual bool initialize() override; protected: virtual bool generate_output() override; +#ifdef SWIG +%mutable; +#endif private: // Disable the copy/assignment operators SingleInputTableVarDeriv (const SingleInputTableVarDeriv&); From 625178b95f14147908967f0fe6c45a34ac63718f Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Mon, 3 Aug 2026 16:38:08 -0500 Subject: [PATCH 3/7] Changes that generates libcml.dylib and the trickified cml library Refs #16 --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++------ mkspecs/cml.mk | 11 ---------- mkspecs/internal/cml_lib.mk | 2 ++ trickified/makefile | 3 --- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84c97901..bfa2fecb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,12 +118,41 @@ target_link_libraries(cml_static PRIVATE $<$:--coverage> ) -target_link_libraries(cml_shared - PUBLIC - LibXml2::LibXml2 - PRIVATE - $<$:--coverage> -) + +if(APPLE) + message(STATUS "Configuring macOS-specific linking for cml_shared") + + target_link_libraries(cml_shared + PUBLIC + LibXml2::LibXml2 + ${JEOD_LIBRARY} + ${Trick_LIBRARY} + ${Trick_liber7_utils} + ${Trick_libtrick_mm} + ${Trick_libtrick_math} + ${Trick_libtrick_comm} + ${Trick_libtrick_connection_handlers} + ${Trick_libtrick_units} + ${Trick_libtrick_pyip} + /opt/homebrew/lib/libudunits2.dylib + ${Trick_libtrick_var_binary_parser} + ${Trick_libconversions} + PRIVATE + $<$:--coverage> + ) + +else() + message(STATUS "Configuring Linux-specific linking for cml_shared") + + # Linux does NOT require explicit Trick/JEOD linking for shared libraries + target_link_libraries(cml_shared + PUBLIC + LibXml2::LibXml2 + PRIVATE + $<$:--coverage> + ) + +endif() # Set include directories for libcml. This is mostly for unit test executables # that rely on libcml. diff --git a/mkspecs/cml.mk b/mkspecs/cml.mk index 858884ef..31fc4f4a 100644 --- a/mkspecs/cml.mk +++ b/mkspecs/cml.mk @@ -64,15 +64,4 @@ ifeq ($(shell pkg-config --exists libxml-2.0 && echo $$?),0) TRICK_LDFLAGS += $(shell pkg-config libxml-2.0 --libs) endif -# Include paths and libraries for libxml2 if installed via homebrew -ifeq ($(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config --exists libxml-2.0 && echo $$?),0) - TRICK_CXXFLAGS += $(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config libxml-2.0 --cflags) - TRICK_LDFLAGS += $(shell PKG_CONFIG_PATH="$(shell brew --prefix libxml2)/lib/pkgconfig" pkg-config libxml-2.0 --libs) -endif - -# Include paths and libraries for libxml2 for non-homebrew installation SDK_PATH := $(shell xcrun --sdk macosx --show-sdk-path) -ifeq ($(wildcard $(SDK_PATH)/usr/include/libxml2),$(SDK_PATH)/usr/include/libxml2) - TRICK_CXXFLAGS += -I$(SDK_PATH)/usr/include/libxml2 - TRICK_LDFLAGS += -lxml2 -endif diff --git a/mkspecs/internal/cml_lib.mk b/mkspecs/internal/cml_lib.mk index adcde7ec..4a4957f9 100644 --- a/mkspecs/internal/cml_lib.mk +++ b/mkspecs/internal/cml_lib.mk @@ -88,6 +88,8 @@ TRICK_EXT_LIB_DIRS += :${CML_SOURCE_DIRS} TRICK_LDFLAGS += -L${CML_LIBRARY_DIR} ifeq (1, $(CML_USE_STATIC_LIB)) TRICK_LDFLAGS += -l:libcml.a +else ifeq ($(findstring Darwin,$(trick-gte TRICK_HOST_CPU)),) + TRICK_LDFLAGS += -Wl,-rpath,${CML_LIBRARY_DIR} -lcml else TRICK_LDFLAGS += -Wl,-rpath=${CML_LIBRARY_DIR} -lcml endif diff --git a/trickified/makefile b/trickified/makefile index 495fd611..18e49f0d 100644 --- a/trickified/makefile +++ b/trickified/makefile @@ -8,9 +8,6 @@ export TRICKIFY_EXT_LIB_DIRS += :${JEOD_HOME}/models export TRICKIFY_PYTHON_DIR := python.zip export ICG_EXCLUDE += :${JEOD_HOME}/models -ifeq ($(shell pkg-config --exists libxml-2.0 && echo $$?),0) - export TRICKIFY_CXX_FLAGS += $(shell pkg-config libxml-2.0 --cflags) -endif # Due to limitations with Trickification and SWIG, the JEOD Trickified library # and build artifacts MUST exist for CML to Trickify properly. From 74c72c544acb3c462c15dbc0ce7357e50009999a Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Fri, 7 Aug 2026 09:49:05 -0500 Subject: [PATCH 4/7] Able to build all 104 unit sims on Mac Refs #16 --- cmake/SetCMLCompileWarnings.cmake | 32 +++++++++++-------- .../include/separation_state.hh | 1 + .../include/simple_planet_rel_state.hh | 1 + .../twist_sway/include/twist_sway.hh | 1 + .../impact_point/include/impact_point.hh | 17 +++++----- .../atmos_exec/include/atmosphere_exec.hh | 1 + .../include/atmosphere_exec_interface.hh | 1 + .../include/lagged_atmos_payload_data.hh | 16 ++++++++++ .../rcs_generic/include/rcs_generic.hh | 1 + .../include/mass_body_detach_with_springs.hh | 3 +- .../buffers/include/tagged_ring_buffer.hh | 1 + .../SIM_tagged_ring_buffer/sample_class.hh | 11 ++++++- .../include/threshold_constraint.hh | 4 +-- .../math_utils/include/math_utils.hh | 12 +++---- .../verif/SIM_02_simple_table_lookup/S_define | 2 +- .../include/watch_values_base_core.hh | 3 +- 16 files changed, 73 insertions(+), 34 deletions(-) diff --git a/cmake/SetCMLCompileWarnings.cmake b/cmake/SetCMLCompileWarnings.cmake index bcceda1c..140778d6 100644 --- a/cmake/SetCMLCompileWarnings.cmake +++ b/cmake/SetCMLCompileWarnings.cmake @@ -23,28 +23,22 @@ function(set_cml_compile_warnings TARGET) -Walloca -Wcast-align -Wcast-qual - -Wduplicated-branches - -Wduplicated-cond - -Wformat=1 - -Wformat-overflow=2 -Wformat-security -Wformat-signedness -Wformat-truncation - -Wimplicit-fallthrough=5 - -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnull-dereference -Wshadow -Wsign-conversion -Wswitch-enum - -Wtrampolines -Wundef -Wuninitialized -Wunused -Wunused-macros -Wvla ) + set(CML_C_WARNING_FLAGS -Wbad-function-cast -Wjump-misses-init @@ -53,21 +47,31 @@ function(set_cml_compile_warnings TARGET) -Wold-style-definition -Wstrict-prototypes ) - set(CML_CPP_WARNING_FLAGS + + # GCC-only warnings + set(GCC_ONLY_WARNINGS + -Wduplicated-branches + -Wduplicated-cond + -Wformat=1 + -Wformat-overflow=2 + -Wimplicit-fallthrough=5 + -Wlogical-op + -Wtrampolines -Wcatch-value=3 -Wconditionally-supported - -Wctor-dtor-privacy - -Wextra-semi -Wnoexcept - -Wnon-virtual-dtor - -Wold-style-cast -Wplacement-new=2 -Wstrict-null-sentinel - -Wsuggest-override -Wuseless-cast - -Wzero-as-null-pointer-constant ) + + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # GCC -> add GCC-only warnings + list(APPEND CML_CPP_WARNING_FLAGS ${GCC_ONLY_WARNINGS}) + list(APPEND CML_SHARED_WARNING_FLAGS ${GCC_ONLY_WARNINGS}) + endif() + target_compile_options(${TARGET} PRIVATE ${CML_SHARED_WARNING_FLAGS} diff --git a/models/dynamics/state_descriptors/separation_state/include/separation_state.hh b/models/dynamics/state_descriptors/separation_state/include/separation_state.hh index a45f1ddc..01f3ab8a 100644 --- a/models/dynamics/state_descriptors/separation_state/include/separation_state.hh +++ b/models/dynamics/state_descriptors/separation_state/include/separation_state.hh @@ -67,6 +67,7 @@ class SeparationState : public SubscriptionBase explicit SeparationState (std::string name); ~SeparationState() override = default; + using SubscriptionBase::initialize; void initialize( jeod::DynManager & dyn_manager_in, jeod::DynBody & source_body, jeod::DynBody & subject_body, diff --git a/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh b/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh index 52e72823..e6199a8d 100644 --- a/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh +++ b/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh @@ -35,6 +35,7 @@ class SimplePlanetRelState : public SubscriptionBase, SimplePlanetRelState(std::string body_frame_name_, std::string planet_frame_name); + using SubscriptionBase::initialize; void initialize(jeod::DynBody & subject_body, jeod::DynManager & dyn_manager) override; void update() override; diff --git a/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh b/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh index feeca579..dc9b69e0 100644 --- a/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh +++ b/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh @@ -237,6 +237,7 @@ public: TwistSway(const double & time_ref); ~TwistSway() override = default; + using SubscriptionBase::initialize; void initialize(double end_time); bool update(); void update_ecef(); diff --git a/models/dynamics/state_predictors/impact_point/include/impact_point.hh b/models/dynamics/state_predictors/impact_point/include/impact_point.hh index 126fe708..26f0baeb 100644 --- a/models/dynamics/state_predictors/impact_point/include/impact_point.hh +++ b/models/dynamics/state_predictors/impact_point/include/impact_point.hh @@ -19,7 +19,7 @@ PROGRAMMERS: (New implementation of ball_impact for Antares)) ((Bingquan Wang) (OSR) (May 2014) (cleaned up the code per its IV&V code review)) - ) + ) ******************************************************************************/ #ifndef CML_IMPACT_POINT_HH @@ -34,12 +34,12 @@ PROGRAMMERS: // Forward declaration class RefFrameTrans; -class ImpactPoint : public jeod::PlanetFixedPosition, - public SubscriptionBase +class ImpactPoint : public jeod::PlanetFixedPosition, + public SubscriptionBase { protected: const double & dyn_time; /* (s) Reference to the simulation's dynamic time.*/ - const jeod::Planet & planet_ref; /* (--) + const jeod::Planet & planet_ref; /* (--) Reference to the central planet. Note - planet_ref is the reference; "planet" is a pointer to the same place that is inherited from PlanetFixedPosition but is not used in this model. */ @@ -60,7 +60,7 @@ class ImpactPoint : public jeod::PlanetFixedPosition, //INPUT bool auto_off; /* (--) Turns off automatically when vehicle hits the ground */ - double iteration_threshold; /* (m) + double iteration_threshold; /* (m) The threshold distance between the orbital position and the planet surface at which the iteration is considered to have converged. */ unsigned int iteration_count_max; /* (--) max number of iterations */ @@ -70,7 +70,7 @@ class ImpactPoint : public jeod::PlanetFixedPosition, double time_to_impact; /* (s) Time until impact */ double time_of_impact; /* (s) Simulation dynamic time of predicted impact. */ ImpactType impact_type; /* (--) Identifies type of impact. */ - RangeFromPfixReference launch_range; /* (--) + RangeFromPfixReference launch_range; /* (--) The range from the reference point, typically the launch site. */ protected: @@ -86,8 +86,9 @@ class ImpactPoint : public jeod::PlanetFixedPosition, const jeod::Planet & planet, const double & grav_mu); ~ImpactPoint() override = default; - + void initialize() override; + using jeod::PlanetFixedPosition::initialize; void initialize( double ref_pos[3]); void update(); @@ -103,5 +104,5 @@ class ImpactPoint : public jeod::PlanetFixedPosition, ImpactPoint(const ImpactPoint&); ImpactPoint & operator = (const ImpactPoint&); }; - + #endif diff --git a/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh b/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh index 1dd90e22..b2312117 100644 --- a/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh +++ b/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh @@ -111,6 +111,7 @@ class AtmosphereExec : public AtmosphereExecInterface { ~AtmosphereExec() override = default; + using AtmosphereExecInterface::initialize; void initialize( jeod::TimeStandard & time_in); void update (); diff --git a/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh b/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh index dcf602df..395f0373 100644 --- a/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh +++ b/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh @@ -59,6 +59,7 @@ class AtmosphereExecInterface : public SubscriptionBase const jeod::DynBody & body); ~AtmosphereExecInterface() override = default; + using SubscriptionBase::initialize; void initialize() override; std::string get_current_atmos_name() { diff --git a/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh b/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh index d1cac638..be53f2a0 100644 --- a/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh +++ b/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh @@ -54,5 +54,21 @@ class LaggedAtmosPayloadData { jeod::Vector3::copy(orig.planetodetic_wind_velocity, planetodetic_wind_velocity); } + + + LaggedAtmosPayloadData& operator=(const LaggedAtmosPayloadData& rhs) + { + if (this != &rhs) { + altitude = rhs.altitude; + density = rhs.density; + speed_of_sound = rhs.speed_of_sound; + + jeod::Vector3::copy(rhs.planetodetic_wind_velocity, + planetodetic_wind_velocity); + } + return *this; + } + + }; #endif diff --git a/models/fhw/effectors/rcs_generic/include/rcs_generic.hh b/models/fhw/effectors/rcs_generic/include/rcs_generic.hh index c268aada..c3f0e050 100644 --- a/models/fhw/effectors/rcs_generic/include/rcs_generic.hh +++ b/models/fhw/effectors/rcs_generic/include/rcs_generic.hh @@ -128,6 +128,7 @@ class RcsGeneric : public SubscriptionBase { explicit RcsGeneric (const unsigned int num_propellant_components_); ~RcsGeneric() override = default; + using SubscriptionBase::initialize; virtual void initialize( double time_step, const double * center_of_mass); void update( const int * rcs_command); diff --git a/models/fhw/effectors/springs/include/mass_body_detach_with_springs.hh b/models/fhw/effectors/springs/include/mass_body_detach_with_springs.hh index c8a71b62..18af8b23 100644 --- a/models/fhw/effectors/springs/include/mass_body_detach_with_springs.hh +++ b/models/fhw/effectors/springs/include/mass_body_detach_with_springs.hh @@ -39,6 +39,7 @@ public: // NOTE - initialize(jeod::DynManager) is called from Dynamics Manager as a // consequence of adding this body action with the add_body_action method // call. + using jeod::BodyDetach::initialize; void initialize( const jeod::DynBody & parent, SeparationState & sep_state) { @@ -97,7 +98,7 @@ public: }; void apply( jeod::DynManager & dyn_manager) override - { + { springs.action_body_is_child = child_is_action_body; springs.activate(); jeod::BodyDetach::apply(dyn_manager); diff --git a/models/utilities/buffers/include/tagged_ring_buffer.hh b/models/utilities/buffers/include/tagged_ring_buffer.hh index 1267934c..8dd0bdac 100644 --- a/models/utilities/buffers/include/tagged_ring_buffer.hh +++ b/models/utilities/buffers/include/tagged_ring_buffer.hh @@ -82,6 +82,7 @@ Note: intermediate instance. The code is ugly to read, but simplified with the use of aliases. *****************************************************************************/ + using CMLSimpleRingBuffer< CMLTaggedRingBufferMember< T_Tag, T_Data> >::buffer_data; virtual void buffer_data( T_Tag t, const T_Data & d) { diff --git a/models/utilities/buffers/verif/SIM_tagged_ring_buffer/sample_class.hh b/models/utilities/buffers/verif/SIM_tagged_ring_buffer/sample_class.hh index 7721b29a..6f040a59 100644 --- a/models/utilities/buffers/verif/SIM_tagged_ring_buffer/sample_class.hh +++ b/models/utilities/buffers/verif/SIM_tagged_ring_buffer/sample_class.hh @@ -16,7 +16,16 @@ struct TestStruc double x; int i; TestStruc() : x(1.1), i(1){}; - TestStruc( const TestStruc & rhs) = default; + TestStruc( const TestStruc & rhs) : x(rhs.x), i(rhs.i){}; + TestStruc& operator=(const TestStruc& rhs) + { + if (this != &rhs) + { + x = rhs.x; + i = rhs.i; + } + return *this; + } }; struct SampleModel diff --git a/models/utilities/constraint_check/include/threshold_constraint.hh b/models/utilities/constraint_check/include/threshold_constraint.hh index 818f308e..985456cf 100644 --- a/models/utilities/constraint_check/include/threshold_constraint.hh +++ b/models/utilities/constraint_check/include/threshold_constraint.hh @@ -509,7 +509,7 @@ class ThresholdTimedConstraintSpecData : public Constraint (num_specs-1) and fraction 0 by definition. - The first and last test values have already been assigned. - The highest value of any other mapped-index is num_specs-2.*/ - size_t mapped_ix[num_tests-1]; + std::vector mapped_ix(num_tests-1); mapped_ix[0] = 0; // unused spacer, we already have values for test-0. size_t spec_ix=0; for (size_t test_ix = 1; test_ix <= num_tests-2; ++test_ix) { @@ -577,7 +577,7 @@ class ThresholdTimedConstraintSpecData : public Constraint * redundant repetition (typically, we are adding more tests than * specified, so the same spec-ix will be used multiple times). * lg_ratio[i] = lg (threshold[i+1] / threshold[i]) */ - double log_threshold_ratios[num_specs-1]; + std::vector log_threshold_ratios(num_specs-1); for (spec_ix = 0; spec_ix <= num_specs-2; ++spec_ix) { log_threshold_ratios[spec_ix] = std::log10( threshold_spec[spec_ix+1] / threshold_spec[spec_ix]); diff --git a/models/utilities/math_utils/include/math_utils.hh b/models/utilities/math_utils/include/math_utils.hh index a67822ca..764fda7e 100644 --- a/models/utilities/math_utils/include/math_utils.hh +++ b/models/utilities/math_utils/include/math_utils.hh @@ -236,7 +236,7 @@ public: return false; } return ((val2 > val1) ? - val1 + tol >= val2 : + val1 + tol >= val2 : val2 + tol >= val1); } template @@ -310,11 +310,11 @@ public: { return MathUtilsPrivate::asin_fp(val); } - + /* TODO Hirad Mirhashemi 2025/10. * DEPRECATED CONTENT. Remove after reasonable timeframe.*/ - static float sqrt( float val) - { + static float sqrt( float val) + { CMLMessage::inform(__FILE__,__LINE__, "Deprecated method used: sqrt.\n" "This method name was not sufficiently descriptive.\n" @@ -322,7 +322,7 @@ public: return sqrt_protected(val); } static double sqrt( double val) - { + { CMLMessage::inform(__FILE__,__LINE__, "Deprecated method used: sqrt.\n" "This method name was not sufficiently descriptive.\n" @@ -975,7 +975,7 @@ Purpose: // [in] = [C_decomp] * [C_decomp]' => [inv(in)] = [inv(C)]' * [inv(C)] // and the inverse of the decomposed matrix is arithmetically simple to // compute. - double C_inv[dimension][dimension] = {0}; + double C_inv[dimension][dimension] = {{0}}; for ( size_t ii = 0; ii < dimension; ii++) { // Note -- division by zero already checked above and method has // returned if any diagonal elements are zero. diff --git a/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define b/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define index 36a11763..b74010d0 100644 --- a/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define +++ b/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define @@ -14,7 +14,7 @@ Descending data runs with only 1 dependent while ascending data runs with 2 to p class TestingModelSimObject : public Trick::SimObject { public: double independent; - double dependent[11][2]; // (--) 11 tables, 2 data per table + double dependent[12][2]; // (--) 11 tables, 2 data per table double indep_incr; // (--) increment per cycle. int frame_count; int reverse_on_count; diff --git a/models/vehicle_management/events_manager/include/watch_values_base_core.hh b/models/vehicle_management/events_manager/include/watch_values_base_core.hh index c9219321..c40e1680 100644 --- a/models/vehicle_management/events_manager/include/watch_values_base_core.hh +++ b/models/vehicle_management/events_manager/include/watch_values_base_core.hh @@ -65,7 +65,7 @@ class WatchValuesBaseCore : public SubscriptionBase { std::string name; /* (--) Name, primarily for debugging purposes. May be left blank.*/ bool locked; /* (--) - Boolean used to lock at each cycle, so each WatchValuesBase cannot be + Boolean used to lock at each cycle, so each WatchValuesBase cannot be tested more than once per cycle, leading to unintended behavior.*/ bool externally_managed; /* (--) Boolean setting that bool "locked" is set to once trigger is evaluated @@ -114,6 +114,7 @@ class WatchValuesBaseCore : public SubscriptionBase { ~WatchValuesBaseCore() override; + using SubscriptionBase::initialize; virtual void initialize( std::list * active_watch_in); void set_direction(int arg); From e9e55db8e250b29f1354a634ab514928924f8bcc Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Fri, 14 Aug 2026 11:46:10 -0500 Subject: [PATCH 5/7] Updates to get all unit sims to run on Mac. Branch works on Linux as well. Refs #16 --- cmake/SetCMLCompileWarnings.cmake | 1 - mkspecs/cml.mk | 2 -- mkspecs/internal/cml_unit_sim.mk | 6 +++++- .../separation_state/include/separation_state.hh | 1 - .../include/simple_planet_rel_state.hh | 1 - .../state_overrides/twist_sway/include/twist_sway.hh | 1 - .../state_predictors/impact_point/include/impact_point.hh | 1 - .../environment/atmos/atmos_exec/include/atmosphere_exec.hh | 1 - .../atmos/atmos_exec/include/atmosphere_exec_interface.hh | 1 - models/fhw/effectors/rcs_generic/include/rcs_generic.hh | 1 - models/utilities/buffers/include/tagged_ring_buffer.hh | 1 - .../events_manager/include/watch_values_base_core.hh | 1 - 12 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cmake/SetCMLCompileWarnings.cmake b/cmake/SetCMLCompileWarnings.cmake index 140778d6..d5cc7164 100644 --- a/cmake/SetCMLCompileWarnings.cmake +++ b/cmake/SetCMLCompileWarnings.cmake @@ -65,7 +65,6 @@ function(set_cml_compile_warnings TARGET) -Wuseless-cast ) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC -> add GCC-only warnings list(APPEND CML_CPP_WARNING_FLAGS ${GCC_ONLY_WARNINGS}) diff --git a/mkspecs/cml.mk b/mkspecs/cml.mk index 9b8b2273..a73f5b33 100644 --- a/mkspecs/cml.mk +++ b/mkspecs/cml.mk @@ -63,5 +63,3 @@ ifeq ($(shell pkg-config --exists libxml-2.0 && echo $$?),0) TRICK_CXXFLAGS += $(shell pkg-config libxml-2.0 --cflags) TRICK_LDFLAGS += $(shell pkg-config libxml-2.0 --libs) endif - -SDK_PATH := $(shell xcrun --sdk macosx --show-sdk-path) diff --git a/mkspecs/internal/cml_unit_sim.mk b/mkspecs/internal/cml_unit_sim.mk index 2c94229a..e8b43c3a 100644 --- a/mkspecs/internal/cml_unit_sim.mk +++ b/mkspecs/internal/cml_unit_sim.mk @@ -49,11 +49,11 @@ TRICK_CXXFLAGS += -I${JEOD_HOME}/.. # macOS (Darwin) specific fixes # ============================================================ UNAME_S := $(shell uname -s) - ifeq ($(UNAME_S),Darwin) # ------------------------------------------------------------ # 1. Strip Trick's auto-added -std=c++11 and -std=c++14 +# 2. Add -Wno-overloaded-virtual to Apple builds # ------------------------------------------------------------ TRICK_IO_CXXFLAGS := $(filter-out -std=c++11 -std=c++14,$(TRICK_IO_CXXFLAGS)) TRICK_IO_CXXFLAGS += -std=c++17 @@ -61,4 +61,8 @@ TRICK_IO_CXXFLAGS += -std=c++17 TRICK_CXXFLAGS := $(filter-out -std=c++11 -std=c++14,$(TRICK_CXXFLAGS)) TRICK_CXXFLAGS += -std=c++17 +TRICK_CXXFLAGS += -Wno-overloaded-virtual +TRICK_CFLAGS += -Wno-overloaded-virtual +TRICK_IO_CXXFLAGS += -Wno-overloaded-virtual + endif diff --git a/models/dynamics/state_descriptors/separation_state/include/separation_state.hh b/models/dynamics/state_descriptors/separation_state/include/separation_state.hh index 01f3ab8a..a45f1ddc 100644 --- a/models/dynamics/state_descriptors/separation_state/include/separation_state.hh +++ b/models/dynamics/state_descriptors/separation_state/include/separation_state.hh @@ -67,7 +67,6 @@ class SeparationState : public SubscriptionBase explicit SeparationState (std::string name); ~SeparationState() override = default; - using SubscriptionBase::initialize; void initialize( jeod::DynManager & dyn_manager_in, jeod::DynBody & source_body, jeod::DynBody & subject_body, diff --git a/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh b/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh index e6199a8d..52e72823 100644 --- a/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh +++ b/models/dynamics/state_descriptors/simple_planet_rel_state/include/simple_planet_rel_state.hh @@ -35,7 +35,6 @@ class SimplePlanetRelState : public SubscriptionBase, SimplePlanetRelState(std::string body_frame_name_, std::string planet_frame_name); - using SubscriptionBase::initialize; void initialize(jeod::DynBody & subject_body, jeod::DynManager & dyn_manager) override; void update() override; diff --git a/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh b/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh index dc9b69e0..feeca579 100644 --- a/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh +++ b/models/dynamics/state_overrides/twist_sway/include/twist_sway.hh @@ -237,7 +237,6 @@ public: TwistSway(const double & time_ref); ~TwistSway() override = default; - using SubscriptionBase::initialize; void initialize(double end_time); bool update(); void update_ecef(); diff --git a/models/dynamics/state_predictors/impact_point/include/impact_point.hh b/models/dynamics/state_predictors/impact_point/include/impact_point.hh index 26f0baeb..a61e631c 100644 --- a/models/dynamics/state_predictors/impact_point/include/impact_point.hh +++ b/models/dynamics/state_predictors/impact_point/include/impact_point.hh @@ -88,7 +88,6 @@ class ImpactPoint : public jeod::PlanetFixedPosition, ~ImpactPoint() override = default; void initialize() override; - using jeod::PlanetFixedPosition::initialize; void initialize( double ref_pos[3]); void update(); diff --git a/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh b/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh index b2312117..1dd90e22 100644 --- a/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh +++ b/models/environment/atmos/atmos_exec/include/atmosphere_exec.hh @@ -111,7 +111,6 @@ class AtmosphereExec : public AtmosphereExecInterface { ~AtmosphereExec() override = default; - using AtmosphereExecInterface::initialize; void initialize( jeod::TimeStandard & time_in); void update (); diff --git a/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh b/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh index 395f0373..dcf602df 100644 --- a/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh +++ b/models/environment/atmos/atmos_exec/include/atmosphere_exec_interface.hh @@ -59,7 +59,6 @@ class AtmosphereExecInterface : public SubscriptionBase const jeod::DynBody & body); ~AtmosphereExecInterface() override = default; - using SubscriptionBase::initialize; void initialize() override; std::string get_current_atmos_name() { diff --git a/models/fhw/effectors/rcs_generic/include/rcs_generic.hh b/models/fhw/effectors/rcs_generic/include/rcs_generic.hh index c3f0e050..c268aada 100644 --- a/models/fhw/effectors/rcs_generic/include/rcs_generic.hh +++ b/models/fhw/effectors/rcs_generic/include/rcs_generic.hh @@ -128,7 +128,6 @@ class RcsGeneric : public SubscriptionBase { explicit RcsGeneric (const unsigned int num_propellant_components_); ~RcsGeneric() override = default; - using SubscriptionBase::initialize; virtual void initialize( double time_step, const double * center_of_mass); void update( const int * rcs_command); diff --git a/models/utilities/buffers/include/tagged_ring_buffer.hh b/models/utilities/buffers/include/tagged_ring_buffer.hh index 8dd0bdac..1267934c 100644 --- a/models/utilities/buffers/include/tagged_ring_buffer.hh +++ b/models/utilities/buffers/include/tagged_ring_buffer.hh @@ -82,7 +82,6 @@ Note: intermediate instance. The code is ugly to read, but simplified with the use of aliases. *****************************************************************************/ - using CMLSimpleRingBuffer< CMLTaggedRingBufferMember< T_Tag, T_Data> >::buffer_data; virtual void buffer_data( T_Tag t, const T_Data & d) { diff --git a/models/vehicle_management/events_manager/include/watch_values_base_core.hh b/models/vehicle_management/events_manager/include/watch_values_base_core.hh index c40e1680..9deb8eb3 100644 --- a/models/vehicle_management/events_manager/include/watch_values_base_core.hh +++ b/models/vehicle_management/events_manager/include/watch_values_base_core.hh @@ -114,7 +114,6 @@ class WatchValuesBaseCore : public SubscriptionBase { ~WatchValuesBaseCore() override; - using SubscriptionBase::initialize; virtual void initialize( std::list * active_watch_in); void set_direction(int arg); From 1be5422ac28558d574e6eb194334e39cbcf0a612 Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Wed, 26 Aug 2026 17:23:20 -0500 Subject: [PATCH 6/7] Addressing the following issues from comments: - removed lines that got unit sims compile with the overloaded-virtual compiler flag error - a quick check to only use GCC specific compiler warnings if a user is compiling with GCC - removing a check to see if Trick exists from the test script Other issues to potentially be fixed with a merge with main Refs #16 --- bin/test.py | 23 +----------- cmake/SetCMLCompileWarnings.cmake | 36 ++++++++++--------- mkspecs/internal/cml_lib.mk | 2 +- .../extended_planetary_derived_state.hh | 2 +- .../range/include/range_computation.hh | 1 - .../include/fault_function.hh | 8 ----- .../math_utils/include/math_utils.hh | 2 +- models/utilities/math_utils/src/math_utils.cc | 6 ++-- .../include/generic_multi_input_table.hh | 6 ---- .../include/generic_single_input_table.hh | 7 ---- .../include/single_input_table_for_angles.hh | 6 ---- .../single_input_table_for_quaternions.hh | 6 ---- .../single_input_table_var_with_deriv.hh | 6 ---- .../verif/SIM_02_simple_table_lookup/S_define | 2 +- 14 files changed, 27 insertions(+), 86 deletions(-) diff --git a/bin/test.py b/bin/test.py index f426a7ad..65a75264 100755 --- a/bin/test.py +++ b/bin/test.py @@ -42,34 +42,13 @@ def _parse_args(): def _verify_args(args): ''' - Ensure Trick and JEOD areas exist and libs are built. If they aren't, all tests will fail + Ensure JEOD areas exist and libs are built. If they aren't, all tests will fail ''' # We need to know what TRICK_HOST_CPU is to find the libraries, so get that first cmd = ( os.path.join(args.trick, 'bin/trick-gte') + " TRICK_HOST_CPU") sys.path.append(os.path.abspath(os.path.join(args.trick, 'share/trick/trickops/'))) from WorkflowCommon import run_subprocess trick_host_cpu = run_subprocess(command=cmd,m_shell=True).stdout.strip().split("\n")[-1] - if "Linux" in trick_host_cpu: - trick_build_lib_dir = "lib64" - elif "Darwin" in trick_host_cpu: - trick_build_lib_dir = "lib" - if not args.trick or not os.path.exists(args.trick): - msg = ("Unable to locate trick directory. Define TRICK_HOME in your environment" - " or use --trick=/path/to/trick/ to specify a path to a pre-built Trick" - " directory (Requires version 19.5.1 or later)") - raise RuntimeError(msg) - if (not os.path.exists(os.path.join(args.trick, trick_build_lib_dir)) or - not os.listdir(os.path.join(args.trick, trick_build_lib_dir))): - msg = (f"Specified trick directory {args.trick} is missing built libraries. " - "Build trick for this platform to resolve this error.") - raise RuntimeError(msg) - if not args.jeod or not os.path.exists(args.jeod): - msg = ("Unable to locate JEOD directory. Define JEOD_HOME in your environment" - " or use --jeod=/path/to/jeod/ to specify a path to a JEOD" - " directory (Requires version 3.4 or later)") - raise RuntimeError(msg) - if not os.path.isfile(os.path.join(args.trick, trick_build_lib_dir + '/libtrick.a')): - raise RuntimeError(f"Trick hasn't been built. Build {args.trick} and try again.") if not os.path.isfile(os.path.join(args.jeod, 'lib_jeod_' + trick_host_cpu + '/libjeod.a' )): raise RuntimeError(f"JEOD library under {args.jeod} hasn't been built. See README.md for instructions and try again.") if not os.path.isfile(os.path.join(args.jeod, f'trickified/trickified_jeod_{trick_host_cpu}.o')): diff --git a/cmake/SetCMLCompileWarnings.cmake b/cmake/SetCMLCompileWarnings.cmake index d5cc7164..4818265d 100644 --- a/cmake/SetCMLCompileWarnings.cmake +++ b/cmake/SetCMLCompileWarnings.cmake @@ -12,6 +12,11 @@ include_guard() function(set_cml_compile_warnings TARGET) + # If the compiler is GCC, continue. Otherwise, return immediately. + if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + return() + endif() + set(CML_SHARED_WARNING_FLAGS # Keep these first since we may override some of the levels set for # certain warnings below. @@ -23,22 +28,28 @@ function(set_cml_compile_warnings TARGET) -Walloca -Wcast-align -Wcast-qual + -Wduplicated-branches + -Wduplicated-cond + -Wformat=1 + -Wformat-overflow=2 -Wformat-security -Wformat-signedness -Wformat-truncation + -Wimplicit-fallthrough=5 + -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnull-dereference -Wshadow -Wsign-conversion -Wswitch-enum + -Wtrampolines -Wundef -Wuninitialized -Wunused -Wunused-macros -Wvla ) - set(CML_C_WARNING_FLAGS -Wbad-function-cast -Wjump-misses-init @@ -47,30 +58,21 @@ function(set_cml_compile_warnings TARGET) -Wold-style-definition -Wstrict-prototypes ) - - # GCC-only warnings - set(GCC_ONLY_WARNINGS - -Wduplicated-branches - -Wduplicated-cond - -Wformat=1 - -Wformat-overflow=2 - -Wimplicit-fallthrough=5 - -Wlogical-op - -Wtrampolines + set(CML_CPP_WARNING_FLAGS -Wcatch-value=3 -Wconditionally-supported + -Wctor-dtor-privacy + -Wextra-semi -Wnoexcept + -Wnon-virtual-dtor + -Wold-style-cast -Wplacement-new=2 -Wstrict-null-sentinel + -Wsuggest-override -Wuseless-cast + -Wzero-as-null-pointer-constant ) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # GCC -> add GCC-only warnings - list(APPEND CML_CPP_WARNING_FLAGS ${GCC_ONLY_WARNINGS}) - list(APPEND CML_SHARED_WARNING_FLAGS ${GCC_ONLY_WARNINGS}) - endif() - target_compile_options(${TARGET} PRIVATE ${CML_SHARED_WARNING_FLAGS} diff --git a/mkspecs/internal/cml_lib.mk b/mkspecs/internal/cml_lib.mk index 4a4957f9..410b1685 100644 --- a/mkspecs/internal/cml_lib.mk +++ b/mkspecs/internal/cml_lib.mk @@ -88,7 +88,7 @@ TRICK_EXT_LIB_DIRS += :${CML_SOURCE_DIRS} TRICK_LDFLAGS += -L${CML_LIBRARY_DIR} ifeq (1, $(CML_USE_STATIC_LIB)) TRICK_LDFLAGS += -l:libcml.a -else ifeq ($(findstring Darwin,$(trick-gte TRICK_HOST_CPU)),) +else ifeq ($(trick-gte TRICK_HOST_CPU),Darwin) TRICK_LDFLAGS += -Wl,-rpath,${CML_LIBRARY_DIR} -lcml else TRICK_LDFLAGS += -Wl,-rpath=${CML_LIBRARY_DIR} -lcml diff --git a/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh b/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh index cb8d5c0d..c40ee15b 100644 --- a/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh +++ b/models/dynamics/state_descriptors/extended_planetary_derived_state/include/extended_planetary_derived_state.hh @@ -168,7 +168,7 @@ class ExtendedPlanetaryDerivedState : public jeod::PlanetaryDerivedState, ExtendedPlanetaryDerivedState(); ~ExtendedPlanetaryDerivedState() override = default; - using SubscriptionBase::initialize; + void initialize(jeod::DynBody & subject_body, jeod::DynManager & dyn_manager) override; void update() override; diff --git a/models/dynamics/state_descriptors/range/include/range_computation.hh b/models/dynamics/state_descriptors/range/include/range_computation.hh index 8a964935..963f97db 100644 --- a/models/dynamics/state_descriptors/range/include/range_computation.hh +++ b/models/dynamics/state_descriptors/range/include/range_computation.hh @@ -134,7 +134,6 @@ class RangeComputation : public RangeValues, RangeComputation(const jeod::PlanetFixedPosition & state_in); ~RangeComputation() override = default; - using SubscriptionBase::initialize; virtual void initialize( const jeod::Planet & planet_in); void set_reference_data_query(); /* external call to determine whether there is sufficient data to diff --git a/models/utilities/fault_management/include/fault_function.hh b/models/utilities/fault_management/include/fault_function.hh index 5bcf3161..81b222ba 100644 --- a/models/utilities/fault_management/include/fault_function.hh +++ b/models/utilities/fault_management/include/fault_function.hh @@ -31,10 +31,6 @@ class FaultFunctionBase : public Fault, public FaultFunctionParameter { Trianglewave }; -#ifdef SWIG -%immutable; -#endif - FaultFunctionBase(); ~FaultFunctionBase() override = default; @@ -71,10 +67,6 @@ class FaultFunctionBase : public Fault, public FaultFunctionParameter { double ind_prev; /* (--) The previous value of the independent variable. */ double freq_prev; /* (--) The previous value of the frequency. */ -#ifdef SWIG -%mutable; -#endif - private: FaultFunctionBase(const FaultFunctionBase&); FaultFunctionBase& operator = (const FaultFunctionBase&); diff --git a/models/utilities/math_utils/include/math_utils.hh b/models/utilities/math_utils/include/math_utils.hh index 764fda7e..22332b1b 100644 --- a/models/utilities/math_utils/include/math_utils.hh +++ b/models/utilities/math_utils/include/math_utils.hh @@ -975,7 +975,7 @@ Purpose: // [in] = [C_decomp] * [C_decomp]' => [inv(in)] = [inv(C)]' * [inv(C)] // and the inverse of the decomposed matrix is arithmetically simple to // compute. - double C_inv[dimension][dimension] = {{0}}; + double C_inv[dimension][dimension] = {}; for ( size_t ii = 0; ii < dimension; ii++) { // Note -- division by zero already checked above and method has // returned if any diagonal elements are zero. diff --git a/models/utilities/math_utils/src/math_utils.cc b/models/utilities/math_utils/src/math_utils.cc index 434cd429..533f4586 100644 --- a/models/utilities/math_utils/src/math_utils.cc +++ b/models/utilities/math_utils/src/math_utils.cc @@ -600,10 +600,10 @@ MathUtils::polynomial( double x, const double failed_val, const bool failed_flag) { - fenv_t env; + std::fenv_t env; // Temporary disable fp exceptions, storing the set of // previously configured exceptions. - const int fe_prev = feholdexcept(&env); + const int fe_prev = std::feholdexcept(&env); assert(-1 != fe_prev); // If -1, there was a failure double x_to_i = 1.0; @@ -630,7 +630,7 @@ MathUtils::polynomial( double x, } sum = failed_val; } - fesetenv(&env); // restore the previous settings of fp exceptions + std::fesetenv(&env); // restore the previous settings of fp exceptions return sum; } diff --git a/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh b/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh index 6f0a88b1..8583ed20 100644 --- a/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh +++ b/models/utilities/table_interp_cpp/include/generic_multi_input_table.hh @@ -35,9 +35,6 @@ Purpose: class GenericMultiInputTable { friend class SingleInputTableVarDeriv; -#ifdef SWIG -%immutable; -#endif protected: bool trivial_case; /* (--) Blocks the table-lookup when all independents have only one value. @@ -123,9 +120,6 @@ class GenericMultiInputTable bool precheck_output(); void generate_trivial_output(); bool index_checks(size_t & idx1, size_t & idx2, std::string func); -#ifdef SWIG -%mutable; -#endif private: bool load_data_internal_check( const SizeVec &dim_list ); diff --git a/models/utilities/table_interp_cpp/include/generic_single_input_table.hh b/models/utilities/table_interp_cpp/include/generic_single_input_table.hh index 710d5a73..c3430b1b 100644 --- a/models/utilities/table_interp_cpp/include/generic_single_input_table.hh +++ b/models/utilities/table_interp_cpp/include/generic_single_input_table.hh @@ -23,9 +23,6 @@ class GenericSingleInputTable : public GenericMultiInputTable { -#ifdef SWIG -%immutable; -#endif friend class SingleInputTableVarDeriv; public: bool initialize() override; @@ -35,10 +32,6 @@ class GenericSingleInputTable : public GenericMultiInputTable protected: void generate_base_values() override; bool generate_output() override; -#ifdef SWIG -%mutable; -#endif - private: // Disable the copy/assignment operators GenericSingleInputTable (const GenericSingleInputTable&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh b/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh index 7c66cacf..f636a546 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_for_angles.hh @@ -31,9 +31,6 @@ PROGRAMMERS: class SingleInputTableForAngles : public GenericSingleInputTable { -#ifdef SWIG -%immutable; -#endif public: bool output_in_radians; /* (--) Flag indicating that the output data will be interpreted as radians. @@ -57,9 +54,6 @@ class SingleInputTableForAngles : public GenericSingleInputTable protected: bool generate_output() override; void bound_to_half_circle( double & angle); -#ifdef SWIG -%mutable; -#endif private: // Disable the copy/assignment operators SingleInputTableForAngles (const SingleInputTableForAngles&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh b/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh index 1fe8ff05..d1650bb9 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_for_quaternions.hh @@ -30,9 +30,6 @@ PROGRAMMERS: class SingleInputTableForQuaternions : public GenericSingleInputTable { -#ifdef SWIG -%immutable; -#endif protected: QuaternionSphericalInterpolator sph_interp; /* (--) Instance of the interpolator.*/ @@ -59,9 +56,6 @@ class SingleInputTableForQuaternions : public GenericSingleInputTable protected: bool generate_output() override; -#ifdef SWIG -%mutable; -#endif private: // Disable the copy/assignment operators SingleInputTableForQuaternions (const SingleInputTableForQuaternions&); diff --git a/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh b/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh index d5c1b6af..1384cba5 100644 --- a/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh +++ b/models/utilities/table_interp_cpp/include/single_input_table_var_with_deriv.hh @@ -26,9 +26,6 @@ class SingleInputTableVarDeriv : public GenericSingleInputTable { -#ifdef SWIG -%immutable; -#endif public: GenericSingleInputTable derivs; /* (--) A parallel instance of GenericSingleInputTable used to manage the data @@ -63,9 +60,6 @@ class SingleInputTableVarDeriv : public GenericSingleInputTable bool initialize() override; protected: bool generate_output() override; -#ifdef SWIG -%mutable; -#endif private: // Disable the copy/assignment operators SingleInputTableVarDeriv (const SingleInputTableVarDeriv&); diff --git a/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define b/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define index b74010d0..7e5d47b8 100644 --- a/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define +++ b/models/utilities/table_interp_cpp/verif/SIM_02_simple_table_lookup/S_define @@ -14,7 +14,7 @@ Descending data runs with only 1 dependent while ascending data runs with 2 to p class TestingModelSimObject : public Trick::SimObject { public: double independent; - double dependent[12][2]; // (--) 11 tables, 2 data per table + double dependent[12][2]; // (--) 12 tables, 2 data per table double indep_incr; // (--) increment per cycle. int frame_count; int reverse_on_count; From fa90b469416f8c1fde948dd558796fc0f0a4453e Mon Sep 17 00:00:00 2001 From: Otney Boyd Crawford Date: Fri, 28 Aug 2026 09:09:46 -0500 Subject: [PATCH 7/7] Checking for Darwin_25 when setting the rpath flag for Mac Refs #16 --- mkspecs/internal/cml_lib.mk | 2 +- .../include/lagged_atmos_payload_data.hh | 26 +------------------ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/mkspecs/internal/cml_lib.mk b/mkspecs/internal/cml_lib.mk index 410b1685..3066074c 100644 --- a/mkspecs/internal/cml_lib.mk +++ b/mkspecs/internal/cml_lib.mk @@ -88,7 +88,7 @@ TRICK_EXT_LIB_DIRS += :${CML_SOURCE_DIRS} TRICK_LDFLAGS += -L${CML_LIBRARY_DIR} ifeq (1, $(CML_USE_STATIC_LIB)) TRICK_LDFLAGS += -l:libcml.a -else ifeq ($(trick-gte TRICK_HOST_CPU),Darwin) +else ifeq ($(shell trick-gte TRICK_HOST_CPU), Darwin_25) TRICK_LDFLAGS += -Wl,-rpath,${CML_LIBRARY_DIR} -lcml else TRICK_LDFLAGS += -Wl,-rpath=${CML_LIBRARY_DIR} -lcml diff --git a/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh b/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh index 3916c34a..a19317f3 100644 --- a/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh +++ b/models/environment/atmos/lagged_atmosphere/include/lagged_atmos_payload_data.hh @@ -45,31 +45,7 @@ class LaggedAtmosPayloadData { } // copy-constructor - LaggedAtmosPayloadData( const LaggedAtmosPayloadData& orig) - : - altitude(orig.altitude), - density(orig.density), - speed_of_sound(orig.speed_of_sound) - { - jeod::Vector3::copy(orig.planetodetic_wind_velocity, - planetodetic_wind_velocity); - } - - - LaggedAtmosPayloadData& operator=(const LaggedAtmosPayloadData& rhs) - { - if (this != &rhs) { - altitude = rhs.altitude; - density = rhs.density; - speed_of_sound = rhs.speed_of_sound; - - jeod::Vector3::copy(rhs.planetodetic_wind_velocity, - planetodetic_wind_velocity); - } - return *this; - } - - + LaggedAtmosPayloadData(const LaggedAtmosPayloadData& orig) = default; // copy assignment operator LaggedAtmosPayloadData& operator=(const LaggedAtmosPayloadData& orig) = default; };