Thread: postgresql-9.5.3 compilation on Solaris SPARC

postgresql-9.5.3 compilation on Solaris SPARC

From
Venkata Balaji N
Date:
Hi,

"make" command is generating the following error while compiling postgresql-9.5.3 on Solaris SPARC.

I tried compiling 9.2 and 9.3, works fine. This is only happening on 9.5.

../../src/port/libpgport_srv.a ../../src/common/libpgcommon_srv.a -lnsl -lrt -lsocket -lm -o postgres

Undefined                       first referenced

symbol                             in file

atomic_cas_64                       port/atomics.o

atomic_cas_32                       port/atomics.o

ld: fatal: Symbol referencing errors. No output written to postgres

make[2]: *** [postgres] Error 1

make[2]: Leaving directory `/opt/postgresql-9.5.3/src/backend'

make[1]: *** [all-backend-recurse] Error 2

make[1]: Leaving directory `/opt/postgresql-9.5.3/src'

make: *** [all-src-recurse] Error 2


Any help would be appreciated. Do i need to give any particular CFLAGS ?


Below is the configure command -


./configure --prefix=/opt/postgres/9.5.3 CC=/opt/SUNWspro/bin/cc 'CFLAGS=-xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xc99=none -xCC' --enable-cassert --without-readline --enable-thread-safety LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9' 


I tried adding an option  CFLAGS_SSE42='-msse4.2'. No luck.

Operating System

-bash-3.00$ uname -a
SunOS sunfire2 5.10 Generic sun4u sparc SUNW,Sun-Fire-V210

configure command output. Please let me know if you need config.log file

-checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking which template to use... solaris
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking for /opt/SUNWspro/bin/cc option to accept ISO C89... none needed
checking whether the C compiler still works... yes
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -Xa -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for non-GNU ld... /usr/ucb/ld
checking if the linker (/usr/ucb/ld) is GNU ld... no
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... no
checking for ar... ar
checking for a BSD-compatible install... config/install-sh -c
checking for tar... /usr/bin/tar
checking whether ln -s works... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking for a thread-safe mkdir -p... /opt/sfw/bin/gmkdir -p
checking for bison... /usr/sfw/bin/bison
configure: using bison (GNU Bison) 1.875
checking for flex... configure: WARNING:
*** The installed version of Flex, /usr/sfw/bin/flex, is too old to use with PostgreSQL.
*** Flex version 2.5.31 or later is required, but this is /usr/sfw/bin/flex version 2.5.4.
no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files.  You can obtain Flex from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.8.4
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... none required
checking for library containing socket... -lsocket
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... none required
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... -lnsl
checking for library containing shmget... none required
checking for inflate in -lz... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking atomic.h usability... yes
checking atomic.h presence... yes
checking for atomic.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ieeefp.h usability... yes
checking ieeefp.h presence... yes
checking for ieeefp.h... yes
checking ifaddrs.h usability... no
checking ifaddrs.h presence... no
checking for ifaddrs.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking mbarrier.h usability... no
checking mbarrier.h presence... no
checking for mbarrier.h... no
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/sem.h usability... yes
checking sys/sem.h presence... yes
checking for sys/sem.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking sys/tas.h usability... no
checking sys/tas.h presence... no
checking for sys/tas.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... yes
checking ucred.h presence... yes
checking for ucred.h... yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking for net/if.h... yes
checking for sys/ucred.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking whether byte ordering is bigendian... yes
checking for inline... no
checking for quiet inline (no complaint if unreferenced)... no
checking for printf format archetype... printf
checking for flexible array members... no
checking for signed types... yes
checking for __func__... no
checking for __FUNCTION__... no
checking for _Static_assert... no
checking for __builtin_types_compatible_p... no
checking for __builtin_bswap32... no
checking for __builtin_constant_p... no
checking for __builtin_unreachable... no
checking for __VA_ARGS__... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... no
checking for tzname... yes
checking for union semun... no
checking for struct sockaddr_un... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct sockaddr_storage.ss_len... no
checking for struct sockaddr_storage.__ss_len... no
checking for struct sockaddr.sa_len... no
checking for struct addrinfo... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for locale_t... no
checking for struct cmsgcred... no
checking for struct option... yes
checking for z_streamp... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking for int timezone... yes
checking types of arguments for accept()... int, int, struct sockaddr *, int *
checking whether gettimeofday takes only one argument... no
checking for wcstombs_l declaration... no
checking for cbrt... yes
checking for dlopen... yes
checking for fdatasync... yes
checking for getifaddrs... no
checking for getpeerucred... yes
checking for getrlimit... yes
checking for mbstowcs_l... no
checking for memmove... yes
checking for poll... yes
checking for pstat... no
checking for pthread_is_threaded_np... no
checking for readlink... yes
checking for setproctitle... no
checking for setsid... yes
checking for shm_open... yes
checking for sigprocmask... yes
checking for symlink... yes
checking for sync_file_range... no
checking for towlower... yes
checking for utime... yes
checking for utimes... yes
checking for wcstombs... yes
checking for wcstombs_l... no
checking for fseeko... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether fdatasync is declared... yes
checking whether strlcat is declared... yes
checking whether strlcpy is declared... yes
checking whether F_FULLFSYNC is declared... no
checking for struct sockaddr_in6... yes
checking for PS_STRINGS... no
checking for snprintf... yes
checking for vsnprintf... yes
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking for isinf... no
checking for fpclass... yes
checking for crypt... yes
checking for fls... no
checking for getopt... yes
checking for getrusage... yes
checking for inet_aton... no
checking for mkdtemp... no
checking for random... yes
checking for rint... yes
checking for srandom... yes
checking for strerror... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for unsetenv... yes
checking for getpeereid... no
checking for getaddrinfo... yes
checking for getopt_long... yes
checking for sigsetjmp... yes
checking whether sys_siglist is declared... no
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... no
checking for strtoll... yes
checking for strtoull... yes
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with -mt... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
checking for the pthreads library -lpthreadGC2... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether strerror_r returns int... yes
checking test program... ok
checking whether long int is 64 bits... yes
checking whether snprintf supports the %z modifier... yes
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking whether to build with float4 passed by value... yes
checking whether to build with float8 passed by value... yes
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for sig_atomic_t... yes
checking for __int128... no
checking for builtin __sync char locking functions... no
checking for builtin __sync int32 locking functions... no
checking for builtin __sync int32 atomic operations... no
checking for builtin __sync int64 atomic operations... no
checking for builtin __atomic int32 atomic operations... no
checking for builtin __atomic int64 atomic operations... no
checking for __get_cpuid... no
checking for __cpuid... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... no
checking which CRC-32C implementation to use... slicing-by-8
checking for POSIX signal interface... yes
checking for onsgmls... onsgmls
checking for openjade... openjade
checking for DocBook V4.2... no
checking for DocBook stylesheets... /usr/share/sgml/docbook/dsssl-stylesheets
checking for dbtoepub... no
checking for xmllint... xmllint
checking for xsltproc... xsltproc
checking for osx... osx
checking thread safety of required library functions... yes
checking whether /opt/SUNWspro/bin/cc -Xa supports -Wl,--as-needed... no
configure: using compiler=cc: Sun C 5.8 2005/10/13
configure: using CFLAGS= -xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xc99=none -xCC -msse4.2
configure: using CPPFLAGS=
configure: using LDFLAGS=-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: src/include/pg_config.h is unchanged
config.status: creating src/include/pg_config_ext.h
config.status: src/include/pg_config_ext.h is unchanged
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: src/interfaces/ecpg/include/ecpg_config.h is unchanged
config.status: linking src/backend/port/tas/sunstudio_sparc.s to src/backend/port/tas.s
config.status: linking src/backend/port/dynloader/solaris.c to src/backend/port/dynloader.c
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/backend/port/unix_latch.c to src/backend/port/pg_latch.c
config.status: linking src/backend/port/dynloader/solaris.h to src/include/dynloader.h
config.status: linking src/include/port/solaris.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.solaris to src/Makefile.port

Regards,
Venkata B N

Fujitsu Australia

Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Asif Naeem
Date:
Hi Venkata,

I have't work on solaris sparc system since long but I would like to share my feedback on this, I hope it might be useful.

On Fri, May 20, 2016 at 10:14 AM, Venkata Balaji N <nag1010@gmail.com> wrote:
Hi,

"make" command is generating the following error while compiling postgresql-9.5.3 on Solaris SPARC.

While working with PG, gmake is more appropriate then make that have different implementation on different vendor OS.
 
I tried compiling 9.2 and 9.3, works fine. This is only happening on 9.5.

../../src/port/libpgport_srv.a ../../src/common/libpgcommon_srv.a -lnsl -lrt -lsocket -lm -o postgres

Undefined                       first referenced

symbol                             in file

atomic_cas_64                       port/atomics.o

atomic_cas_32                       port/atomics.o

ld: fatal: Symbol referencing errors. No output written to postgres

make[2]: *** [postgres] Error 1

make[2]: Leaving directory `/opt/postgresql-9.5.3/src/backend'

make[1]: *** [all-backend-recurse] Error 2

make[1]: Leaving directory `/opt/postgresql-9.5.3/src'

make: *** [all-src-recurse] Error 2


Humm .. Interesting. atomic_cas_64 seems suppose to part of standard c library. There might be something wrong with the configuration. Probably check "nm libc.so.1 | grep atomic_cas_64".

Any help would be appreciated. Do i need to give any particular CFLAGS ?


Below is the configure command -


./configure --prefix=/opt/postgres/9.5.3 CC=/opt/SUNWspro/bin/cc 'CFLAGS=-xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xc99=none -xCC' --enable-cassert --without-readline --enable-thread-safety LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9'


AFAIR I deprived use of -xarch=v9 and used -m64 instead. I wonder why are you using LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9', when you provide -xarch=v9 compiler should automatically pick the correct libraries and headers I think. There seems lot of cflags used, are you using them because of any recommendation or any issue faced ?.

A few pointers: 
1. What is version of SunStudio ?
2. Try 

cat atomic_cas_64-test.c

#include <sys/atomic.h>
int main()
{
        atomic_cas_64(NULL,NULL,NULL);
}
 
/opt/SUNWspro/bin/cc -m64 atomic_cas_64-test.c -o atomic_cas_64-test

try ldd to check which library it is resolving atomic_cas_64 symbol i.e.

ldd atomic_cas_64-test

Regards,
Muhammad Asif Naeem


I tried adding an option  CFLAGS_SSE42='-msse4.2'. No luck.

Operating System

-bash-3.00$ uname -a
SunOS sunfire2 5.10 Generic sun4u sparc SUNW,Sun-Fire-V210

configure command output. Please let me know if you need config.log file

-checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking which template to use... solaris
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking for /opt/SUNWspro/bin/cc option to accept ISO C89... none needed
checking whether the C compiler still works... yes
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -Xa -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... no
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for non-GNU ld... /usr/ucb/ld
checking if the linker (/usr/ucb/ld) is GNU ld... no
checking for ranlib... ranlib
checking for strip... strip
checking whether it is possible to strip libraries... no
checking for ar... ar
checking for a BSD-compatible install... config/install-sh -c
checking for tar... /usr/bin/tar
checking whether ln -s works... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking for a thread-safe mkdir -p... /opt/sfw/bin/gmkdir -p
checking for bison... /usr/sfw/bin/bison
configure: using bison (GNU Bison) 1.875
checking for flex... configure: WARNING:
*** The installed version of Flex, /usr/sfw/bin/flex, is too old to use with PostgreSQL.
*** Flex version 2.5.31 or later is required, but this is /usr/sfw/bin/flex version 2.5.4.
no
configure: WARNING:
*** Without Flex you will not be able to build PostgreSQL from Git nor
*** change any of the scanner definition files.  You can obtain Flex from
*** a GNU mirror site.  (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)
checking for perl... /usr/bin/perl
configure: using perl 5.8.4
checking for main in -lm... yes
checking for library containing setproctitle... no
checking for library containing dlopen... none required
checking for library containing socket... -lsocket
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... none required
checking for library containing shm_open... -lrt
checking for library containing shm_unlink... none required
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... -lnsl
checking for library containing shmget... none required
checking for inflate in -lz... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking atomic.h usability... yes
checking atomic.h presence... yes
checking for atomic.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ieeefp.h usability... yes
checking ieeefp.h presence... yes
checking for ieeefp.h... yes
checking ifaddrs.h usability... no
checking ifaddrs.h presence... no
checking for ifaddrs.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking mbarrier.h usability... no
checking mbarrier.h presence... no
checking for mbarrier.h... no
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/sem.h usability... yes
checking sys/sem.h presence... yes
checking for sys/sem.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking sys/tas.h usability... no
checking sys/tas.h presence... no
checking for sys/tas.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... yes
checking ucred.h presence... yes
checking for ucred.h... yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking for net/if.h... yes
checking for sys/ucred.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking whether byte ordering is bigendian... yes
checking for inline... no
checking for quiet inline (no complaint if unreferenced)... no
checking for printf format archetype... printf
checking for flexible array members... no
checking for signed types... yes
checking for __func__... no
checking for __FUNCTION__... no
checking for _Static_assert... no
checking for __builtin_types_compatible_p... no
checking for __builtin_bswap32... no
checking for __builtin_constant_p... no
checking for __builtin_unreachable... no
checking for __VA_ARGS__... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... no
checking for tzname... yes
checking for union semun... no
checking for struct sockaddr_un... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct sockaddr_storage.ss_len... no
checking for struct sockaddr_storage.__ss_len... no
checking for struct sockaddr.sa_len... no
checking for struct addrinfo... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for locale_t... no
checking for struct cmsgcred... no
checking for struct option... yes
checking for z_streamp... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking for int timezone... yes
checking types of arguments for accept()... int, int, struct sockaddr *, int *
checking whether gettimeofday takes only one argument... no
checking for wcstombs_l declaration... no
checking for cbrt... yes
checking for dlopen... yes
checking for fdatasync... yes
checking for getifaddrs... no
checking for getpeerucred... yes
checking for getrlimit... yes
checking for mbstowcs_l... no
checking for memmove... yes
checking for poll... yes
checking for pstat... no
checking for pthread_is_threaded_np... no
checking for readlink... yes
checking for setproctitle... no
checking for setsid... yes
checking for shm_open... yes
checking for sigprocmask... yes
checking for symlink... yes
checking for sync_file_range... no
checking for towlower... yes
checking for utime... yes
checking for utimes... yes
checking for wcstombs... yes
checking for wcstombs_l... no
checking for fseeko... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether fdatasync is declared... yes
checking whether strlcat is declared... yes
checking whether strlcpy is declared... yes
checking whether F_FULLFSYNC is declared... no
checking for struct sockaddr_in6... yes
checking for PS_STRINGS... no
checking for snprintf... yes
checking for vsnprintf... yes
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking for isinf... no
checking for fpclass... yes
checking for crypt... yes
checking for fls... no
checking for getopt... yes
checking for getrusage... yes
checking for inet_aton... no
checking for mkdtemp... no
checking for random... yes
checking for rint... yes
checking for srandom... yes
checking for strerror... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for unsetenv... yes
checking for getpeereid... no
checking for getaddrinfo... yes
checking for getopt_long... yes
checking for sigsetjmp... yes
checking whether sys_siglist is declared... no
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... no
checking for strtoll... yes
checking for strtoull... yes
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with -mt... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... no
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... no
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for pthread-config... no
checking for the pthreads library -lpthreadGC2... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether strerror_r returns int... yes
checking test program... ok
checking whether long int is 64 bits... yes
checking whether snprintf supports the %z modifier... yes
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking whether to build with float4 passed by value... yes
checking whether to build with float8 passed by value... yes
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for sig_atomic_t... yes
checking for __int128... no
checking for builtin __sync char locking functions... no
checking for builtin __sync int32 locking functions... no
checking for builtin __sync int32 atomic operations... no
checking for builtin __sync int64 atomic operations... no
checking for builtin __atomic int32 atomic operations... no
checking for builtin __atomic int64 atomic operations... no
checking for __get_cpuid... no
checking for __cpuid... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... no
checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... no
checking which CRC-32C implementation to use... slicing-by-8
checking for POSIX signal interface... yes
checking for onsgmls... onsgmls
checking for openjade... openjade
checking for DocBook V4.2... no
checking for DocBook stylesheets... /usr/share/sgml/docbook/dsssl-stylesheets
checking for dbtoepub... no
checking for xmllint... xmllint
checking for xsltproc... xsltproc
checking for osx... osx
checking thread safety of required library functions... yes
checking whether /opt/SUNWspro/bin/cc -Xa supports -Wl,--as-needed... no
configure: using compiler=cc: Sun C 5.8 2005/10/13
configure: using CFLAGS= -xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xc99=none -xCC -msse4.2
configure: using CPPFLAGS=
configure: using LDFLAGS=-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: src/include/pg_config.h is unchanged
config.status: creating src/include/pg_config_ext.h
config.status: src/include/pg_config_ext.h is unchanged
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: src/interfaces/ecpg/include/ecpg_config.h is unchanged
config.status: linking src/backend/port/tas/sunstudio_sparc.s to src/backend/port/tas.s
config.status: linking src/backend/port/dynloader/solaris.c to src/backend/port/dynloader.c
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/backend/port/unix_latch.c to src/backend/port/pg_latch.c
config.status: linking src/backend/port/dynloader/solaris.h to src/include/dynloader.h
config.status: linking src/include/port/solaris.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.solaris to src/Makefile.port

Regards,
Venkata B N

Fujitsu Australia

Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Jan de Visser
Date:
On Friday, May 20, 2016 3:14:54 PM EDT Venkata Balaji N wrote:
> Hi,
>
> "make" command is generating the following error while compiling
> postgresql-9.5.3 on Solaris SPARC.
>
> I tried compiling 9.2 and 9.3, works fine. This is only happening on 9.5.

... snip ...

>
> Regards,
> Venkata B N
>
> Fujitsu Australia

I would suggest reporting this on pgsql-hackers. I know some work was done on
the atomics over the last little while.


Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Michael Paquier
Date:
On Fri, May 20, 2016 at 10:38 AM, Jan de Visser <jan@de-visser.net> wrote:
> I would suggest reporting this on pgsql-hackers. I know some work was done on
> the atomics over the last little while.

If that's an issue (no sparc environment here), we're looking at
b64d92f1 here that was new stuff in 9.5.
--
Michael


Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Tom Lane
Date:
Venkata Balaji N <nag1010@gmail.com> writes:
> "make" command is generating the following error while compiling
> postgresql-9.5.3 on Solaris SPARC.

> Undefined                       first referenced
> symbol                             in file
> atomic_cas_64                       port/atomics.o
> atomic_cas_32                       port/atomics.o

Hmm.  Do you get any warnings about references to those functions earlier
in the build?

src/include/port/atomics/generic-sunpro.h cites these references
as authority for believing that those functions exist in Solaris:

   http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
   http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html

I see that the first of those mentions it's for SunOS 5.11 whereas your
machine says it's 5.10 ... is it possible the functions were new in 5.11?

            regards, tom lane


Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Michael Paquier
Date:
On Fri, May 20, 2016 at 11:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> src/include/port/atomics/generic-sunpro.h cites these references
> as authority for believing that those functions exist in Solaris:
>
>    http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
>    http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
>
> I see that the first of those mentions it's for SunOS 5.11 whereas your
> machine says it's 5.10 ... is it possible the functions were new in 5.11?

Those two are listed in SunOS 5.10 man pages:
http://www.unix.com/man-page/sunos/3c/atomic_cas/
--
Michael


Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Venkata Balaji N
Date:

On Sat, May 21, 2016 at 1:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Venkata Balaji N <nag1010@gmail.com> writes:
> "make" command is generating the following error while compiling
> postgresql-9.5.3 on Solaris SPARC.

> Undefined                       first referenced
> symbol                             in file
> atomic_cas_64                       port/atomics.o
> atomic_cas_32                       port/atomics.o

Hmm.  Do you get any warnings about references to those functions earlier
in the build?

I do not see any such similar warnings earlier in the build. 

src/include/port/atomics/generic-sunpro.h cites these references
as authority for believing that those functions exist in Solaris: 

Yes, i could see the references mentioned in the above file.
 

   http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
   http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html

I see that the first of those mentions it's for SunOS 5.11 whereas your
machine says it's 5.10 ... is it possible the functions were new in 5.11?

I am not 100% sure. By the error, what i understand is that for some reason PostgreSQL version 9.5.x is expecting the SunOS version to be more recent than 5.10. 

We would need to compile PostgreSQL-9.5.3 to upgrade our customer's production environments. We did not have problems compiling earlier versions of PostgreSQL.

Regards,
Venkata B N

Fujitsu Australia

Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Tom Lane
Date:
Venkata Balaji N <nag1010@gmail.com> writes:
> On Sat, May 21, 2016 at 1:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
>> http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
>>
>> I see that the first of those mentions it's for SunOS 5.11 whereas your
>> machine says it's 5.10 ... is it possible the functions were new in 5.11?

> I am not 100% sure. By the error, what i understand is that for some reason
> PostgreSQL version 9.5.x is expecting the SunOS version to be more recent
> than 5.10.

Well, it's not --- we have a buildfarm animal that's running 5.10, and
it seems perfectly happy:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2016-05-21%2014%3A00%3A47

At this point I suspect that Asif Naeem was correct upthread in
questioning your compile options --- particularly the -L switches.
castoroides seems to just be using this:

'config_env' => {
      'CFLAGS' => '-m64 -xarch=native -xdepend -xO4 -xprefetch=auto,explicit',
      'CC' => 'cc',
      'LDFLAGS' => ''
},

            regards, tom lane


Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Venkata Balaji N
Date:

On Sun, May 22, 2016 at 1:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Venkata Balaji N <nag1010@gmail.com> writes:
> On Sat, May 21, 2016 at 1:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
>> http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
>>
>> I see that the first of those mentions it's for SunOS 5.11 whereas your
>> machine says it's 5.10 ... is it possible the functions were new in 5.11?

> I am not 100% sure. By the error, what i understand is that for some reason
> PostgreSQL version 9.5.x is expecting the SunOS version to be more recent
> than 5.10.

Well, it's not --- we have a buildfarm animal that's running 5.10, and
it seems perfectly happy:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2016-05-21%2014%3A00%3A47

At this point I suspect that Asif Naeem was correct upthread in
questioning your compile options --- particularly the -L switches.
castoroides seems to just be using this:

'config_env' => {
      'CFLAGS' => '-m64 -xarch=native -xdepend -xO4 -xprefetch=auto,explicit',
      'CC' => 'cc',
      'LDFLAGS' => ''
},

Thanks. Then, as i suspected, the problem must be around using appropriate CFLAGS, which i am not sure at what to use. One thing i can say at this point is that, if i just add "-m64" option in CFLAGS, i get an error illegal option.
I will re-test the compilation and get back with the inputs.

Regards,
Venkata B N

Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Venkata Balaji N
Date:
Hi Asif,

Sorry, i should have responded first. Thanks for inputs and my replies are inline -


Any help would be appreciated. Do i need to give any particular CFLAGS ?


Below is the configure command -


./configure --prefix=/opt/postgres/9.5.3 CC=/opt/SUNWspro/bin/cc 'CFLAGS=-xO3 -xarch=v9 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff -xc99=none -xCC' --enable-cassert --without-readline --enable-thread-safety LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9'


AFAIR I deprived use of -xarch=v9 and used -m64 instead. I wonder why are you using LDFLAGS='-L/usr/lib/sparcv9 -L/usr/ucblib/sparcv9', when you provide -xarch=v9 compiler should automatically pick the correct libraries and headers I think. There seems lot of cflags used, are you using them because of any recommendation or any issue faced ?. 

I just gave LDFLAGS in-case compiler cannot pickup the libraries and the locations i gave in LDFLAGS is for 64 Bit libraries. "-m64" in CFLAGS is generating an error and CC="gcc -m64" is running successfully. So, no issues there.

Regards,
Venkata B N

Fujitsu Australia

Re: postgresql-9.5.3 compilation on Solaris SPARC

From
Venkata Balaji N
Date:

On Sun, May 22, 2016 at 6:38 PM, Venkata Balaji N <nag1010@gmail.com> wrote:

On Sun, May 22, 2016 at 1:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Venkata Balaji N <nag1010@gmail.com> writes:
> On Sat, May 21, 2016 at 1:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
>> http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
>>
>> I see that the first of those mentions it's for SunOS 5.11 whereas your
>> machine says it's 5.10 ... is it possible the functions were new in 5.11?

> I am not 100% sure. By the error, what i understand is that for some reason
> PostgreSQL version 9.5.x is expecting the SunOS version to be more recent
> than 5.10.

Well, it's not --- we have a buildfarm animal that's running 5.10, and
it seems perfectly happy:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=castoroides&dt=2016-05-21%2014%3A00%3A47

At this point I suspect that Asif Naeem was correct upthread in
questioning your compile options --- particularly the -L switches.
castoroides seems to just be using this:

'config_env' => {
      'CFLAGS' => '-m64 -xarch=native -xdepend -xO4 -xprefetch=auto,explicit',
      'CC' => 'cc',
      'LDFLAGS' => ''
},

Thanks. Then, as i suspected, the problem must be around using appropriate CFLAGS, which i am not sure at what to use. One thing i can say at this point is that, if i just add "-m64" option in CFLAGS, i get an error illegal option.
I will re-test the compilation and get back with the inputs.

All good now. I am able to get the PostgreSQL-9.5.3 64-Bit installation done by removing the CFLAGS. Below is the configure command which i used -

./configure --prefix=/opt/postgres/9.5.3 CC="gcc -m64" --enable-cassert --without-readline --enable-thread-safety

Thanks all for your inputs and sorry for the confusion.

Regards,
Venkata B N

Fujitsu Australia