Skip to content

Commit b69286c

Browse files
committed
nwchem: use libomp on macOS
1 parent ce6f999 commit b69286c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Formula/n/nwchem.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Nwchem < Formula
55
version "7.2.3"
66
sha256 "7788e6af9be8681e6384b8df4df5ac57d010b2c7aa50842d735c562d92f94c25"
77
license "ECL-2.0"
8-
revision 1
8+
revision 2
99

1010
livecheck do
1111
url :stable
@@ -37,6 +37,10 @@ class Nwchem < Formula
3737

3838
uses_from_macos "libxcrypt"
3939

40+
on_macos do
41+
depends_on "libomp"
42+
end
43+
4044
# fix download url in build_dftd3a.sh, upstream pr ref, https://github.com/nwchemgit/nwchem/pull/1054
4145
patch do
4246
url "https://github.com/nwchemgit/nwchem/commit/65ce7726d9fa418f7c01665bebfc1e2181f15adf.patch?full_index=1"
@@ -47,6 +51,9 @@ def install
4751
pkgshare.install "QA"
4852

4953
cd "src" do
54+
# Workaround to link to LLVM OpenMP (libomp) with gfortran
55+
inreplace "config/makefile.h", /(\bLDOPTIONS *\+= *)-fopenmp$/, "\\1-lomp" if OS.mac?
56+
5057
(prefix/"etc").mkdir
5158
(prefix/"etc/nwchemrc").write <<~EOS
5259
nwchem_basis_library #{pkgshare}/libraries/

0 commit comments

Comments
 (0)