Skip to content

16 fpe code doesn t work on mac - #68

Draft
jman025 wants to merge 6 commits into
mainfrom
16-fpe-code-doesn-t-work-on-mac
Draft

16 fpe code doesn t work on mac#68
jman025 wants to merge 6 commits into
mainfrom
16-fpe-code-doesn-t-work-on-mac

Conversation

@jman025

@jman025 jman025 commented Jul 23, 2026

Copy link
Copy Markdown

No description provided.

Otney Boyd Crawford added 2 commits June 24, 2026 14:43
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
…D=1 on Mac

Also includes #ifdef SWIG fix for swig attempting to access private class information

Refs #16
@ninotarantino

Copy link
Copy Markdown
Contributor

This is a few commits behind so go ahead and rebase or merge main into this branch first.

ExtendedPlanetaryDerivedState();
~ExtendedPlanetaryDerivedState() override = default;

using SubscriptionBase::initialize;

@ninotarantino ninotarantino Aug 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick note about these before you go too far down this rabbit hole: this is downstream from #27. We're better off ignoring the warning generated by overloading virtual functions for now with (off the top of my head) -Wno-error=overloaded-virtual, we don't want to make this change. This doesn't trip up on Linux for now because -Woverloaded-virtual isn't included in -Wall in GCC 8.5, but it is in newer GCCs.

The reason we don't want to make this change is because that SubscriptionBase::initialize function is intended to be overridden. If we added this, users would be able to call the wrong initialize() method as opposed to the overloaded one with arguments in some of these models. There's some architectural work that needs to happen to address that warning, so it'll definitely be its own PR in the future. I think the solution will probably be something along the lines of making SubscriptionBase::initialize a method named something like initialize_subscription() and not virtual, but I haven't spent time thinking about the ramifications yet.

Branch works on Linux as well.

Refs #16
-Walloca
-Wcast-align
-Wcast-qual
-Wduplicated-branches

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this file I'm tempted to say let's just return at the start of the function if the compiler isn't GCC and keep the rest as it was before. Most contributions to CML currently come from people using GCC on Rocky 8 and if they can't easily reproduce mac-only warnings, that'll be difficult to deal with. Maybe we'll add mac warnings in the future though.

Comment thread bin/test.py
Comment on lines +47 to +62
# 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))):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just remove this entire section that checks if Trick exists. It'll be immediately obvious if it doesn't when you run the script regardless, there's no need to maintain extra code to check for it.

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)),)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably just make this a direct comparison with Darwin using trick-gte TRICK_HOST_TYPE instead.

Comment on lines +15 to +16
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should have already been removed in this file along with the Wno-nonnul-compare. l I think this branch is a bit behind. Try rebasing or merging main and reverting the changes to this file first. We can probably essentially get rid of every change in here.

RangeComputation(const jeod::PlanetFixedPosition & state_in);
~RangeComputation() override = default;

using SubscriptionBase::initialize;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all still need to be removed.

Comment on lines +34 to +36
#ifdef SWIG
%immutable;
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these in the Rocky 9 compatibility branch which was just merged. Go ahead and revert the ones on this branch and see if the ones I added are enough to get builds on mac working.

// and the inverse of the decomposed matrix is arithmetically simple to
// compute.
double C_inv[dimension][dimension] = {0};
double C_inv[dimension][dimension] = {{0}};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified, the zero is redundant in the first place.

Suggested change
double C_inv[dimension][dimension] = {{0}};
double C_inv[dimension][dimension] {};

const double failed_val,
const bool failed_flag)
{
fenv_t env;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fenv_t env;
std::fenv_t env;

Ditto further down in this file, we should be using the C++ std::feholdexcept and std::fesetenv.

public:
double independent;
double dependent[11][2]; // (--) 11 tables, 2 data per table
double dependent[12][2]; // (--) 11 tables, 2 data per table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the comment.

Suggested change
double dependent[12][2]; // (--) 11 tables, 2 data per table
double dependent[12][2]; // (--) 12 tables, 2 data per table

Comment thread trickified/makefile
Comment on lines -12 to -14
ifeq ($(shell pkg-config --exists libxml-2.0 && echo $$?),0)
export TRICKIFY_CXX_FLAGS += $(shell pkg-config libxml-2.0 --cflags)
endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably going to cause the Rocky build to fail because it won't be able to find libxml types that the headers need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants