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

gcc 12.1.0 #106755

Closed
wants to merge 57 commits into from
Closed

gcc 12.1.0 #106755

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c64eff0
gcc 12.1.0
carlocab Jul 28, 2022
3b3f008
libgccjit 12.1.0
fxcoudert Apr 29, 2022
c592317
abyss: revision for gcc
fxcoudert Apr 30, 2022
8b105ae
adios2: revision for gcc
fxcoudert Apr 30, 2022
729e1b7
armadillo: revision for gcc
fxcoudert Apr 30, 2022
a570805
arpack: revision for gcc
fxcoudert Apr 30, 2022
5c246b1
btop: revision bump (gcc 12.1.0)
carlocab Jul 30, 2022
28cb8cc
cgns: revision for gcc
fxcoudert Apr 30, 2022
782677e
cp2k: revision for gcc
fxcoudert Apr 30, 2022
62d94ef
dungeon: revision for gcc
fxcoudert Apr 30, 2022
5962705
dynare: revision for gcc 12
fxcoudert Apr 30, 2022
a8de585
eccodes: revision for gcc
fxcoudert Apr 30, 2022
e893c94
ensmallen: revision for gcc
fxcoudert Apr 30, 2022
533c467
fastme: revision for gcc
fxcoudert Apr 30, 2022
e1ef8da
fftw: revision for gcc
fxcoudert Apr 30, 2022
405b017
giza: revision for gcc
fxcoudert Apr 30, 2022
e3dfc46
gromacs: revision for gcc
fxcoudert Apr 30, 2022
a3c9c72
hdf5-mpi: revision for gcc
fxcoudert Apr 30, 2022
afe5640
hdf5: revision for gcc
fxcoudert Apr 30, 2022
686a3f3
[email protected]: revision for gcc
fxcoudert Apr 30, 2022
1ad4030
[email protected]: revision for gcc
fxcoudert Apr 30, 2022
af0b271
highs: revision for gcc
fxcoudert May 1, 2022
d859e4c
imake: revision bump (gcc 12.1.0)
carlocab Jul 30, 2022
d7f2879
ipopt: revision for gcc
fxcoudert Apr 30, 2022
43985fb
json-fortran: revision for gcc
fxcoudert Apr 30, 2022
fd0a203
julia: revision bump (gcc 12.1.0)
carlocab Aug 1, 2022
c3246c2
kahip: revision for gcc
fxcoudert Apr 30, 2022
4c7cbe5
kim-api: revision for gcc
fxcoudert Apr 30, 2022
9fe4084
lapack: revision for gcc
fxcoudert Apr 30, 2022
1370d0b
libxc: revision for gcc
fxcoudert Apr 30, 2022
4770ccf
matplotplusplus: revision bump (gcc 12.1.0)
carlocab Aug 3, 2022
649a882
mlpack: revision bump (gcc 12.1.0)
carlocab Jul 30, 2022
de09fe1
mpich: revision for gcc
fxcoudert Apr 30, 2022
5c0bdb8
msc-generator: revision for gcc
fxcoudert May 1, 2022
b156b21
netcdf: revision for gcc
fxcoudert Apr 30, 2022
5f5014c
numpy: revision for gcc
fxcoudert Apr 30, 2022
3a8be98
nwchem: revision for gcc
fxcoudert Apr 30, 2022
dd9e14a
octave: revision for gcc
fxcoudert Apr 30, 2022
9054337
open-mpi: revision for gcc
fxcoudert Apr 30, 2022
3628465
openblas: revision for gcc
fxcoudert Apr 30, 2022
fe3bbc0
opencoarrays: revision for gcc
fxcoudert Apr 30, 2022
ca89d57
openfast: revision for gcc
fxcoudert Apr 30, 2022
107686c
openkim-models: revision for gcc
fxcoudert Apr 30, 2022
d203009
openmodelica: revision bump (gcc 12.1.0)
carlocab Jul 30, 2022
1859575
packmol: revision for gcc
fxcoudert Apr 30, 2022
2ae33db
petsc-complex: revision for gcc
fxcoudert Apr 30, 2022
f9aa044
petsc: revision for gcc
fxcoudert Apr 30, 2022
9826ef9
plplot: revision for gcc
fxcoudert Apr 30, 2022
6e102fc
pnetcdf: revision for gcc
fxcoudert Apr 30, 2022
d0699ae
pythran: revision for gcc
fxcoudert May 1, 2022
ca541b6
qd: revision for gcc
fxcoudert Apr 30, 2022
32af4c3
qrupdate: revision for gcc
fxcoudert Apr 30, 2022
83e364d
r: revision for gcc
fxcoudert Apr 30, 2022
12c2757
reprepro: revision for gcc
fxcoudert Apr 30, 2022
5488161
root: revision for gcc
fxcoudert Apr 30, 2022
2d7deb1
scalapack: revision for gcc
fxcoudert Apr 30, 2022
f372ece
scipy: revision for gcc
fxcoudert Apr 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions Formula/abyss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Abyss < Formula
url "https://github.com/bcgsc/abyss/releases/download/2.3.5/abyss-2.3.5.tar.gz"
sha256 "5455f7708531681ee15ec4fd5620526a53c86d28f959e630dc495f526b7d40f7"
license all_of: ["GPL-3.0-only", "LGPL-2.1-or-later", "MIT", "BSD-3-Clause"]
revision 1

