Re: [MonetDB-users] MonetDB-11.3.1 on OpenBSD 4.9 i386 fails during make

It seems that in OpenBSD sys/sysctl.h requires sys/param.h (http://lists.gnu.org/archive/html/bug-autoconf/2005-08/msg00015.html). I've found this workaround, but I won't test it until tomorrow probably: http://lists.gnu.org/archive/html/bug-autoconf/2005-08/msg00015.html I also don't know exactly how to apply the above workaround (or any other) in the MonetDB Makefile(s ?). On Wed, May 4, 2011 at 6:27 PM, Michael Sioutis <sioutis@di.uoa.gr> wrote:

I'm not sure the warnings about sys/sysctl.h are indeed a problem. The real test is, is HAVE_SYS_SYSCTL_H defined in the produced monetdb_config.h file? If so, sys/sysctl.h will be used. Also, is HAVE_SYS_PARAM_H defined? If that is also defined, then they're both included, and in the correct order. On 2011-05-04 17:29, Michael Sioutis wrote:
-- Sjoerd Mullender

429: /* Define to 1 if you have the <sys/param.h> header file. */ 430: #define HAVE_SYS_PARAM_H 1 . . . 441: /* Define to 1 if you have the <sys/sysctl.h> header file. */ 442: /* #undef HAVE_SYS_SYSCTL_H */ Also in the configuration.log: checking sys/sysctl.h usability... no So they're not in the correct order or sth? Cause sys/param.h seems ok but sys/sysctl.h not. On Wed, May 4, 2011 at 7:00 PM, Sjoerd Mullender <sjoerd@acm.org> wrote:

On 04-05-2011 19:08:23 +0300, Michael Sioutis wrote:
configure checks for this header in separation, hence sys/sysctl.h bombs out. We need to adopt this to a check that first includes sys/param.h (if found) and then tests sys/sysctl.h

On 04-05-2011 18:31:12 +0200, Sjoerd Mullender wrote:
Attached is a possible patch. It more-or-less follows the recommendation from the autoconf documentation.
Hmm, I just checked in another patch copy 'n' pasted from the autoconf info page...
Difference is I don't have the $ac_includes_default bit.

Yup it did. Nth different in monetdb_config.h either. I did patch < syctl.patch and it added the following code in configure.ag: AC_CHECK_HEADERS([sys/sysctl.h], [], [], [$ac_includes_default #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif ]) On Wed, May 4, 2011 at 10:43 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On 04-05-2011 22:48:09 +0300, Michael Sioutis wrote:
If you're not using Mercurial sources, please try this tar: http://monetdb.cwi.nl/testing/projects/monetdb/testweb/web/40107:fcae3cfc1f5... It should include all fixes made for OpenBSD today.

In monetdb_config.h /* Define to 1 if you have the <sys/sysctl.h> header file. */ #define HAVE_SYS_SYSCTL_H 1 The configuration seems promising. Also I noticed you included the patch without the $ac_includes_default bit. I'll cross fingers till gmake is done (it takes a while because it's an old machine) and report status later :) On Wed, May 4, 2011 at 11:09 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

I shouldn't think it was gonna be that easy.. ==================================================================== In file included from /usr//include/sys/sysctl.h:46, from gdk_system.h:60, from ../../gdk/gdk_system.mx:233: /usr//include/sys/ucred.h:46: error: 'NGROUPS' undeclared here (not in a function) In file included from /usr//include/sys/sysctl.h:47, from gdk_system.h:60, from ../../gdk/gdk_system.mx:233: /usr//include/sys/proc.h:64: error: 'MAXLOGNAME' undeclared here (not in a function) /usr//include/sys/proc.h:287: error: 'MAXCOMLEN' undeclared here (not in a function) gmake[3]: *** [libbat_la-gdk_system.lo] Error 1 gmake[3]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/gdk' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/gdk' gmake[1]: *** [all-recursive] Error 1 ==================================================================== NGROUPS is defined as a preprocessor macro in: sys/param.h, line 73 MAXLOGNAME is defined as a preprocessor macro in: sys/param.h, line 70 MAXCOMLEN is defined as a preprocessor macro in: sys/param.h, line 68 So, I changed in MonetDB-11.3.2/BUILD/gdk/gdk_system.h (actually I could have changed it in the .mx file): #ifdef HAVE_SYS_SYSCTL_H # include <sys/sysctl.h> #endif to: #ifdef HAVE_SYS_SYSCTL_H # include <sys/param.h> # include <sys/sysctl.h> #endif After a long time of compilation with gmake, I am now stuck with this error: ==================================================================== /home/pico/MonetDB-11.3.2/BUILD/gdk/.libs/libbat.so.3.0: undefined reference to `sysctlbyname' collect2: ld returned 1 exit status gmake[5]: *** [mserver5] Error 1 gmake[5]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/tools/mserver' gmake[4]: *** [all] Error 2 gmake[4]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/tools/mserver' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/tools' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD/tools' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/home/pico/MonetDB-11.3.2/BUILD' gmake: *** [all] Error 2 ==================================================================== I believe some library should be linked. On Wed, May 4, 2011 at 11:27 PM, Michael Sioutis <papito.dit@gmail.com> wrote:

On 05-05-2011 01:07:29 +0300, Michael Sioutis wrote:
I fixed this in the code for all places where sys/sysctl.h is included now. Thanks.
/home/pico/MonetDB-11.3.2/BUILD/gdk/.libs/libbat.so.3.0: undefined reference to `sysctlbyname'
I believe some library should be linked.
Indeed. Does the manpage of sysctlbyname list which library needs to be linked to?

http://www.daemon-systems.org/man/sysctlbyname.3.html So -lc should be used in the flags. If -lpthread is used also, the order should be ... -lpthread -lc ... On Thu, May 5, 2011 at 9:27 AM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On 05-05-2011 10:04:20 +0300, Michael Sioutis wrote:
http://www.daemon-systems.org/man/sysctlbyname.3.html So -lc should be used in the flags.
Ok, thanks, I'll take a look.
If -lpthread is used also, the order should be ... -lpthread -lc ...
We use -pthread when possible, because gcc in general knows best what order and so on.

On 05-05-2011 09:18:52 +0200, Fabian Groffen wrote:
This commit should do it: http://dev.monetdb.org/hg/MonetDB/rev/1331a211ca03 You'll have to (re)bootstrap if you apply this as patch

I am using the tarball 11.3.2 and applied the changes manually, but I have messed up since the same error occurs and I don't see a "-lc" flag here: libtool: link: gcc -g -O2 -Wno-declaration-after-statement -D_REENTRANT -o .libs/mserver5 mserver5.o monet_version.o -pthread -pthread -Wl,-E -L/home/pico/MonetDB-11.3.2/BUILD/gdk/.libs -L/home/pico/MonetDB-11.3.2/BUILD/clients/mapilib/.libs -L/home/pico/MonetDB-11.3.2/BUILD/common/stream/.libs -L../../monetdb5/tools/.libs -lmonetdb5 -L/usr/local/lib -lmapi -lreadline -ltermcap -lxml2 -lpthread -lm -L../../gdk/.libs -lbat -lstream -lcurl -lidn -lz -lintl -liconv -lpcre -lssl -lcrypto -pthread -Wl,-rpath,/home/pico/MonetDB/lib -Wl,-rpath,/usr/local/lib I also noticed some Makefiles.aG didn't exist, they were Makefile.aM, so I applied the changes there. Since the tarball isn't very handy, should I go for the default branch? Correct me if I'm wrong, this should be: hg clone -r default http://dev.monetdb.org/hg/MonetDB On Thu, May 5, 2011 at 10:42 AM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On Thu, May 05, 2011 at 11:43:17AM +0300, Michael Sioutis wrote:
Since the tarball is already bootstrapped, Makefile.aM have been generated from Makefile.aG; hence, the latter are not required and hence not supposed to be in the tarball.
Since the tarball isn't very handy, should I go for the default branch?
Better go for the latest release branch "Apr2011", Fabian applied his bug fixes there.
Correct me if I'm wrong, this should be: hg clone -r default http://dev.monetdb.org/hg/MonetDB
I do: hg clone -u Apr2011 http://dev.monetdb.org/hg/MonetDB/ Stefan -- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |

I had to export AUTOCONF_VERSION and AUTOMAKE_VERSION variables, and copy some .../libtool.m4 to aclocal.m4, to get bootstrap to work, but it worked and configuration was smooth. Now.. In file included from ../../../clients/mapilib/mapi.c:803: /usr//include/malloc.h:4:2: error: #warning "<malloc.h> is obsolete, use <stdlib.h>" This is a first since the tarball only gave me warnings about this. I have to pass this option to the compiler: "-DNGX_HAVE_MALLOC_H=0" But I can't find anything relevant with configure --help On Thu, May 5, 2011 at 12:07 PM, <Stefan.Manegold@cwi.nl> wrote:

mserver5.o(.text+0x5b3): In function `absolute_path': ../../../tools/mserver/mserver5.c:160: warning: sprintf() is often misused, please use snprintf() ../../monetdb5/tools/.libs/libmonetdb5.so.7.0: warning: strcat() is almost always misused, please use strlcat() /home/pico/MonetDB/BUILD/gdk/.libs/libbat.so.3.0: undefined reference to `sysctlbyname' collect2: ld returned 1 exit status On Thu, May 5, 2011 at 1:24 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

Ah yes, sorry about that, forgot to include it: gcc -g -O2 -Wno-declaration-after-statement -D_REENTRANT -o .libs/mserver5 mserver5.o monet_version.o -pthread -pthread -Wl,-E -L/home/pico/MonetDB/BUILD/gdk/.libs -L/home/pico/MonetDB/BUILD/clients/mapilib/.libs -L/home/pico/MonetDB/BUILD/common/stream/.libs -L../../monetdb5/tools/.libs -lmonetdb5 -L/usr/local/lib -lmapi -lreadline -ltermcap -lxml2 -lpthread -lm -L../../gdk/.libs -lbat -lstream -pthread -lcurl -lidn -lz -lintl -liconv -lpcre -lssl -lcrypto -Wl,-rpath,/home/pico/MonetDB-Apr2011/lib -Wl,-rpath,/usr/local/lib It should be ... -lpthread <HERE> -lm ... On Thu, May 5, 2011 at 2:28 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On 05-05-2011 13:50:29 +0200, Fabian Groffen wrote:
Ok, I hope this commit will do: http://dev.monetdb.org/hg/MonetDB/rev/58ca3da52d10

Nop: gcc -g -O2 -Wno-declaration-after-statement -D_REENTRANT -o .libs/mserver5 mserver5.o monet_version.o -pthread -pthread -Wl,-E -L/home/pico/MonetDB/BUILD/gdk/.libs -L/home/pico/MonetDB/BUILD/clients/mapilib/.libs -L/home/pico/MonetDB/BUILD/common/stream/.libs -L../../monetdb5/tools/.libs -lmonetdb5 -L/usr/local/lib -lmapi -lreadline -ltermcap -lxml2 -lpthread -lm -L../../gdk/.libs -lbat -lstream -pthread -lcurl -lidn -lz -lintl -liconv -lpcre -lssl -lcrypto -Wl,-rpath,/home/pico/MonetDB-Apr2011/lib -Wl,-rpath,/usr/local/lib /home/pico/MonetDB/BUILD/gdk/.libs/libbat.so.3.0: warning: vsprintf() is often misused, please use vsnprintf() ../../monetdb5/tools/.libs/libmonetdb5.so.7.0: warning: strcpy() is almost always misused, please use strlcpy() mserver5.o(.text+0x5b3): In function `absolute_path': ../../../tools/mserver/mserver5.c:160: warning: sprintf() is often misused, please use snprintf() ../../monetdb5/tools/.libs/libmonetdb5.so.7.0: warning: strcat() is almost always misused, please use strlcat() /home/pico/MonetDB/BUILD/gdk/.libs/libbat.so.3.0: undefined reference to `sysctlbyname' collect2: ld returned 1 exit status gmake[5]: *** [mserver5] Error 1 I /de-bootstraped, reconfigured and later even placed C_LIBS="-lc" in configure.ag, reconfigured, gmaked, ...same error. I thought that would do it. On Thu, May 5, 2011 at 3:08 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On Thu, May 05, 2011 at 05:00:34PM +0300, Michael Sioutis wrote:
I assume you ran ./bootstrap after ./de-bootstrap and before configure, right? (well, ./de-bootstrap removed configure; only ./bootstrap creates it, again ...) Did you also re-run ./bootstrap after modifying configure.ag? ./bootstrap always needs to be run after changes to any *.ag file(s), otherwise those changes are not effective ... Stefan
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |

This is with: C_LIBS="-lc" gcc -g -O2 -Wno-declaration-after-statement -D_REENTRANT -o .libs/mserver5 mserver5.o monet_version.o -pthread -pthread -Wl,-E -L/home/pico/MonetDB/BUILD/gdk/.libs -L/home/pico/MonetDB/BUILD/clients/mapilib/.libs -L/home/pico/MonetDB/BUILD/common/stream/.libs -L../../monetdb5/tools/.libs -lmonetdb5 -L/usr/local/lib -lmapi -lreadline -ltermcap -lxml2 -lpthread -lm -L../../gdk/.libs -lbat -lstream -pthread -lcurl -lidn -lz -lintl -liconv -lpcre -lssl -lcrypto -Wl,-rpath,/home/pico/MonetDB-Apr2011/lib -Wl,-rpath,/usr/local/lib /home/pico/MonetDB/BUILD/gdk/.libs/libbat.so.3.0: warning: vsprintf() is often misused, please use vsnprintf() ../../monetdb5/tools/.libs/libmonetdb5.so.7.0: warning: strcpy() is almost always misused, please use strlcpy() mserver5.o(.text+0x5b3): In function `absolute_path': ../../../tools/mserver/mserver5.c:160: warning: sprintf() is often misused, please use snprintf() ../../monetdb5/tools/.libs/libmonetdb5.so.7.0: warning: strcat() is almost always misused, please use strlcat() /home/pico/MonetDB/BUILD/gdk/.libs/libbat.so.3.0: undefined reference to `sysctlbyname' collect2: ld returned 1 exit status Same error and no sign of -lc On Thu, May 5, 2011 at 5:14 PM, Michael Sioutis <papito.dit@gmail.com> wrote:

Ok, sysctlbyname() is NOT Implemented in OpenBSD for sure. The man page I was reading and posted here was about NetBSD.. There is a bug report about this in MonetDB mail archive, and a patch which somehow got lost in the way to current revision (?). http://www.mail-archive.com/monetdb-bugs@lists.sourceforge.net/msg06075.html So you don't need to revert any changes, apparently -lc is good for FreeBSD and NetBSD (I double checked it), but not for OpenBSD. Just maybe change the title "build: allow to resolve sysctl funcs on FreeBSD/NetBSD" On Thu, May 5, 2011 at 6:01 PM, Michael Sioutis <papito.dit@gmail.com> wrote:

Michael. thanks for digging this up! The "old" patch [1] is actually still in the code, but it does only avoid the use of sysctlbyname() to find out he number of processores/cores in MT_check_nr_cores() (gdk/gdk_system.mx) --- provided (your) OpenBSD indeed defined __OpenBSD__, and not any of __FreeBSD__, __NetBSD__, __MACH__, ... However, there are two more calls to sysctlbyname() in MT_init() (gdk/gdk_utils.mx) to find out the pagsize, and one of these might trigger the linking problem in your case, i.e., the respective checks there are necessary but not sufficient ... I know to little about the matter to dig further myself, but maybe the above helps Fabian to go on ... Stefan [1] http://dev.monetdb.org/hg/MonetDB/rev/df23faf73516 On Thu, May 05, 2011 at 08:44:37PM +0300, Michael Sioutis wrote:
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |

I am __OpenBSD__ for sure: /* test.c */ #if defined(__OpenBSD__) #include <malloc.h> #endif int main(void){return 0;} pico@hive:~$ gcc -Wall -W -ansi -pedantic -o test test.c In file included from test.c:3: /usr//include/malloc.h:4:2: warning: #warning "<malloc.h> is obsolete, use <stdlib.h>" At least it makes sense to me now why this is happening :) On Thu, May 5, 2011 at 9:09 PM, <Stefan.Manegold@cwi.nl> wrote:

On 05-05-2011 20:44:37 +0300, Michael Sioutis wrote:
freebsd doesn't need it, or we would've found that during the nightly builds.
for OpenBSD. Just maybe change the title "build: allow to resolve sysctl funcs on FreeBSD/NetBSD"
I'll do.

On 05-05-2011 20:44:37 +0300, Michael Sioutis wrote:
How about this patch? http://dev.monetdb.org/hg/MonetDB/rev/eaf69ec3244e

Hello Fabian, bootstrap OK .configure --prefix=/home/pico/MonetDB-Apr2011/ --disable-strict --disable-optimize --disable-debug OK gmake -j1 OK gmake -j1 install OK pico@hive:~/MonetDB-Apr2011/bin$ ./monetdbd unable to open '${prefix}/var/log/monetdb/merovingian.log': No such file or directory I am vrey ill today, and I don't have clarity, but I think ("") should be used instead of single ones. On Fri, May 6, 2011 at 1:50 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On 06-05-2011 20:09:12 +0300, Michael Sioutis wrote:
Hmmm, not really, you have a bug that I fixed already a couple of days ago. Odd. Apparently it still isn't fixed completely yet. The easiest way to fix this is by just doing a monetdbd set logfile=/home/pico/MonetDB-Apr2011/var/log/monetdb/merovingian.log and similar for pidfile

pico@hive:~/MonetDB-Apr2011/bin$ ./monetdbd set pidfile=/home/pico/MonetDB-Apr2011/var/log/monetdb/merovingian.log sending SIGHUP to monetdbd[2011] failed: No such process On Fri, May 6, 2011 at 8:14 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

pico@hive:~/MonetDB-Apr2011/bin$ ./monetdbd set logfile=/home/pico/MonetDB-Apr2011/var/log/monetdb/merovingian.log pico@hive:~/MonetDB-Apr2011/bin$ ./monetdbd set pidfile=/home/pico/MonetDB-Apr2011/var/log/monetdb/merovingian.log pico@hive:~/MonetDB-Apr2011/bin$ ./monetdbd pico@hive:~/MonetDB-Apr2011/bin$ ps -ax | grep monetdbd 2584 ?? Ss 0:00.02 ./monetdbd pico@hive:~/MonetDB-Apr2011/bin$ ./monetdb create mydb created database in maintenance mode: mydb pico@hive:~/MonetDB-Apr2011/bin$ ./monetdb release mydb taken database out of maintenance mode: mydb pico@hive:~/MonetDB-Apr2011/bin$ ./mclient -l sql -u monetdb -d mydb password: merovingian: internal error while starting mserver, please refer to the logs It's again sth about mal_init, attaching the log. On Fri, May 6, 2011 at 8:45 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

On 06-05-2011 23:57:45 +0300, Michael Sioutis wrote:
Hmmm, memory detection broke, cpu detection is still in tact.
Odd enough, mserver uses the same function that monetdbd uses, and for monetdbd it works... Did you perform a full clean recompile? If so, how is your libdir called? e.g. % ls /home/pico/MonetDB-Apr2011/

Full clean recompile. My libdir is: pico@hive:~/MonetDB-Apr2011/lib$ ls libbat.la libmapi.so.3.0 libstream.la pkgconfig libbat.so.3.0 libmonetdb5.la libstream.so.2.0 libmapi.la libmonetdb5.so.7.0 monetdb5 Oddly enough, I can see more files and directories under my lib in Ubuntu (it is version 11.3.1 I think with a different configuration though) : pico@oblivion:~/MonetDB-hg/lib$ ls libbat.la libmapi.so libmonetdb5.so.6 libstream.so.2.0.0 libbat.so libmapi.so.2 libmonetdb5.so.6.0.0 monetdb5 libbat.so.2 libmapi.so.2.0.0 libstream.la pkgconfig libbat.so.2.0.0 libmonetdb5.la libstream.so python2.6 libmapi.la libmonetdb5.so libstream.so.2 On Sat, May 7, 2011 at 10:51 AM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

try `ls -l` and you'll see which are files and which are symlinks. Stefan On Sat, May 07, 2011 at 01:34:34PM +0300, Michael Sioutis wrote:
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |

On 07-05-2011 14:07:01 +0300, Michael Sioutis wrote:
Ok, i have symlinks in my UBuntu, but none in my OpenBSD.
It's about the same files, you just don't have python stuff. (BSD uses another versioning scheme than Linux and Solaris for its ELF shared objects)

Hello, After a period of inactivity because of a system (human) failure I installed from scratch the 11.3.4 MonetDB version on my OpenBSD 32bit 4.9 system, and the errors remain. I am attaching the merovingian.log. What other sort of information should I provide? I can access a lot of specific information about the kernel state with the aid of sysctl utility (if you find that by any chance relevant) and I could look into relevant source code files, to see what the sysctl calls are (only assuming that this is the problem, because of the changes that have been made for OpenBSD). Mike On Sat, May 7, 2011 at 9:34 PM, Fabian Groffen <Fabian.Groffen@cwi.nl> wrote:

Michael, in case you have a debug build (default with HG source, unless you configure explicitly with --disable-debug), coudl you please start mserver5 by hand in a debugger, e.g., gdb mserver5 break on function get_bin_path(), run, once it breaks in function get_bin_path() single-step through it, and report on which return it exits from function get_bin_path() ? Stefan On Thu, May 19, 2011 at 02:20:02PM +0300, Michael Sioutis wrote:
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |
participants (5)
-
Fabian Groffen
-
Michael Sioutis
-
Sjoerd Mullender
-
Stefan Manegold
-
Stefan.Manegold@cwi.nl