Repository navigation
Sync version of upstream repository #49
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,46 +5,31 @@ | |
| class PowerGridModel < Formula | ||
| desc "Python/C++ library for distribution power system analysis" | ||
| homepage "https://lfenergy.org/projects/power-grid-model/" | ||
| url "https://github.com/PowerGridModel/power-grid-model/archive/refs/tags/v1.13.196.tar.gz" | ||
| sha256 "d42f484091b54e23ec0fc7bf6373c4f8524be0c86bef368a3e5ed9f06aaefe36" | ||
| url "https://github.com/PowerGridModel/power-grid-model/archive/refs/tags/v1.13.197.tar.gz" | ||
| sha256 "2d677450c70d92014541877eb4339cb56266b0d82a11cca541e5af99dd4e8630" | ||
| license "MPL-2.0" | ||
| head "https://github.com/PowerGridModel/power-grid-model.git", branch: "main" | ||
|
|
||
| depends_on "boost" => :build | ||
| depends_on "cmake" => :build | ||
| depends_on "eigen" => :build | ||
| depends_on "gcc@14" => :build | ||
| depends_on "msgpack-cxx" => :build | ||
| depends_on "ninja" => :build | ||
| depends_on "nlohmann-json" => :build | ||
|
|
||
| on_linux do | ||
| depends_on "gcc@16" => :build | ||
| end | ||
|
|
||
| fails_with :gcc do | ||
| version "15" | ||
| cause "Use the same GCC version as in main PGM" | ||
| end | ||
|
Comment on lines
+20
to
+27
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this not a problem? will it remain working on older linux versions? can't we simply bump default gcc version to 16?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what it does.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now I've realized something, let me think.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alright, i think it looks good then but let's double-check with @TonyXiang8787 because i remember having discussions about this while talking about #18
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on_linux do
depends_on "gcc@16" => :build
endThis block installs fails_with :gcc do
version "15"
cause "Use the same GCC version as in main PGM"
endChecks the systems This should guarantee it works correctly.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reading the docs in https://docs.brew.sh/rubydoc/Formula.html#fails_with-class_method it looks like you only test for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a slight difference in what it's used here and in the link you provide. The cookbook should clarify it https://docs.brew.sh/Formula-Cookbook#compiler-selection. In short fails_with :gcc do
version "15"
cause "Use the same GCC version as in main PGM"
endFails for fails_with :gcc "15" do
version "15.1"
cause "Use the same GCC version as in main PGM"
endwould indeed fail for 15 and 15.1 only for example, not older versions. |
||
|
|
||
| def install | ||
| rm buildpath/"VERSION" | ||
| (buildpath/"VERSION").write(version.to_s) | ||
| begin | ||
| system_gcc_version = Utils.safe_popen_read("gcc", "-dumpversion").strip.to_i | ||
| rescue | ||
| system_gcc_version = 0 | ||
| end | ||
|
|
||
| user_cxx = ENV["CXX"].to_s | ||
| user_cc = ENV["CC"].to_s | ||
| using_non_gcc = (!user_cxx.empty? && user_cxx.exclude?("g++")) || | ||
| (!user_cc.empty? && user_cc.exclude?("gcc")) | ||
|
|
||
| # If the user has not requested a non-GCC compiler and the system GCC version is less than 14, | ||
| # use the GCC 14 compiler from Homebrew. | ||
| # This minimum was added because we use some features in PGM not available in older versions of GCC. | ||
| if !using_non_gcc && system_gcc_version < 14 | ||
| gcc = Formula["gcc@14"] | ||
| system "cmake", "-GNinja", "-S", ".", "-B", "build", | ||
| "-DCMAKE_C_COMPILER=#{gcc.opt_bin}/gcc-14", | ||
| "-DCMAKE_CXX_COMPILER=#{gcc.opt_bin}/g++-14", | ||
| *std_cmake_args | ||
| else | ||
| system "cmake", "-GNinja", "-S", ".", "-B", "build", | ||
| *std_cmake_args | ||
| end | ||
| system "cmake", "-GNinja", "-S", ".", "-B", "build", *std_cmake_args | ||
| system "cmake", "--build", "build" | ||
| system "cmake", "--install", "build" | ||
| end | ||
|
|
||
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.
In #18 idea was to allow the option of compiling with any gcc >14 of the target using the formula if possible. And for targets with <=14 we mandate gcc=14. So with this PR we keep it same as PGM all the time?
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.
This PR aligns with PGM as of today, because
gcc16is what we use there. What happens here is that if the user's system providesgcc16then that's used, if they have<16thengcc16bottled fromhomebrewis used to build from source, and it should be compatible even if they have older ubuntu versions, hence why they provide a bottle.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.
This doesn't mean that if we change PGM to
gcc17in the future, we would automatically change here. Here it's manually pinned too.