Re: [HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with

2005-03-11 Thread Bruce Momjian
Neil Conway wrote:
 Bruce Momjian wrote:
  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.
 
 What's the harm in applying it? Variables and functions not used outside 
 the compilation unit in which they are defined _should_ be marked 
 static; it's not required, but I think it's good style.

I didn't want to do it because I thought we would then have to do it in
a lot of places, but I see pg_ctl.c does it, so I applied the patch, and
fixed initdb.c to be 'static-clean' too.

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

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with

2005-03-11 Thread Bruce Momjian
BVikram Kalsi wrote:
 I was ignoring the warnings anyway.
 
 I didn't look into that much but after upgrading to RHEL AS4, I am
 able to compile successfully with --enable-thread-safety

OK, so there was some problem with AS3 and its use of the thread
library.  Glad it is working now.

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

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with

2005-03-08 Thread Bruce Momjian

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-
 
 
 shellexport CC=icc
 shellexport CFLAGS=-static -fPIC
 shellexport LDFLAGS=-L/opt/intel_cc_80/lib
 shellexport CPPFLAGS=-I/opt/intel_cc_80/include
 
 shellconfigure --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
 
 

Re: [HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with

2005-03-08 Thread Neil Conway
Bruce Momjian wrote:
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.
What's the harm in applying it? Variables and functions not used outside 
the compilation unit in which they are defined _should_ be marked 
static; it's not required, but I think it's good style.

-Neil
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with icc-8.1 on RHEL-AS3 Itanium-2 gives error

2005-03-08 Thread Vikram Kalsi
I was ignoring the warnings anyway.

I didn't look into that much but after upgrading to RHEL AS4, I am
able to compile successfully with --enable-thread-safety

Thanks,

On Tue, 8 Mar 2005 23:28:20 -0500 (EST), Bruce Momjian
pgman@candle.pha.pa.us wrote:
 
 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-
 
  
  shellexport CC=icc
  shellexport CFLAGS=-static -fPIC
  shellexport LDFLAGS=-L/opt/intel_cc_80/lib
  shellexport CPPFLAGS=-I/opt/intel_cc_80/include
 
  shellconfigure --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.
  

[HACKERS] postgreSQL-8.0.1 configure --enable-thread-safety with icc-8.1 on RHEL-AS3 Itanium-2 gives error

2005-03-03 Thread Vikram Kalsi
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-


shellexport CC=icc
shellexport CFLAGS=-static -fPIC
shellexport LDFLAGS=-L/opt/intel_cc_80/lib
shellexport CPPFLAGS=-I/opt/intel_cc_80/include

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