From 98f172312bad64906735d245094e8bbe6bb940ff Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Wed, 5 Jan 2022 01:49:49 -0500 Subject: [PATCH] Set macOS LIBRARY_PATH for Homebrew Per the macOS ld(1) man page , > The default library search path is /usr/lib then /usr/local/lib. When `HOMEBREW_PREFIX=/usr/local`, this is where the `.dylib` files for X11 are symlinked by Homebrew. When `AC_PATH_XTRA` is called, it uses `/usr/bin/gcc` (Apple clang) and since the libraries are found in `/usr/local/lib`, it does not need to specify any `-L` paths. However when `libtool` is used to call Homebrew `gfortran`, it sets the flag `-syslibroot` which per the man page for ld(1): > The -syslibroot option will prepend a prefix to all search paths. and this means that it no longer looks under `/usr/local/lib` by default. To fix this, add the default path back by setting the `LIBRARY_PATH` environment variable. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13e5ba95de..13772ff3ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: brew install automake \ libpng \ libxt + echo "LIBRARY_PATH=$(brew --prefix)/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}" >> $GITHUB_ENV - name: Bootstrap run: | sh ./bootstrap