Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rgynn opened this issue Oct 23, 2018 · 8 comments

Comments

@rgynn
Copy link

rgynn commented Oct 23, 2018

==> ./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
@simonmichael
Copy link

simonmichael commented Oct 25, 2018

Same issue here, with postgresql@9.3.

@simonmichael
Copy link

simonmichael commented Oct 25, 2018

Possible duplicate of #41, which has a workaround, if you don't need plpgsql support.

And a more thorough workaround if you do (brew edit postgresql@X.Y, add depends_on "perl" and add perl to deps = ...).

@dcnorris
Copy link

dcnorris commented Dec 28, 2018

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

@austinmcconnell
Copy link

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.

@black-snow
Copy link

black-snow commented May 13, 2019

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.

@townge
Copy link

townge commented Oct 22, 2019

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.

@ckcollab
Copy link

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

@Carolyn95
Copy link

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants