Re: [HACKERS] Source Code Help Needed

2005-06-03 Thread Vikram Kalsi
Tom, Thanks a ton again, and, here's another problem that has me really puzzled-I'm starting with a fresh install of pgsql-8.0.1, and make 3 changes-1.) src/include/nodes/relation.h, Add a new Variable, hutz_idx_benefit to IndexOptInfo
typedef struct IndexOptInfo{../* Per IndexScan benefit, More than 1 indexscan maybe used for 1 tablescan ex. w/ OR */Costhutz_idx_benefit;..} IndexOptInfo;
2.) src/backend/optimizer/path/costsize.c, cost_index(), assign value to index-hutz_idx_benefitrun_cost += indexTotalCost - indexStartupCost;index-hutz_idx_benefit = run_cost; 
elog(NOTICE,cost_index():index-indexoid=%u
index-hutz_idx_benefit=%.2f, index-indexoid,
index-hutz_idx_benefit);3.)
src/backend/optimizer/path/orindxpath.c, best_or_subclause_indexes(),
Read the value(s) of index-indexoid and index-hutz_idx_benefit/* Gather info for each OR subclause */foreach(slist, subclauses){...infos = lappend(infos, best_indexinfo);...}
/* DEBUG */ListCell *l;
int count=0;foreach(l, infos){
IndexOptInfo *index = (IndexOptInfo *) lfirst(l);elog(NOTICE,best_or_subclause_indexes():infos
c=%i: indexoid=%u hutz_idx_benefit=%.2f, count, index-indexoid,
index-hutz_idx_benefit);count++;}...

pathnode-indexinfo = infos; /* indexinfo' is a list of IndexOptInfo nodes, one per scan to be performed */

So, basically I have added a new variable alongside indexoid which
is the run_cost of one of the index scans if there are multiple index
scans such as in the case of OR subclauses for 1 table.
Now, I do a complete build and run two queries with OR subclauses as follows-

tpcd=# select s_suppkey from supplier where (s_suppkey125 and
s_suppkey128) or (s_suppkey175 and s_suppkey185) or
(s_suppkey200 and s_suppkey215);
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.02
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.06
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.09
NOTICE: best_or_subclause_indexes():infos c=0: indexoid=186970 hutz_idx_benefit=2.09
NOTICE: best_or_subclause_indexes():infos c=1: indexoid=186970 hutz_idx_benefit=2.09
NOTICE: best_or_subclause_indexes():infos c=2: indexoid=186970 hutz_idx_benefit=2.09
On the second occasion, I change the order of the OR subclauses...

tpcd=# select s_suppkey from supplier where (s_suppkey200 and
s_suppkey215) or (s_suppkey175 and s_suppkey185) or
(s_suppkey125 and s_suppkey128);
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.09
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.06
NOTICE: cost_index():index-indexoid=186970 index-hutz_idx_benefit=2.02
NOTICE: best_or_subclause_indexes():infos c=0: indexoid=186970 hutz_idx_benefit=2.02
NOTICE: best_or_subclause_indexes():infos c=1: indexoid=186970 hutz_idx_benefit=2.02
NOTICE: best_or_subclause_indexes():infos c=2: indexoid=186970 hutz_idx_benefit=2.02

>From the output, it can be seen that when I try to read the value(s),
the last value is stored in all the positions of the List infos which
is later assigned to (IndexPath) pathnode-indexinfo which is a
List of IndexOptInfo nodes, one per scan to be performed. Actually,
it seems all the pointers in the List indexinfo or infos are
pointing to the same object.

So, 
Ques 1) Is my assumption correct that IndexPath-indexinfo should
contain all distinct IndexOptInfo structs with one for each of the
scans to be performed? If not, then why do we have multiple pointers to
the same object?

(Ques 2) How can this be fixed? Is this a bug or something else?

(Ques 3) Is this a problem in other areas as well, for example the following query doesn't give the expected values as well-
select s_suppkey, c_custkey from supplier, customer where
s_suppkey125 and s_suppkey128 and c_custkey125 and
c_custkey135 and c_custkey=s_suppkey;

I appreciate all the help of this group,
Thanks,

On 5/25/05, Tom Lane [EMAIL PROTECTED] wrote: Vikram Kalsi [EMAIL PROTECTED] writes:  So, I suppose that during the query planning and optimization stage,
  the value of the original variables in the plan are somehow copied to  the plan which is finally returned inside pg_plan_query().  Look in createplan.c --- there are a couple places in there you need to
 fix. 
regards, tom lane 


Re: [HACKERS] Google's Summer of Code ...

2005-06-02 Thread Vikram Kalsi
I am a MSEE student at Penn State (University Park), for the past few
months I have been working on modifying parts of PostgreSQL for my
research work. I doubt if my current work would serve any purpose for
pgsql since it is experimental and research oriented, but all the
same, I have gained familiarity with parts of pgsql. I'm interested in
Google's Summer of Code, but I would definitely need help, starting
with selection of an idea to work on. So, if anybody from PostgreSQL
would like to support this, then please get in touch with me as early
as possible.

By the way, I didn't see PostgreSQL in the list of Participating
Organizations on http://code.google.com/summerofcode.html?

Thanks and Regards,
-Vikram Kalsi
MSEE PennState
vzk101 at psu dot edu
www.personal.psu.edu/vzk101


On 5/25/05, Tom Lane [EMAIL PROTECTED] wrote:
 Vikram Kalsi [EMAIL PROTECTED] writes:
  So, I suppose that during the query planning and optimization stage,
  the value of the original variables in the plan are somehow copied to
  the plan which is finally returned inside pg_plan_query().
 
 Look in createplan.c --- there are a couple places in there you need to
 fix.
 
regards, tom lane


---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[HACKERS] Source Code Help Needed

2005-05-25 Thread Vikram Kalsi
Hello,

I've been using Postgresql-8.0.1 (Release date: 2005-01-31) for my
research work and I guess I finally need some help with it...

I'm not trying to modify the existing functionality, but I want to add
few things. In particular, I'm calculating two new Cost values and I
need to use them while the query is executing. Please See code
snippets below-

1.) New Variables ADDED to src/include/nodes/plannodes.h
typedef struct Plan
{
Costhutz_tbl_benefit;   /* Benefit for TableAccess */
Costhutz_idx_benefit;   /* Benefit for IndexScan */
}


2.)  New Variables ADDED to src/include/nodes/relation.h
typedef struct Plan
{
Costhutz_tbl_benefit;   /* Benefit for TableAccess */
Costhutz_idx_benefit;   /* Benefit for IndexScan */
}


3.) ADDITIONS to costsize.c

void cost_seqscan(Path *path, Query *root,
 RelOptInfo *baserel)
{
path-hutz_tbl_benefit = x;
path-hutz_idx_benefit = x;  
}


void cost_index(Path *path, Query *root, RelOptInfo *baserel,
   IndexOptInfo *index, List *indexQuals, bool is_injoin)
{
path-hutz_tbl_benefit = x;
path-hutz_idx_benefit = x;  
}


However, after these modifications the server process crashes on
running a Join query like
select s_suppkey,c_custkey from supplier,customer where s_suppkey125
and s_suppkey128 and c_custkey100 and c_custkey103 and
c_custkey=s_suppkey

But, this query runs fine select s_suppkey from supplier where
s_suppkey125 and s_suppkey128

I'm tracing the point at which the process crashes and at this point
it seems to inside
src/backend/optimizer/path/joinrels.cmake_rels_by_joins()

So, my question is, after adding the two new variables what other
modifications do I need to make for code to work, And later on, what
changes are reqd so that I can access these variables while executing
the Query Plan in lets say ExecutePlan() and its sub-functions like
ExecProcNode()...

Thanks to everybody on this group,
-Vikram Kalsi
MSEE PennStateUniv

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] Source Code Help Needed

2005-05-25 Thread Vikram Kalsi
Thanks Tom, that solved it...I added the new variables one at a time
and did do a make clean on the first occasion but I must have
forgotten to do it the second time...

I have another question-
The new variables that I've added to Plan and Path i.e.
hutz_tbl_benefit and hutz_idx_benefit are being assigned values inside
cost_seqscan() and cost_index() in costsize.c and this is done
alongside startup_cost and total_cost.

But, when I read the value of hutz_tbl_benefit and hutz_idx_benefit
inside pg_plan_query() or later at the execution stage inside
ExecProcNode(), the value is absent, but startup_cost and total_cost
retain their values.

So, I suppose that during the query planning and optimization stage,
the value of the original variables in the plan are somehow copied to
the plan which is finally returned inside pg_plan_query().

Could somebody direct me to the appropriate code/function(s) which
does this copying so that I can add hutz_tbl_benefit and
hutz_idx_benefit to that as well.

Thanks in anticipation,
Regards,





On 5/25/05, Tom Lane [EMAIL PROTECTED] wrote:
 Vikram Kalsi [EMAIL PROTECTED] writes:
  1.) New Variables ADDED to src/include/nodes/plannodes.h
  2.)  New Variables ADDED to src/include/nodes/relation.h
  ...
  However, after these modifications the server process crashes on
  running a Join query like
  select s_suppkey,c_custkey from supplier,customer where s_suppkey125
  and s_suppkey128 and c_custkey100 and c_custkey103 and
  c_custkey=s_suppkey
 
 Did you do a full recompile (make clean and rebuild) after modifying
 these widely-known structures?
 
 Unless you configured with --enable-depend, you can't expect that plain
 make will recompile everything that needs recompiled.
 