livecheck do
url :stable
Expand Down
1 change: 1 addition & 0 deletions Formula/adios2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Adios2 < Formula
url "https://github.com/ornladios/ADIOS2/archive/v2.8.2.tar.gz"
sha256 "9909f6409dc44b2c28c1fda0042dab4b711f25ec3277ef0cb6ffc40f5483910d"
license "Apache-2.0"
revision 1
head "https://github.com/ornladios/ADIOS2.git", branch: "master"

livecheck do
Expand Down
1 change: 1 addition & 0 deletions Formula/armadillo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Armadillo < Formula
url "https://downloads.sourceforge.net/project/arma/armadillo-11.2.3.tar.xz"
sha256 "4c2e97ce60707fc1f348f44f7af0cb6d2466d0aad0d0ea4bf5d5dc180e6cba41"
license "Apache-2.0"
revision 1

livecheck do
url :stable
Expand Down
2 changes: 1 addition & 1 deletion Formula/arpack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Arpack < Formula
url "https://github.com/opencollab/arpack-ng/archive/3.8.0.tar.gz"
sha256 "ada5aeb3878874383307239c9235b716a8a170c6d096a6625bfd529844df003d"
license "BSD-3-Clause"
revision 1
revision 2
head "https://github.com/opencollab/arpack-ng.git", branch: "master"

bottle do
Expand Down
2 changes: 1 addition & 1 deletion Formula/btop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Btop < Formula
desc "Resource monitor. C++ version and continuation of bashtop and bpytop"
homepage "https://github.com/aristocratos/btop"
license "Apache-2.0"
revision 1
revision 2
head "https://github.com/aristocratos/btop.git", branch: "main"

# Remove stable block when patch is no longer needed.
Expand Down
2 changes: 1 addition & 1 deletion Formula/cgns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Cgns < Formula
url "https://github.com/CGNS/CGNS/archive/v4.3.0.tar.gz"
sha256 "7709eb7d99731dea0dd1eff183f109eaef8d9556624e3fbc34dc5177afc0a032"
license "BSD-3-Clause"
revision 1
revision 2
head "https://github.com/CGNS/CGNS.git", branch: "develop"

livecheck do
Expand Down
2 changes: 1 addition & 1 deletion Formula/cp2k.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Cp2k < Formula
url "https://github.com/cp2k/cp2k/releases/download/v8.2.0/cp2k-8.2.tar.bz2"
sha256 "2e24768720efed1a5a4a58e83e2aca502cd8b95544c21695eb0de71ed652f20a"
license "GPL-2.0-or-later"
revision 1
revision 2

bottle do
sha256 cellar: :any, arm64_monterey: "ef6bb7c803d002b2137cdbc8ce2b84f7ae7be46f8a87fe8c82745722dbbf9e45"
Expand Down
2 changes: 1 addition & 1 deletion Formula/dungeon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Dungeon < Formula
url "https://github.com/GOFAI/dungeon/archive/4.1.tar.gz"
sha256 "b88c49ef60e908e8611257fbb5a6a41860e1058760df2dfcb7eb141eb34e198b"
license "HPND"
revision 2
revision 3

bottle do
rebuild 1
Expand Down
1 change: 1 addition & 0 deletions Formula/dynare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class Dynare < Formula
desc "Platform for economic models, particularly DSGE and OLG models"
homepage "https://www.dynare.org/"
license "GPL-3.0-or-later"
revision 1

# Remove when patch is no longer needed.
stable do
Expand Down
1 change: 1 addition & 0 deletions Formula/eccodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Eccodes < Formula
url "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.26.0-Source.tar.gz"
sha256 "392f632612e16a8c0bb0b8f6d627cbc3f54e56f51ace05bceac368377ab52e49"
license "Apache-2.0"
revision 1

