homebrew-postgresql icon indicating copy to clipboard operation
homebrew-postgresql copied to clipboard

While installing postgresql@11: configure: error: header file <perl.h> is required for Perl

Open rgynn opened this issue 7 years ago • 8 comments

==> ./configure --prefix=/usr/local/Cellar/postgresql@11/11.0 --enable-dtrace --enable-nls --with-bonjour --with-gssa
Last 15 lines from /Users/hajhatten/Library/Logs/Homebrew/postgresql@11/01.configure:
checking for library containing bind_textdomain_codeset... -lintl
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for msgfmt... /usr/local/opt/gettext/bin/msgfmt
checking for msgfmt flags... -c
checking for msgmerge... /usr/local/opt/gettext/bin/msgmerge
checking for xgettext... /usr/local/opt/gettext/bin/xgettext
checking for tclsh... /usr/local/opt/tcl-tk/bin/tclsh
checking for tclConfig.sh... /usr/local/Cellar/tcl-tk/8.6.8/lib/tclConfig.sh
checking tcl.h usability... yes
checking tcl.h presence... yes
checking for tcl.h... yes
checking for perl.h... no
configure: error: header file <perl.h> is required for Perl

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/petere/homebrew-postgresql/issues

These open issues may also help:
Fully qualified name petere/postgresql/postgresql@10 is needed to install correct formula https://github.com/petere/homebrew-postgresql/issues/40

OSX Mojave 10.14 (18A391) Homebrew 1.7.7 Homebrew/homebrew-core (git revision 5e88c5; last commit 2018-10-23) Homebrew/homebrew-cask (git revision 5c3b4; last commit 2018-10-23)

Earlier had 10.5 installed, but ran:

brew uninstall postgresql --force
brew tap petere/postgresql
brew install postgresql@11

rgynn avatar Oct 23 '18 08:10 rgynn

Same issue here, with [email protected].

simonmichael avatar Oct 25 '18 19:10 simonmichael

Possible duplicate of https://github.com/petere/homebrew-postgresql/issues/41, which has a workaround, if you don't need plpgsql support.

And a more thorough workaround if you do (brew edit [email protected], add depends_on "perl" and add perl to deps = ...).

simonmichael avatar Oct 25 '18 19:10 simonmichael

This simple workaround by @jsgillen1 worked nicely, without need for brew edit.

dcnorris avatar Dec 28 '18 15:12 dcnorris

This is what finally worked for me. Open the folder /Library/Developer/CommandLineTools/Packages/ and manually install macOS_SDK_headers_for_macOS_10.14.pkg. Postgres install worked fine after that.

austinmcconnell avatar Jan 04 '19 16:01 austinmcconnell

Hitting this now with 11.2_1 -> 11.3 in Ubuntu WSL

checking for perl.h... no configure: error: header file <perl.h> is required for Perl

Perl is installed, though:

/home/linuxbrew/.linuxbrew/Cellar/perl/5.28.1 (2,654 files, 71.3MB) * Poured from bottle on 2019-01-04 at 10:33:17

There's a perl.h inside /usr/lib/x86_64-linux-gnu/perl/5.26.1/CORE/perl.h

I tried to export LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/" but that didn't help.

black-snow avatar May 13 '19 08:05 black-snow

Still receiving this error in Catalina. Reinstalling CLTools doesn't work because /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists in Catalina so there seems to be no current workaround.

Update: the brew edit workaround does not work with postgresql @11 or @12. Fortunately, I was able to get postgresql 11.5 installed successfully from brew by downloading Xcode 11.2 Beta placing it in my /Applications folder, and running (as root) sudo xcode-select --switch /Applications/Xcode-beta.app/ After that, I could brew install postgresql without any Perl errors.

townge avatar Oct 22 '19 15:10 townge

This was fixed for me on Catalina just by installing XCode via the app store, phew!

ckcollab avatar Dec 31 '19 00:12 ckcollab

Still receiving this error in Catalina. Reinstalling CLTools doesn't work because /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists in Catalina so there seems to be no current workaround.

Update: the brew edit workaround does not work with postgresql @11 or @12. Fortunately, I was able to get postgresql 11.5 installed successfully from brew by downloading Xcode 11.2 Beta placing it in my /Applications folder, and running (as root) sudo xcode-select --switch /Applications/Xcode-beta.app/ After that, I could brew install postgresql without any Perl errors.

You are right, Catalina does not have the header file, but my system version is 10.15, aka, it doesn't have /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.15.pkg

After installing XCode from App Store, the error was still there, however, running sudo xcode-select --switch /Applications/Xcode.app/ helped.

Thanks a lot, now I can brew install postgresql smoothly!!

Carolyn95 avatar Jan 05 '20 07:01 Carolyn95