regards, tom lane


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

Re: [HACKERS] postgreSQL-8.0.1 compilation with icc-8.1 on Itanium-2 gives error: asm statements not supported

2005-03-05 Thread Vikram Kalsi
Just an update, the __INTEL_COMPILER is true on Itanium if icc is
being used. So, the following worked for me-

---BEGIN OLD
s_lock.h-
#if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
#define HAS_TEST_AND_SET
typedef unsigned int slock_t;
#define TAS(lock) tas(lock)

static __inline__ int
tas(volatile slock_t *lock)
{
   long intret;

   __asm__ __volatile__(
  xchg4   %0=%1,%2\n
:   =r(ret), +m(*lock)
:   r(1)
:   memory);
   return (int) ret;
}
#endif   /* __ia64__ || __ia64 */
-END OLD
s_lock.h-

---BEGIN NEW
s_lock.h-
#if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
/* Intel Itanium */
#define HAS_TEST_AND_SET

typedef unsigned int slock_t;

#define TAS(lock) tas(lock)

#if defined(__INTEL_COMPILER)

static __inline__ int
tas(volatile slock_t *lock)
{
int ret;

ret = _InterlockedExchange(lock,1);

return ret;
}

#else/* __INTEL_COMPILER */

static __inline__ int
tas(volatile slock_t *lock)
{
long intret;

__asm__ __volatile__(
   xchg4   %0=%1,%2\n
:   =r(ret), +m(*lock)
:   r(1)
:   memory);
return (int) ret;
}

#endif   /* __INTEL_COMPILER */

#endif   /* __ia64__ || __ia64 */
-END NEW
s_lock.h-

Thanks and Regards,


