Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe common ways of using ModelicaUtilities.h #3455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

henrikt-ma
Copy link
Collaborator

This was factored out of #3452, as promised in #3452 (comment).

In addition to examples and other non-normative text, this PR makes clear that #include "ModelicaUtilities.h" shall work inside an Include annotation.

\end{example}

\begin{nonnormative}
There is no standardized way to build external libraries using the functions in \filename{ModelicaUtilities.h}.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The term "standardized" is a bit ambiguous, would it be possible to be clearer?

As a library developer ideally one would want a tool-independent way of building external libraries using them; having a standardized tool-dependent way would be messy, and we have neither (that's why wrappers are needed even if building libraries for Modelica - but on the other hand making the library independent of Modelica has benefits).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm... Having tested a few things within ModelicaStandardLibrary I'm not sure how necessary and correct this is.

The current build-projects for resources just includes ModelicaUtilities.h; and doesn't do any special tricks, so it seems there is at least a tool-dependent way of building external libraries using the function in ModelicaUtilities.h; and the resulting library may even be portable between tools (I haven't checked).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The term "standardized" is a bit ambiguous, would it be possible to be clearer?

Yes, it would be possible, but I'd also like to avoid introducing new ways to talk about what is determined by the document itself. For example, we currently have formulations such as

The license file is standardized.
or
Obfuscation and encryption are not standardized.

Hence, I'm somewhat skeptical to use a formulation like this instead:

Suggested change
There is no standardized way to build external libraries using the functions in \filename{ModelicaUtilities.h}.
The Modelica specification does not describe any way to build external libraries using the functions in \filename{ModelicaUtilities.h}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The current build-projects for resources just includes ModelicaUtilities.h; and doesn't do any special tricks, so it seems there is at least a tool-dependent way of building external libraries using the function in ModelicaUtilities.h; and the resulting library may even be portable between tools (I haven't checked).

The MSL is cheating by including its own copy of ModelicaUtilities.h. We don't want a solution where there's a copy of this file in every library; it would make it impossible to develop the contents of the file. Instead, there should be a mechanism for tools to tell (CMake projects à la #1668) where they provide this file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But even if MSL is "cheating" - it seems odd to specify that the approach that is currently used shouldn't work. I agree that we need something better, but requiring a change before we have a the better approach seems problematic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That we state that there is no standardized way is not the same as saying that there is nothing that could work in non-standardized ways.

Copy link
Member

Choose a reason for hiding this comment

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

The MSL is cheating by including its own copy of ModelicaUtilities.h.

Which no longer is true as of modelica/ModelicaStandardLibrary#3871.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, this just shifts the discussion to whether what is done inside .CI could be considered a standardized non-cheating solution for building the binaries. I still think it isn't; the CI is like its own tool environment, providing its own ModelicaUtilities.h (as every tool environment should) and building the binaries in a way which hasn't been standardized (and probably won't be either, as everything points in the direction of going with CMake for standardization).

@HansOlsson HansOlsson added this to the 2024-2 milestone Mar 25, 2024
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.

3 participants