You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: buildfile.m
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,15 @@ function build_exe(context)
141
141
if isempty(comp)
142
142
disp("set FC environment variable to the Fortran compiler path, or do 'mex -setup fortran'")
143
143
if ismac()
144
+
p ='/opt/homebrew/bin/';
145
+
for fc = ["flang", "gfortran"]
146
+
comp =stdlib.which(fc, p);
147
+
if ~isempty(comp)
148
+
disp("found "+fc+" compiler: "+comp)
149
+
setenv("FC", comp);
150
+
return
151
+
end
152
+
end
144
153
disp("on macOS, environment variables propagate in to GUI programs like Matlab by using 'launchctl setenv FC' and a reboot. Or by using 'FC=gfortran matlab -batch buildtool exe'")
0 commit comments