On Fri, 4 Mar 2005 00:57:15 -0500, Vikram Kalsi [EMAIL PROTECTED] wrote:
 Tom, Peter,
 
 I have been able to compile and sucessfully run pgSQL after replacing
 the asm statement in postgresql-8.0.1/src/include/storage/s_lock.h
 with an equivalent intrinsic for the Itanium platform-
 
 -BEGIN OLD 
 s_lock.h
 #if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
 #define HAS_TEST_AND_SET
 typedef unsigned int slock_t;
 #define TAS(lock) tas(lock)
 
 static __inline__ int
 tas(volatile slock_t *lock)
 {
 long intret;
 
 __asm__ __volatile__(
xchg4   %0=%1,%2\n
 :   =r(ret), +m(*lock)
 :   r(1)
 :   memory);
 return (int) ret;
 }
 #endif   /* __ia64__ || __ia64 */
 ---END OLD 
 s_lock.h
 
 -BEGIN NEW 
 s_lock.h--
 #if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
 #define HAS_TEST_AND_SET
 typedef unsigned int slock_t;
 #define TAS(lock) tas(lock)
 
 static __inline__ int
 tas(volatile slock_t *lock)
 {
 int ret;
 
 ret = _InterlockedExchange(lock,1);
 
 return ret;
 }
 #endif   /* __ia64__ || __ia64 */
 ---END NEW 
 s_lock.h--
 
 The binary appears to be stable and the tpc-H benchmark executed
 successfully against it as well. I also ran the regression test but
 the following tests failed, the reasons for which I haven't
 investigated yet
 (http://www.cse.psu.edu/~kalsi/files/regression.diffs)-
 
 test create_function_1... FAILED
 test create_type  ... FAILED
 test create_table ... FAILED
 test create_function_2... FAILED
 test triggers ... FAILED
 test create_operator  ... FAILED
 test create_view  ... FAILED
 test transactions ... FAILED
 test misc ... FAILED
 test select_views ... FAILED
 test rules... FAILED
 test plpgsql  ... failed (ignored)
 test copy2... FAILED
 test rangefuncs   ... FAILED
 test conversion   ... FAILED
 test stats... FAILED
 
 The _InterlockedExchange() function is defined in ia64intrin.h header file
 
 int _InterlockedExchange(volatile int *Target, long value)
 Do an exchange operation atomically. Maps to the xchg4 instruction.
 
 More information is available at
 http://www.intel.com/software/products/compilers/clin/docs/ug_cpp/lin1072.htm
 
 Also, some other points to note, _ICC wasn't defined on my
 installation when I was using icc by setting env var CC=icc. So, when
 I tried to put a #if defined for using asm() for gcc and
 _InterlockedExchange(), it didn't work. So, after this change gcc
 compilation fails.
 
 As of now, I am trying to test the binary further to see if it is
 stable. Would you be knowing some good way to test this change?
 
 I am not aware of the procedure of building patches but if this
 resolves this issue and you would like me to make some sort of a
 patch

Re: [HACKERS] postgreSQL-8.0.1 compilation with icc-8.1 on Itanium-2 gives error: asm statements not supported

2005-03-03 Thread Vikram Kalsi
Tom, Peter,

I have been able to compile and sucessfully run pgSQL after replacing
the asm statement in postgresql-8.0.1/src/include/storage/s_lock.h
with an equivalent intrinsic for the Itanium platform-

--BEGIN OLD
s_lock.h--
#if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
#define HAS_TEST_AND_SET
typedef unsigned int slock_t;
#define TAS(lock) tas(lock)

static __inline__ int
tas(volatile slock_t *lock)
{
long intret;

__asm__ __volatile__(
   xchg4   %0=%1,%2\n
:   =r(ret), +m(*lock)
:   r(1)
:   memory);
return (int) ret;
}
#endif   /* __ia64__ || __ia64 */
---END OLD
s_lock.h--

--BEGIN NEW
s_lock.h--
#if defined(__ia64__) || defined(__ia64)  /* __ia64 used by ICC compiler? */
#define HAS_TEST_AND_SET
typedef unsigned int slock_t;
#define TAS(lock) tas(lock)

static __inline__ int
tas(volatile slock_t *lock)
{
int ret;

ret = _InterlockedExchange(lock,1);

return ret;
}
#endif   /* __ia64__ || __ia64 */
--END NEW
s_lock.h--

The binary appears to be stable and the tpc-H benchmark executed
successfully against it as well. I also ran the regression test but
the following tests failed, the reasons for which I haven't
investigated yet
(http://www.cse.psu.edu/~kalsi/files/regression.diffs)-

test create_function_1... FAILED
test create_type  ... FAILED
test create_table ... FAILED
test create_function_2... FAILED
test triggers ... FAILED
test create_operator  ... FAILED
test create_view  ... FAILED
test transactions ... FAILED
test misc ... FAILED
test select_views ... FAILED
test rules... FAILED
test plpgsql  ... failed (ignored)
test copy2... FAILED
test rangefuncs   ... FAILED
test conversion   ... FAILED
test stats... FAILED

The _InterlockedExchange() function is defined in ia64intrin.h header file

int _InterlockedExchange(volatile int *Target, long value)
Do an exchange operation atomically. Maps to the xchg4 instruction.

More information is available at
http://www.intel.com/software/products/compilers/clin/docs/ug_cpp/lin1072.htm

Also, some other points to note, _ICC wasn't defined on my
installation when I was using icc by setting env var CC=icc. So, when
I tried to put a #if defined for using asm() for gcc and
_InterlockedExchange(), it didn't work. So, after this change gcc
compilation fails.

As of now, I am trying to test the binary further to see if it is
stable. Would you be knowing some good way to test this change?

I am not aware of the procedure of building patches but if this
resolves this issue and you would like me to make some sort of a
patch, then please let me know.

Thanks,
-Vikram


On Thu, 3 Mar 2005 09:55:18 +0100, Peter Eisentraut [EMAIL PROTECTED] wrote:
 Tom Lane wrote:
  #if defined(__GNUC__) || defined(__ICC)
 
  Can anyone say a reason why the above #if is not wrong ... ie,
  are there any platforms where icc does handle gcc asm syntax,
  and if so exactly which ones are they?
 
 I believe I added that a few releases ago.  The platform is IA32.
 Evidently, the GCC compatibility on IA64 is not quite as far yet.
 
 --
 Peter Eisentraut
 http://developer.postgresql.org/~petere/


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[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


[HACKERS] postgreSQL-8.0.1 compilation with icc-8.1 on Itanium-2 gives error: asm statements not supported

2005-03-02 Thread Vikram Kalsi
 Hi,

I am trying to compile postgresql-8.0.1 with icc-8.1.028 on a Linux
RHEL AS3 SMP Itanium2 machine and I get an error as follows-
The complete config.log and make.log is online at
http://www.cse.psu.edu/~kalsi/files/

icc -static -fPIC -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wold-style-definition -Wendif-labels
-fno-strict-aliasing -I../../../../src/include -D_GNU_SOURCE -c -o
xlog.o xlog.c

../../../../src/include/storage/s_lock.h(184): error: asm statements
not supported in this environment
__asm__ __volatile__(
^

../../../../src/include/storage/s_lock.h(186): error: expected a )
: =r(ret), +m(*lock)


I am able to sucessfully compile this postgreSQL with gcc on this machine.

I suppose this means that pgsql uses ASM statements and since ASM
statements are not supported in the Intel C++ compiler, the
compilation fails.

Is there some way to workaround this, for e.g. a patch? Will icc be
supported in any future release of pgsql?

All suggestions welcome,

Thanks in anticipation,

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

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