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
On my Mac (institute managed, u123456 is my assumed institute login), this gave a permission problem, which I solved by:
$ cd /usr/local/share/zsh/
$ /usr/bin/sudo /usr/sbin/chown -R u123456:admin site-functions
c. $ brew install gcc
(Or, if you have an old version: $ brew upgrade)
This gave me a permission problem, which I solved by:
$ /usr/bin/sudo /usr/sbin/chown -R u123456:admin /usr/local/share/zsh
$ chmod u+w /usr/local/share/zsh
d. gfortran --version
(Check if you get a good answer to confirm that your installation was correct.)
Get around dynamic libraries (if you want to use your executable on another Mac)
This example is with version 13, update to your gfortran version number:
$ sudo mv /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib_BKP
$ sudo mv /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib_BKP
Compile
a. Assuming that the source code was properly cloned and stored in AquaCrop/src/, $ cd AquaCrop/src/
$ make clean
$ make STATIC=1 LDFLAGS_EXE="-static-libgcc /usr/local/opt/gcc/lib/gcc/13/libquadmath.a" bin
(The AquaCrop executable should now show up in your src directory.)
b. Verify the libraries of the new aquacrop executable
$ otool -L aquacrop
(This should not show any dynamic libraries, other than the system library.)
Undo fix to get around dynamic libraries
This example is with version 13, update to your gfortran version number:
$ sudo mv /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib_BKP /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib
$ sudo mv /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib_BKP /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is an example of how to compile AquaCrop (or other Fortran code) on your Mac:
Install Fortran compiler
a. $ xcode-select --install
b. $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
On my Mac (institute managed, u123456 is my assumed institute login), this gave a permission problem, which I solved by:
$ cd /usr/local/share/zsh/
$ /usr/bin/sudo /usr/sbin/chown -R u123456:admin site-functions
c. $ brew install gcc
(Or, if you have an old version: $ brew upgrade)
This gave me a permission problem, which I solved by:
$ /usr/bin/sudo /usr/sbin/chown -R u123456:admin /usr/local/share/zsh
$ chmod u+w /usr/local/share/zsh
d. gfortran --version
(Check if you get a good answer to confirm that your installation was correct.)
Get around dynamic libraries (if you want to use your executable on another Mac)
This example is with version 13, update to your gfortran version number:
$ sudo mv /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib_BKP
$ sudo mv /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib_BKP
Compile
a. Assuming that the source code was properly cloned and stored in AquaCrop/src/,
$ cd AquaCrop/src/
$ make clean
$ make STATIC=1 LDFLAGS_EXE="-static-libgcc /usr/local/opt/gcc/lib/gcc/13/libquadmath.a" bin
(The AquaCrop executable should now show up in your src directory.)
b. Verify the libraries of the new aquacrop executable
$ otool -L aquacrop
(This should not show any dynamic libraries, other than the system library.)
Undo fix to get around dynamic libraries
This example is with version 13, update to your gfortran version number:
$ sudo mv /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib_BKP /usr/local/opt/gcc/lib/gcc/13/libquadmath.0.dylib
$ sudo mv /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib_BKP /usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib
Beta Was this translation helpful? Give feedback.
All reactions