livecheck do
url "https://confluence.ecmwf.int/display/ECC/Releases"
Expand Down
1 change: 1 addition & 0 deletions Formula/ensmallen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Ensmallen < Formula
url "https://github.com/mlpack/ensmallen/archive/2.19.0.tar.gz"
sha256 "f9b280e03266b308d2772ab7e1dd962adcfa98b0552b05795f8ac81ec15eb270"
license "BSD-3-Clause"
revision 1
head "https://github.com/mlpack/ensmallen.git", branch: "master"

bottle do
Expand Down
1 change: 1 addition & 0 deletions Formula/fastme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Fastme < Formula
homepage "http://www.atgc-montpellier.fr/fastme/"
url "https://gite.lirmm.fr/atgc/FastME/raw/v2.1.6.3/tarball/fastme-2.1.6.3.tar.gz"
sha256 "09a23ea94e23c0821ab75f426b410ec701dac47da841943587443a25b2b85030"
revision 1

livecheck do
url "https://gite.lirmm.fr/atgc/FastME.git"
Expand Down
1 change: 1 addition & 0 deletions Formula/fftw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Fftw < Formula
url "https://fftw.org/fftw-3.3.10.tar.gz"
sha256 "56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467"
license all_of: ["GPL-2.0-or-later", "BSD-2-Clause"]
revision 1

livecheck do
url :homepage
Expand Down
67 changes: 25 additions & 42 deletions Formula/gcc.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
class Gcc < Formula
desc "GNU compiler collection"
homepage "https://gcc.gnu.org/"
url "https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-11.3.0/gcc-11.3.0.tar.xz"
sha256 "b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39"
url "https://ftp.gnu.org/gnu/gcc/gcc-12.1.0/gcc-12.1.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-12.1.0/gcc-12.1.0.tar.xz"
sha256 "62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b"
license "GPL-3.0-or-later" => { with: "GCC-exception-3.1" }
revision 2
head "https://gcc.gnu.org/git/gcc.git", branch: "master"

livecheck do
Expand Down Expand Up @@ -43,12 +42,10 @@ class Gcc < Formula
cxxstdlib_check :skip

# Branch from the Darwin maintainer of GCC, with a few generic fixes and
# Apple Silicon support, located at https://github.com/iains/gcc-11-branch
# Apple Silicon support, located at https://github.com/iains/gcc-darwin-arm64
patch do
on_arm do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/07e71538/gcc/gcc-11.3.0-arm.diff"
sha256 "857390a7f32dbfc4c7e6163a3b3b9d5e1d392e5d9c74c3ebb98701c1d0629565"
end
url "https://raw.githubusercontent.com/Homebrew/formula-patches/76677f2b/gcc/gcc-12.1.0-arm.diff"
sha256 "a000f1d9cb1dd98c7c4ef00df31435cd5d712d2f9d037ddc044f8bf82a16cf35"
end

def version_suffix
Expand All @@ -64,17 +61,17 @@ def install
ENV.delete "LD"

# We avoiding building:
# - Ada, which requires a pre-existing GCC Ada compiler to bootstrap
# - Ada and D, which require a pre-existing GCC Ada compiler to bootstrap
# - Go, currently not supported on macOS
# - BRIG
languages = %w[c c++ objc obj-c++ fortran]
languages << "d" if Hardware::CPU.intel?

pkgversion = "Homebrew GCC #{pkg_version} #{build.used_options*" "}".strip

# Use `lib/gcc/current` to provide a path that doesn't change with GCC's version.
args = %W[
--prefix=#{opt_prefix}
--libdir=#{opt_lib}/gcc/#{version_suffix}
--libdir=#{opt_lib}/gcc/current
Comment on lines +71 to +74
Copy link
Member Author

Choose a reason for hiding this comment

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

CC @fxcoudert, in case this is not a good idea.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's a good idea, and I cannot see any drawback. But, this is a subtle issue, so I might be overlooking something 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's the subtle issues that I'm concerned about. Ah well, hopefully nothing 💥s

--disable-nls
--enable-checking=release
--with-gcc-major-version-only
Expand All @@ -87,21 +84,19 @@ def install
--with-zstd=#{Formula["zstd"].opt_prefix}
--with-pkgversion=#{pkgversion}
--with-bugurl=#{tap.issues_url}
--with-system-zlib
]
# libphobos is part of gdc
args << "--enable-libphobos" if Hardware::CPU.intel?

if OS.mac?
cpu = Hardware::CPU.arm? ? "aarch64" : "x86_64"
args << "--build=#{cpu}-apple-darwin#{OS.kernel_version.major}"
args << "--with-system-zlib"

