-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
octave 10.1.0 #218368
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
base: main
Are you sure you want to change the base?
octave 10.1.0 #218368
Conversation
1106fb0
to
fc5e151
Compare
It seems that |
Compatibility of Dynare with Octave 10 seems to have been fixed upstream with this change: Maybe, you could cherry-pick that patch here... |
Some background to the change in Octave 10: |
The build rules on macOS have been slightly overhauled for Octave 10. You should no longer need the above modification of the source files. By default, Octave should no longer link mex or oct files to all dependencies. |
@@ -152,14 +152,14 @@ def install | |||
{ return ovl (42); } | |||
CPP | |||
system bin/"octave", "--eval", <<~MATLAB | |||
mkoctfile ('-v', '-std=c++11', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); | |||
mkoctfile ('-v', '-std=c++17', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkoctfile ('-v', '-std=c++17', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); | |
mkoctfile ('-v', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); |
The build system should have figured out automatically which flags are needed to tell the compiler to use the C++17 standard. The necessary flags should be stored and used by mkoctfile
automatically. No need to override it here.
If it turns out that you do need to override that here, please let me know. In any case, you should build with GNU extensions, i.e., -std=gnu++17
. But like written previously, preferably don't override the C++ standard flags at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I remove this, I got an error and so it is needed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I remove this, I got an error and so it is needed now.
That is unexpected.
Is it possible to see the output of the configure script when building Octave? At least the summary might already be helpful.
Does Homebrew set a CXX
environment variable when building/testing the packages? If it does, which value does it have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have access to an Apple device. So, I can't test myself.
Could you please install Octave 10.1.0 as it is built by the rules here? What does the following return for you?
unset CXX
mkoctfile -p CXX
I'd expect something like clang++ -std=gnu++17
. Is that the case for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my suspicion about the failing dynare tests is correct, the following change might also fix this:
mkoctfile ('-v', '-std=c++17', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); | |
unsetenv ('CXX'); | |
mkoctfile ('-v', '-L#{lib}/octave/#{version}', 'oct_demo.cc'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsetting CXX
for the duration of the tests of Octave might still be a nice modification.
Users shouldn't need to pass -std=gnu++17
every time they call mkoctfile
. They also shouldn't need to set CXX
manually.
It would be nice if the tests here could check if that works out of the box...
If CXX
needs to be set as an environment variable for the recipe for some reason, it might be best if you could append -std=gnu++17
to CXX
instead of passing the flag manually to mkoctfile
.
assert(oct_demo, 42) | ||
MATLAB | ||
# Test FLIBS environment variable | ||
system bin/"octave", "--eval", <<~MATLAB | ||
args = strsplit (mkoctfile ('-p', 'FLIBS')); | ||
args = args(~cellfun('isempty', args)); | ||
mkoctfile ('-v', '-std=c++11', '-L#{lib}/octave/#{version}', args{:}, 'oct_demo.cc'); | ||
mkoctfile ('-v', '-std=c++17', '-L#{lib}/octave/#{version}', args{:}, 'oct_demo.cc'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkoctfile ('-v', '-std=c++17', '-L#{lib}/octave/#{version}', args{:}, 'oct_demo.cc'); | |
mkoctfile ('-v', '-L#{lib}/octave/#{version}', args{:}, 'oct_demo.cc'); |
Same motivation as a couple of lines above.
While at it, maybe you could also consider using the patch I proposed in another issue: |
Another potential caveat for the update: It might be better to depend on the version of iconv that is distributed by Homebrew. Otherwise, some text encoding conversion facilities in Octave might no longer work on macOS 14 or newer. |
9a66f16
to
f91a38b
Compare
f91a38b
to
17d8e63
Compare
The build error looks like Octave fails to compile some sources from the statistics package. homebrew-core/Formula/d/dynare.rb Line 85 in c5beefe
Newer versions of the statistics package are available now: https://github.com/gnu-octave/statistics/releases/tag/release-1.7.3 Could you please try if updating to the latest statistics package avoids that compilation error? |
By the way: Is it possible to have a look at the output of the configure script in the CI run? |
e85116c
to
563a4bc
Compare
563a4bc
to
707720b
Compare
Still the same build error. I'm suspecting that something is setting the environment variable Could you please try to add |
A potential implementation of that idea in Octave syntax could be the following code snippet change in
|
707720b
to
a946fc2
Compare
a946fc2
to
22af215
Compare
22af215
to
c822f91
Compare
It looks like this is finally building and passing the tests now. 🎉 I still suspect that executing Would it be possible to use Homebrew's |
@mmuetzel Thank you for the huge help and now it seems fine. I am not confident to change |
Thank you for taking this on.
Ok. It might be okay to leave that for a later day. Would it be ok to attempt to address #201376 as part of the update though? I'm afraid that if this isn't addressed with the major version update now, it won't be addressed for the foreseeable future again. |
Looking at octave.rb, you are already appending to one of the startup files here: homebrew-core/Formula/o/octave.rb Lines 136 to 138 in ad64701
Maybe, you could expand that to something like this to address #201376:
This is assuming that Also please note that I don't know whether the above change is valid Ruby syntax. (It is valid Octave syntax.) But I hope you can see what I attempted to do. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To keep this pull request open, add a |
@cho-m, @daeho-ro: Would it be ok to use something like the code snippet proposed in #218368 (comment) to address #201376? To check whether this is working correctly, you could try and install an Octave package that (partly) consists of Fortran sources (e.g., call |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To keep this pull request open, add a |
@cho-m, @daeho-ro: Did you come around to testing whether the code snippet proposed in #218368 (comment) would work? I don't have access to a macOS computer. So, I can't test myself. |
I am not experts on the C related languages, I just tried to pass the CI build errors. I understand that the flag cc. @Homebrew/core |
Just to clarify: The proposed changes won't address whether an explicit #201376 is about the fact that some standard library locations for Fortran change when Homebrew updates Without these changes, users won't be able to build .oct or .mex files that (partly) consist of Fortran sources or install packages that contain Fortran sources after Homebrew updates to a newer version of |
Our users on macOS would love to get the latest version of Octave with Homebrew. |
Uses mkoctfile "--std=c++17" flxes (in the tests) that were proposed to core Homebrew but not merged yet as of 2025-05-13, in their PR for Octave 10.1.0. See Homebrew/homebrew-core#218368 and Homebrew/homebrew-core#218368 (comment). Does not include the larger mkoctfile Fortran compiler fix (munging Octave's site-rcfile with Fortran flags) proposed in Homebrew/homebrew-core#218368 (comment). Will tackle that in a separate formula and branch.
In the mean time, users can grab 10.1 from the octave-app custom tap. It has landed there, and looks pretty much like the formula here. Just have to run it with the command
Also, the
I'll see about getting you remote access to a Mac build box, @mmuetzel. |
@@ -48,6 +49,11 @@ class Dynare < Formula | |||
sha256 "fa80f7c75dab6bfaca93c3b374c774fd87876f34fba969af9133eeaea5f39a3d" | |||
end | |||
|
|||
patch do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this get a comment explaining what it's doing/why it's needed/upstream bug report?
ENV.cxx | ||
ENV.append "CXXFLAGS", "-std=gnu++17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly a comment here would be good.
@apjanke : |
@oscarbg :
Hmm. That should've worked. That That's not a core Homebrew formula, so please drop by the Octave.app repo and report that as an issue there - https://github.com/octave-app/octave-app/issues - and we can figure it out. |
@apjanke found issue and fixed it! opened issue for others to see: |
Created by
brew bump
Created with
brew bump-formula-pr
.