Discussion:
[freetds] can't compile master without threads?
James K. Lowden
2013-03-11 16:13:11 UTC
Permalink
Hello Freddy,

I can't seem to compile the latest without thread support. I'm configured with

$ ../configure --config-cache --with-tdsver=7.0 --with-libiconv-prefix=/usr \
--enable-threadsafe=no --with-odbc-nodm=/usr/pkg

Here's how it ends:

Making all in unittests
/bin/ksh ../../libtool --tag=CC --mode=compile /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c -o getpassarg.lo ../../../src/replacements/getpassarg.c
libtool: compile: /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c ../../../src/replacements/getpassarg.c -fPIC -DPIC -o .libs/getpassarg.o
In file included from ../../../include/tds.h:54:0,
from ../../../src/replacements/getpassarg.c:29:
../../../include/tdsthread.h:216:2: error: #error Condition not supported!
*** Error code 1

Suggestions?

--jkl
Frediano Ziglio
2013-03-12 09:00:05 UTC
Permalink
Post by James K. Lowden
Hello Freddy,
I can't seem to compile the latest without thread support. I'm configured with
$ ../configure --config-cache --with-tdsver=7.0 --with-libiconv-prefix=/usr \
--enable-threadsafe=no --with-odbc-nodm=/usr/pkg
Making all in unittests
/bin/ksh ../../libtool --tag=CC --mode=compile /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c -o getpassarg.lo ../../../src/replacements/getpassarg.c
libtool: compile: /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c ../../../src/replacements/getpassarg.c -fPIC -DPIC -o .libs/getpassarg.o
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not supported!
*** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?

The other problem is that some test require thread (they test thread behaviour).

Frediano
Frediano Ziglio
2013-03-12 11:40:21 UTC
Permalink
Post by Frediano Ziglio
Post by James K. Lowden
Hello Freddy,
I can't seem to compile the latest without thread support. I'm configured with
$ ../configure --config-cache --with-tdsver=7.0 --with-libiconv-prefix=/usr \
--enable-threadsafe=no --with-odbc-nodm=/usr/pkg
Making all in unittests
/bin/ksh ../../libtool --tag=CC --mode=compile /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c -o getpassarg.lo ../../../src/replacements/getpassarg.c
libtool: compile: /usr/pkg/gcc46/bin/cc -DHAVE_CONFIG_H -I. -I../../../src/replacements -I../../include -I../../../include -I../../../src/replacements -I/usr/pkg/include -I/usr/local/include -DTDS_NO_DM -DDEBUG=1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -pthread -g -O0 -Wdeclaration-after-statement -MT getpassarg.lo -MD -MP -MF .deps/getpassarg.Tpo -c ../../../src/replacements/getpassarg.c -fPIC -DPIC -o .libs/getpassarg.o
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not supported!
*** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?
The other problem is that some test require thread (they test thread behaviour).
I was thinking if thread-safe=no should mean I don't want to support
thread at all.

Frediano
James K. Lowden
2013-03-12 12:23:35 UTC
Permalink
On Tue, 12 Mar 2013 09:00:05 +0000
Post by Frediano Ziglio
Post by James K. Lowden
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not
supported! *** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?
But I'm using --enable-threadsafe=no....

--jkl
Frediano Ziglio
2013-03-12 18:30:02 UTC
Permalink
Post by James K. Lowden
On Tue, 12 Mar 2013 09:00:05 +0000
Post by Frediano Ziglio
Post by James K. Lowden
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not
supported! *** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?
But I'm using --enable-threadsafe=no....
Yes, I know, was meant as a temporary solution

Frediano
James K. Lowden
2013-03-12 23:05:43 UTC
Permalink
On Tue, 12 Mar 2013 09:00:05 +0000
Post by Frediano Ziglio
Post by James K. Lowden
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not
supported! *** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?
Let me try answering again, now that I've had some coffee....

I haven't investigated it carefully, but as of NetBSD 5.0 FreeTDS
couldn't be compiled with threads enabled. It's probably (?) because
of some autoconf snafu. I am planning to upgrade, and it might go
away. But I doubt I'm the only user who compiles without threading
support.

I've never cared. I don't like multithreaded programming, and I don't
understand why an I/O library should support it! It's not as if you
can process rows faster with multiple threads; the server is always the
bottleneck.

So, yes, "never" is pretty much where I stand re threads. :-) I also
think there must be other platforms -- and maybe even other programmers
-- that can't use or can't stand threads.
Post by Frediano Ziglio
The other problem is that some test require thread (they test thread behaviour).
Yes, but that's easy to work around, no? Wrap the whole thing in a #if
that tests whether threading is enabled. What more is needed?

Regards,

--jkl
Frediano Ziglio
2013-03-13 17:43:55 UTC
Permalink
Post by James K. Lowden
On Tue, 12 Mar 2013 09:00:05 +0000
Post by Frediano Ziglio
Post by James K. Lowden
In file included from ../../../include/tds.h:54:0,
../../../include/tdsthread.h:216:2: error: #error Condition not
supported! *** Error code 1
Suggestions?
--jkl
Ehm.... disable --thread-safe? The other option is to write
conditional code for no thread environment. Are you sure you are never
using thread?
Let me try answering again, now that I've had some coffee....
I haven't investigated it carefully, but as of NetBSD 5.0 FreeTDS
couldn't be compiled with threads enabled. It's probably (?) because
of some autoconf snafu. I am planning to upgrade, and it might go
away. But I doubt I'm the only user who compiles without threading
support.
I've never cared. I don't like multithreaded programming, and I don't
understand why an I/O library should support it! It's not as if you
can process rows faster with multiple threads; the server is always the
bottleneck.
So, yes, "never" is pretty much where I stand re threads. :-) I also
think there must be other platforms -- and maybe even other programmers
-- that can't use or can't stand threads.
Post by Frediano Ziglio
The other problem is that some test require thread (they test thread behaviour).
Yes, but that's easy to work around, no? Wrap the whole thing in a #if
that tests whether threading is enabled. What more is needed?
Regards,
--jkl
Mm... I don't understand why you are not able to use normal options. I
installed a virtual machine with NetBSD 5.0 (amd64), installed wget
(not that easy), got a "make dist" output, configure and make works
without problems. Perhaps the configure I'm using works even for
NetBSD 5 ? Or probably as a side effect IPv6 support fixed NetBSD.

I didn't try however to do some connection test.

Anyway, I pushed a fix. MARS require thread support however.
Personally I think that if a system support threads (which Unix
nowadays does not support thread? Today even phones are quad core!) is
better to be thread-safe. If some strange implementation decide to
call your signal from another thread created from another library it
prevent nasty things to happen.

Frediano

Loading...