# System headers may not be in /usr/include
sdk = MacOS.sdk_path_if_needed
args << "--with-sysroot=#{sdk}" if sdk
else
# Fix cc1: error while loading shared libraries: libisl.so.15
args << "--with-boot-ldflags=-static-libstdc++ -static-libgcc #{ENV["LDFLAGS"]}"
args << "--with-boot-ldflags=-static-libstdc++ -static-libgcc #{ENV.ldflags}"

# Fix Linux error: gnu/stubs-32.h: No such file or directory.
args << "--disable-multilib"
Expand All @@ -120,26 +115,27 @@ def install
# temporary location, then move into the cellar path.
system "make", "install-strip", "DESTDIR=#{Pathname.pwd}/../instdir"
mv Dir[Pathname.pwd/"../instdir/#{opt_prefix}/*"], prefix
end

bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
bin.install_symlink bin/"gdc-#{version_suffix}" => "gdc" if Hardware::CPU.intel?
bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"

if OS.linux?
# Only the newest brewed gcc should install gfortan libs as we can only have one.
lib.install_symlink Dir[lib/"gcc/#{version_suffix}/libgfortran.*"]
end
end
# Provide a `lib/gcc/xy` directory to align with the versioned GCC formulae.
# We need to create `lib/gcc/xy` as a directory and not a symlink to avoid `brew link` conflicts.
(lib/"gcc"/version_suffix).install_symlink (lib/"gcc/current").children

# Only the newest brewed gcc should install gfortan libs as we can only have one.
lib.install_symlink lib.glob("gcc/current/libgfortran.*") if OS.linux?

# Handle conflicts between GCC formulae and avoid interfering
# with system compilers.
# Rename man7.
Dir.glob(man7/"*.7") { |file| add_suffix file, version_suffix }
man7.glob("*.7") { |file| add_suffix file, version_suffix }
# Even when we disable building info pages some are still installed.
info.rmtree

# Work around GCC install bug
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664
rm_rf Dir[bin/"*-gcc-tmp"]
rm_rf bin.glob("*-gcc-tmp")
end

def add_suffix(file, suffix)
Expand Down Expand Up @@ -210,7 +206,7 @@ def post_install
# * `-L#{HOMEBREW_PREFIX}/lib` instructs gcc to find the rest
# brew libraries.
# Note: *link will silently add #{libdir} first to the RPATH
libdir = HOMEBREW_PREFIX/"lib/gcc/#{version_suffix}"
libdir = HOMEBREW_PREFIX/"lib/gcc/current"
Copy link
Member Author

@carlocab carlocab Jul 28, 2022

Choose a reason for hiding this comment

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

@iMichka @danielnachun I don't know what this does, so would be good to check that this makes sense.

I'm also not clear on why we don't want opt_lib here, as in opt_lib/"gcc/current".

Copy link
Member

Choose a reason for hiding this comment

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

We can clean this up in a second step as this is in the postinstall block.

current looks ok to me given the other changes to gcc made here.
There are some explanations above: the spec file just makes sure the right -L flags are passed when using brewed gcc (without shims, so when you want to compile your own stuff locally). With this our users don't need to set the -L flags manually for the internal gcc libraries.

As to why not using opt_lib: why not, might be worth a try.

specs.write specs_string + <<~EOS
*cpp_unique_options:
+ -isysroot #{HOMEBREW_PREFIX}/nonexistent #{system_header_dirs.map { |p| "-idirafter #{p}" }.join(" ")}
Expand Down Expand Up @@ -239,7 +235,7 @@ def post_install
}
EOS
system "#{bin}/gcc-#{version_suffix}", "-o", "hello-c", "hello-c.c"
assert_equal "Hello, world!\n", `./hello-c`
assert_equal "Hello, world!\n", shell_output("./hello-c")

(testpath/"hello-cc.cc").write <<~EOS
#include <iostream>
Expand All @@ -254,7 +250,7 @@ def post_install
}
EOS
system "#{bin}/g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc"
assert_equal "Hello, world!\n", `./hello-cc`
assert_equal "Hello, world!\n", shell_output("./hello-cc")

(testpath/"test.f90").write <<~EOS
integer,parameter::m=10000
Expand All @@ -268,19 +264,6 @@ def post_install
end
EOS
system "#{bin}/gfortran", "-o", "test", "test.f90"
assert_equal "Done\n", `./test`

if Hardware::CPU.intel?
(testpath/"hello_d.d").write <<~EOS
import std.stdio;
int main()
{
writeln("Hello, world!");
return 0;
}
EOS
system "#{bin}/gdc-#{version_suffix}", "-o", "hello-d", "hello_d.d"
assert_equal "Hello, world!\n", `./hello-d`
end
assert_equal "Done\n", shell_output("./test")
end
end
Loading