Re: Can't compile postgresql 11 on FreeBSD 11.1

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Can't compile postgresql 11 on FreeBSD 11.1
Date: 2018-07-23 06:35:37
Message-ID: d8683db9-ae4b-baed-e88a-dadcfee93a54@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 23/07/2018 09:22, Achilleas Mantzios wrote:
> On 17/07/2018 23:25, Tom Lane wrote:
>> Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>>> On 07/17/2018 12:34 PM, Márcio Antônio Sepp wrote:
>>>> I'm trying to compile PostgreSQL 11beta2 but this errors occur:
>>>> checking readline.h usability... no
>>> Looks like you need whatever is the FreeBSD equivalent of readline-dev(el).
>> AFAICT FreeBSD doesn't do things that way.  On a nearby machine, I see
>>
>> $ pkg which /usr/local/include/readline/readline.h
>> /usr/local/include/readline/readline.h was installed by package readline-6.3.8
>>
>> What's more likely the problem is that FreeBSD insists on installing
>> packages under /usr/local, but it does *not* set that up to be part of
>> gcc's default search paths.  (Security 1, usability 0.)  You need these
>> configure flags to do much of anything on that platform:
>>
>>    --with-includes=/usr/local/include --with-libs=/usr/local/lib
> For ages I have been manually compiling PostgreSQL under FreeBSD with only :
> ./configure --with-ldap
>
> But in my case I tend to fall back to gcc instead of the native clang/llvm . That might be his issue.
It seems to be the case. With GCC installed, by default I get no problems :
root(at)smadev:/usr/local/src/postgresql-11beta2# uname -a
FreeBSD smadev.internal.net 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017 root(at)amd64-builder(dot)daemonology(dot)net:/usr/obj/usr/src/sys/GENERIC amd64
root(at)smadev:/usr/local/src/postgresql-11beta2#
root(at)smadev:/usr/local/src/postgresql-11beta2# cd /usr/local/src/postgresql-11beta2
root(at)smadev:/usr/local/src/postgresql-11beta2# ./configure
.....
config.status: linking src/makefiles/Makefile.freebsd to src/Makefile.port
root(at)smadev:/usr/local/src/postgresql-11beta2# echo $?
0

By looking into config.log :

configure:3885: checking for gcc
configure:3901: found /usr/local/bin/gcc
configure:3912: result: gcc
configure:3943: checking for C compiler version
configure:3952: gcc --version >&5
gcc (FreeBSD Ports Collection) 6.4.0

Now, if I configure for clang I get the error :
root(at)smadev:/usr/local/src/postgresql-11beta2# setenv CC cc
root(at)smadev:/usr/local/src/postgresql-11beta2# ./configure
......
checking for readline/readline.h... no
configure: error: readline header not found
If you have libedit already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable libedit support.
root(at)smadev:/usr/local/src/postgresql-11beta2#

As suggested, when using clang, the way to overcome is via :
./configure --with-includes=/usr/local/include --with-libs=/usr/local/lib

>
>>
>>             regards, tom lane
>>
>

--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2018-07-23 07:23:45 Improving pg_dump performance
Previous Message Achilleas Mantzios 2018-07-23 06:22:33 Re: Can't compile postgresql 11 on FreeBSD 11.1