Re: [HACKERS] ecpg tests compile failure
I have applied the following patches to CVS HEAD and 7.4.X to suppress the ecpg thread test if they didn't enable threads via configure. I also cleaned up the tools/thread test because this is to be used before you have your OS running threads via configure. --- Dave Cramer wrote: Bruce, You are correct. I did not configure with --enable-thread-safety Dave On Thu, 2003-12-18 at 08:40, Bruce Momjian wrote: Dave Cramer wrote: Shridhar, Obviously not, but I just did make inside the test directory, so I assume the Makefile needs to be fixed. Thanks, Dave On Thu, 2003-12-18 at 07:21, Shridhar Daithankar wrote: On Thursday 18 December 2003 17:37, Dave Cramer wrote: test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' It is not linking against pthreads library. Do you have -lpthread cause in your compilation/linking command? The ecpg/test/Makefile has: override CPPFLAGS := -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) and %: %.o $(CC) $(CFLAGS) $(LDFLAGS) -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lpq $(THREAD_LIBS) -o $@ so I see the thread compile and link flags mentioned in the Makefile. My guess is that you didn't compile the backend with --enable-thread-safety. I wonder if I should disable the thread ecpg test program when this compile option is not used. Is that correct? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 Index: src/Makefile.global.in === RCS file: /cvsroot/pgsql-server/src/Makefile.global.in,v retrieving revision 1.171 diff -c -c -r1.171 Makefile.global.in *** src/Makefile.global.in 29 Nov 2003 19:51:39 - 1.171 --- src/Makefile.global.in 19 Dec 2003 23:21:45 - *** *** 121,127 # # Records the choice of the various --enable-xxx and --with-xxx options. - with_threads = @with_threads@ with_java = @with_java@ with_perl = @with_perl@ with_python = @with_python@ --- 121,126 *** *** 131,136 --- 130,136 enable_rpath = @enable_rpath@ enable_nls= @enable_nls@ enable_debug = @enable_debug@ + enable_thread_safety = @enable_thread_safety@ python_includespec= @python_includespec@ python_libspec= @python_libspec@ Index: src/interfaces/ecpg/test/Makefile === RCS file: /cvsroot/pgsql-server/src/interfaces/ecpg/test/Makefile,v retrieving revision 1.42 diff -c -c -r1.42 Makefile *** src/interfaces/ecpg/test/Makefile 29 Nov 2003 19:52:09 - 1.42 --- src/interfaces/ecpg/test/Makefile 19 Dec 2003 23:21:46 - *** *** 8,14 ECPG = ../preproc/ecpg -I$(srcdir)/../include ! TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix test_thread all: $(TESTS) --- 8,17 ECPG = ../preproc/ecpg -I$(srcdir)/../include ! TESTS = test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init testdynalloc num_test dt_test test_informix ! ifeq ($(enable_thread_safety), yes) ! TESTS += test_thread ! endif all: $(TESTS) Index: src/tools/thread/thread_test.c === RCS file: /cvsroot/pgsql-server/src/tools/thread/thread_test.c,v retrieving revision 1.5 diff -c -c -r1.5 thread_test.c *** src/tools/thread/thread_test.c 29 Nov 2003 19:52:14 - 1.5 --- src/tools/thread/thread_test.c 19 Dec 2003 23:21:47 - *** *** 20,29 *- */ - - #ifdef ENABLE_THREAD_SAFETY #include pthread.h - #endif #include unistd.h #include stdio.h #include stdlib.h --- 20,26 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[HACKERS] ecpg tests compile failure
test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' Dave ---(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
Re: [HACKERS] ecpg tests compile failure
On Thursday 18 December 2003 17:37, Dave Cramer wrote: test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' It is not linking against pthreads library. Do you have -lpthread cause in your compilation/linking command? Shridhar ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] ecpg tests compile failure
Shridhar, Obviously not, but I just did make inside the test directory, so I assume the Makefile needs to be fixed. Thanks, Dave On Thu, 2003-12-18 at 07:21, Shridhar Daithankar wrote: On Thursday 18 December 2003 17:37, Dave Cramer wrote: test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' It is not linking against pthreads library. Do you have -lpthread cause in your compilation/linking command? Shridhar ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [HACKERS] ecpg tests compile failure
On Thursday 18 December 2003 18:03, Dave Cramer wrote: Shridhar, Obviously not, but I just did make inside the test directory, so I assume the Makefile needs to be fixed. I don't think so.. Check this.. [EMAIL PROTECTED] pgsql]$ find . -name Makefile.global ./src/Makefile.global [EMAIL PROTECTED] pgsql]$ grep THREAD_LIBS ./src/Makefile.global THREAD_LIBS = -lpthread If you don't have this flag defined, the tests won't be linked against the thread library. Check what value this flag is set to. You did a ./configure --enable-thread-safety, right? Which platform is this BTW? This is on a CVS head checkout from couple of days ago on linux.. All the tests got successfully compiled. Shridhar ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [HACKERS] ecpg tests compile failure
Dave Cramer wrote: Shridhar, Obviously not, but I just did make inside the test directory, so I assume the Makefile needs to be fixed. Thanks, Dave On Thu, 2003-12-18 at 07:21, Shridhar Daithankar wrote: On Thursday 18 December 2003 17:37, Dave Cramer wrote: test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' It is not linking against pthreads library. Do you have -lpthread cause in your compilation/linking command? The ecpg/test/Makefile has: override CPPFLAGS := -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) and %: %.o $(CC) $(CFLAGS) $(LDFLAGS) -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lpq $(THREAD_LIBS) -o $@ so I see the thread compile and link flags mentioned in the Makefile. My guess is that you didn't compile the backend with --enable-thread-safety. I wonder if I should disable the thread ecpg test program when this compile option is not used. Is that correct? -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (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 4: Don't 'kill -9' the postmaster
Re: [HACKERS] ecpg tests compile failure
Bruce, You are correct. I did not configure with --enable-thread-safety Dave On Thu, 2003-12-18 at 08:40, Bruce Momjian wrote: Dave Cramer wrote: Shridhar, Obviously not, but I just did make inside the test directory, so I assume the Makefile needs to be fixed. Thanks, Dave On Thu, 2003-12-18 at 07:21, Shridhar Daithankar wrote: On Thursday 18 December 2003 17:37, Dave Cramer wrote: test_thread.pgc:51: undefined reference to `pthread_create' undefined reference to `pthread_join' It is not linking against pthreads library. Do you have -lpthread cause in your compilation/linking command? The ecpg/test/Makefile has: override CPPFLAGS := -I$(srcdir)/../include -I$(libpq_srcdir) $(CPPFLAGS) $(THREAD_CPPFLAGS) and %: %.o $(CC) $(CFLAGS) $(LDFLAGS) -L../ecpglib -L ../pgtypeslib -L../../libpq $^ $(LIBS) -lpgtypes -lecpg -lpq $(THREAD_LIBS) -o $@ so I see the thread compile and link flags mentioned in the Makefile. My guess is that you didn't compile the backend with --enable-thread-safety. I wonder if I should disable the thread ecpg test program when this compile option is not used. Is that correct? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org