pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Terry Phelps <tgphelps50@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Compile error while building postgresql 10.3
Date: Mon, 19 Mar 2018 15:29:06 -0400
Message-ID: <13506.1521487746@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMUfR_vJKnd6oCA28petJ5NFTVyt99xxAEz1PS1zKErhtMc-fw@mail.gmail.com>
References: <CAMUfR_vJKnd6oCA28petJ5NFTVyt99xxAEz1PS1zKErhtMc-fw@mail.gmail.com>

Terry Phelps <tgphelps50@gmail.com> writes:
> Just for fun, I am trying to build postgres from source on FreeBSD 11. Yes,
> I know I don't need to, and I have already installed the 10.3 server and
> client packages, and they run fine. I did a 'git clone' today, and have
> hours-old source code.

FWIW, development-code issues generally belong on -hackers, so forwarding
this there.

> So, I install the prereqs, and did a 'configure' and 'make', and expected
> it to 'just work'. However, I get this compile error:

> cc -I/usr/local/include -I../../src/port -DFRONTEND -I../../src/include
> -c -o pg_crc32c_sse42.o pg_crc32c_sse42.c
> pg_crc32c_sse42.c:37:18: error: always_inline function '_mm_crc32_u64'
> requires
>       target feature 'ssse3', but would be inlined into function
>       'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3'
>                 crc = (uint32) _mm_crc32_u64(crc, *((const uint64 *) p));
>                                ^
> pg_crc32c_sse42.c:44:9: error: always_inline function '_mm_crc32_u32'
> requires
>       target feature 'ssse3', but would be inlined into function
>       'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3'
>                 crc = _mm_crc32_u32(crc, *((const unsigned int *) p));
>                       ^
> pg_crc32c_sse42.c:63:9: error: always_inline function '_mm_crc32_u8'
> requires
>       target feature 'ssse3', but would be inlined into function
>       'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3'
>                 crc = _mm_crc32_u8(crc, *p);
>                       ^
> 3 errors generated.
> 
> I googled, and search the archives, and don't see anything applicable. My C
> compiler is:
> $ cc --version
> FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM
> 4.0.0)
> Target: x86_64-unknown-freebsd11.1
> Thread model: posix

Huh.  Apparently that compiler is stricter about the use of "ssse3" than
anything we've tested this code on before.

It's interesting that your "cc" line for pg_crc32c_sse42.c shows no sign
of any added options for SSE4.2 compiler intrinsics, which seems to be
what's needed here.  The configure script is supposed to detect whether
such options are needed, but it looks like it failed to do so correctly.
Can you look into config.log and see what happened corresponding to this
bit of configure.in?

# Check for Intel SSE 4.2 intrinsics to do CRC calculations.
#
# First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
# with the default compiler flags. If not, check if adding the -msse4.2
# flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
PGAC_SSE42_CRC32_INTRINSICS([])
if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
  PGAC_SSE42_CRC32_INTRINSICS([-msse4.2])
fi
AC_SUBST(CFLAGS_SSE42)

			regards, tom lane




view thread (19+ messages)  latest in thread

Message-ID: <13506.1521487746@sss.pgh.pa.us>
Permalink:  ../13506.1521487746@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13506.1521487746@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tgphelps50@gmail.com, hlinnaka@iki.fi, pgsql-admin@lists.postgresql.org
  Subject: Re: Compile error while building postgresql 10.3
  In-Reply-To: <13506.1521487746@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox