Re: postgreSQL-8.0.1 configure --enable-thread-safety with

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Vikram Kalsi <vikramkalsi(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: postgreSQL-8.0.1 configure --enable-thread-safety with
Date: 2005-03-09 04:28:20
Message-ID: 200503090428.j294SKr10366@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


The Intel compiler complains about global variables that are not marked
either static or extern. They are "remarks" so I think you are OK with
that.

The attached patch should remove the warnings but I am not applying it
because a non-static/extern global variable should be fine in C code.

The larger problem is that we are not picking up the proper thread flags
for the Intel C compiler. Any idea what they are? Please try compiling
in src/tools/thread manually to get the flags working and report back.
It isn't find the thread library functions like pthread_join.

---------------------------------------------------------------------------

Vikram Kalsi wrote:
> Hi,
>
> I am trying to build postgresql-8.0.1 with icc-8.1.028 on a Linux
> RHEL AS3 SMP Itanium2 machine and I get an error as follows when I run
> configure --enable-thread-safety as follows-
>
> ------------------------------------------------------------------------------------------------------------------------------------
> shell>export CC=icc
> shell>export CFLAGS="-static -fPIC"
> shell>export LDFLAGS="-L/opt/intel_cc_80/lib"
> shell>export CPPFLAGS="-I/opt/intel_cc_80/include"
>
> shell>configure --prefix=$MY_HOME/dbms/pgsql --enable-thread-safety
> --disable-shared --with-low-memory --with-pgport=5410
> ......
> ......
> ......
> configure:18836: icc -o conftest -static -fPIC -Wall
> -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
> -Wold-style-definition -Wendif-labels -fno-strict-aliasing
> -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -DIN_CONFIGURE
> -D_GNU_SOURCE -L/opt/intel_cc_80/lib conftest.c -lz -lreadline
> -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd >&5
>
> ./src/tools/thread/thread_test.c(75): remark #1418: external
> definition with no prior declaration
> char *temp_filename_1;
> ^
>
> ./src/tools/thread/thread_test.c(76): remark #1418: external
> definition with no prior declaration
> char *temp_filename_2;
> ^
>
> ./src/tools/thread/thread_test.c(78): remark #1418: external
> definition with no prior declaration
> pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
> ^
>
> ./src/tools/thread/thread_test.c(80): remark #1418: external
> definition with no prior declaration
> volatile int thread1_done = 0;
> ^
>
> ./src/tools/thread/thread_test.c(81): remark #1418: external
> definition with no prior declaration
> volatile int thread2_done = 0;
> ^
>
> ./src/tools/thread/thread_test.c(83): remark #1418: external
> definition with no prior declaration
> volatile int errno1_set = 0;
> ^
>
> ./src/tools/thread/thread_test.c(84): remark #1418: external
> definition with no prior declaration
> volatile int errno2_set = 0;
> ^
>
> ./src/tools/thread/thread_test.c(105): remark #1418: external
> definition with no prior declaration
> bool platform_is_threadsafe = true;
> ^
>
> /tmp/iccQ3B36U.o(.text+0x1d2): In function `main':
> : undefined reference to `pthread_mutex_lock'
> /tmp/iccQ3B36U.o(.text+0x202): In function `main':
> : undefined reference to `pthread_create'
> /tmp/iccQ3B36U.o(.text+0x232): In function `main':
> : undefined reference to `pthread_create'
> /tmp/iccQ3B36U.o(.text+0x2e2): In function `main':
> : undefined reference to `pthread_mutex_unlock'
> /tmp/iccQ3B36U.o(.text+0x302): In function `main':
> : undefined reference to `pthread_join'
> /tmp/iccQ3B36U.o(.text+0x322): In function `main':
> : undefined reference to `pthread_join'
> /tmp/iccQ3B36U.o(.text+0x602): In function `func_call_1':
> : undefined reference to `pthread_mutex_lock'
> /tmp/iccQ3B36U.o(.text+0x612): In function `func_call_1':
> : undefined reference to `pthread_mutex_unlock'
> /tmp/iccQ3B36U.o(.text+0x872): In function `func_call_2':
> : undefined reference to `pthread_mutex_lock'
> /tmp/iccQ3B36U.o(.text+0x882): In function `func_call_2':
> : undefined reference to `pthread_mutex_unlock'
> configure:18839: $? = 1
> configure: program exited with status 1
> configure: failed program was:
> #line 18830 "configure"
> #include "confdefs.h"
> #include "./src/tools/thread/thread_test.c"
> configure:18853: result: no
> configure:18863: error:
> *** Thread test program failed. Your platform is not thread-safe.
> *** Check the file 'config.log'for the exact reason.
> ***
> *** You can use the configure option --enable-thread-safety-force
> *** to force threads to be enabled. However, you must then run
> *** the program in src/tools/thread and add locking function calls
> *** to your applications to guarantee thread safety.
> ------------------------------------------------------------------------------------------------------------------------------------
> The complete log is online at http://www.cse.psu.edu/~kalsi/files2/config.log
>
> The same works when I use gcc(3.2.3) and configure also works with
> icc-8.1 if I dont use --enable-thread-safety!
>
> Can anybody see if I am doing it wrong? Any suggestions for resolving
> this error?
>
> Thanks,
> -Vikram
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 3.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-03-09 04:29:47 Re: postgreSQL-8.0.1 compilation with icc-8.1 on Itanium-2
Previous Message Bruce Momjian 2005-03-09 03:52:09 Re: Where to see the patch queue (was Re: [PATCHES] Patch