Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

OpenBSD build issues #388

Closed
CuleX opened this Issue Dec 19, 2012 · 2 comments

Comments

Projects
None yet
3 participants

CuleX commented Dec 19, 2012

System: OpenBSD 5.2 running virtualized as 64-bit host on VMware Workstation 9.0.1, building InspIRCd 2.0.10.

OpenBSD make chokes on the Makefile:

*************************************
*       BUILDING INSPIRCD           *
*                                   *
*   This will take a *long* time.   *
*     Why not read our wiki at      *
*     http://wiki.inspircd.org      *
*  while you wait for make to run?  *
*************************************
RUNCC='perl /home/ircd/inspircd-2.0.10/make/run-cc.pl g++' RUNLD='perl /home/ircd/inspircd-2.0.10/make/run-cc.pl g++' CXXFLAGS='-pipe -fPIC -DPIC -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall -O2 -Iinclude' LDLIBS='-pthread -lstdc++' PICLDFLAGS='-fPIC -shared -rdynamic ' VERBOSE='' SOCKETENGINE='socketengine_kqueue' CORELDFLAGS='-rdynamic -L. ' SOURCEPATH='/home/ircd/inspircd-2.0.10' BUILDPATH='/home/ircd/inspircd-2.0.10/build' PURE_STATIC='' SPLIT_CC='' perl make/calcdep.pl
cd /home/ircd/inspircd-2.0.10/build; RUNCC='perl /home/ircd/inspircd-2.0.10/make/run-cc.pl g++' RUNLD='perl /home/ircd/inspircd-2.0.10/make/run-cc.pl g++' CXXFLAGS='-pipe -fPIC -DPIC -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall -O2 -Iinclude' LDLIBS='-pthread -lstdc++' PICLDFLAGS='-fPIC -shared -rdynamic ' VERBOSE='' SOCKETENGINE='socketengine_kqueue' CORELDFLAGS='-rdynamic -L. ' SOURCEPATH='/home/ircd/inspircd-2.0.10' BUILDPATH='/home/ircd/inspircd-2.0.10/build' PURE_STATIC='' SPLIT_CC='' make -s -f real.mk all
Using $< in a non-suffix rule context is a GNUmake idiom (line 14 of /home/ircd/inspircd-2.0.10/build/real.mk)
*** Error code 2

Stop in /home/ircd/inspircd-2.0.10 (line 153 of BSDmakefile).

Using gmake to continue build. Build fails using kqueue (which was suggested to set to "yes" by the configure script):

BUILD:              socketengines/socketengine_kqueue.cpp
In file included from /usr/include/g++/iosfwd:45,
                 from /usr/include/g++/bits/stl_algobase.h:70,
                 from /usr/include/g++/algorithm:65,
                 from include/inspircd.h:52,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_kqueue.cpp:22:
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h: In function 'int std::__convert_from_v(int* const&, char*, int, const char*, ...)':
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h:81: warning: function might be possible candidate for 'printf' format attribute
/home/ircd/inspircd-2.0.10/src/socketengines/socketengine_kqueue.cpp: In constructor 'KQueueEngine::KQueueEngine()':
/home/ircd/inspircd-2.0.10/src/socketengines/socketengine_kqueue.cpp:66: error: 'KERN_MAXFILESPERPROC' was not declared in this scope
gmake[1]: *** [obj/socketengine_kqueue.o] Error 1
gmake: *** [target] Error 2

Reconfiguring not to use kqueue but poll, the build fails at socketengine_poll instead:

BUILD:              socketengines/socketengine_poll.cpp
An error occured when executing: g++ -o obj/socketengine_poll.o -pipe -fPIC -DPIC -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall -O2 -Iinclude -c /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_poll.cpp
/home/ircd/inspircd-2.0.10/src/socketengines/socketengine_poll.cpp:79:20: error: ulimit.h: No such file or directory
In file included from /usr/include/g++/iosfwd:45,
                 from /usr/include/g++/bits/stl_algobase.h:70,
                 from /usr/include/g++/algorithm:65,
                 from include/inspircd.h:52,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_poll.cpp:23:
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h: In function 'int std::__convert_from_v(int* const&, char*, int, const char*, ...)':
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h:81: warning: function might be possible candidate for 'printf' format attribute
/home/ircd/inspircd-2.0.10/src/socketengines/socketengine_poll.cpp: In constructor 'PollEngine::PollEngine()':
/home/ircd/inspircd-2.0.10/src/socketengines/socketengine_poll.cpp:88: error: 'ulimit' was not declared in this scope
gmake[1]: *** [obj/socketengine_poll.o] Error 1
gmake: *** [target] Error 2

Reconfiguring to use neither kqueue nor poll, the build fails at socketengine_select instead:

BUILD:              socketengines/socketengine_select.cpp
In file included from /usr/include/g++/iosfwd:45,
                 from /usr/include/g++/bits/stl_algobase.h:70,
                 from /usr/include/g++/bits/char_traits.h:46,
                 from /usr/include/g++/string:47,
                 from include/hashcomp.h:29,
                 from include/typedefs.h:56,
                 from include/threadengines/threadengine_pthread.h:25,
                 from include/inspircd_config.h:24,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_select.cpp:21:
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h: In function 'int std::__convert_from_v(int* const&, char*, int, const char*, ...)':
/usr/include/g++/amd64-unknown-openbsd5.2/bits/c++locale.h:81: warning: function might be possible candidate for 'printf' format attribute
In file included from include/threadengines/threadengine_pthread.h:25,
                 from include/inspircd_config.h:24,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_select.cpp:21:
include/typedefs.h: At global scope:
include/typedefs.h:69: error: expected initializer before '<' token
In file included from include/inspircd.h:82,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_select.cpp:23:
include/users.h:752: error: 'LocalUserList' has not been declared
include/users.h:752: error: ISO C++ forbids declaration of 'iterator' with no type
include/users.h:752: error: expected ';' before 'localuseriter'
In file included from include/inspircd.h:87,
                 from /home/ircd/inspircd-2.0.10/src/socketengines/socketengine_select.cpp:23:
include/usermanager.h:57: error: 'LocalUserList' does not name a type
gmake[1]: *** [obj/socketengine_select.o] Error 1
gmake: *** [target] Error 2

Unable to build.

BSDmakefile spouted out by configure (kqueue and poll disabled): https://gist.github.com/4339833

Contributor

ChrisTX commented Dec 19, 2012

I doubt that Kqueue was tested on anything but FreeBSD - at least the code is mentioning FreeBSD specifically.

For poll:
In the file "src/socketengines/socketengine_poll.cpp" remove the line 79:

#include <ulimits.h>

and replace the two FreeBSD macros with OpenBSD

For select:
Edit "include/base.h", add somewhere at the beginning between the includes

#include <list>

For kqueue it might work if you replace KERN_MAXFILESPERPROC with KERN_MAXFILES.

@attilamolnar it seems that the list header isn't necessarily included for typedefs.h, also I don't think set is. Imho both should be added to base.h to ensure that including typedefs.h without any other header will build.

Furthermore, it seems strange that the poll engine requires ulimits.h but then doesn't actually use ulimits.h but uses sysctl() on FreeBSD. I can't exactly figure what sense that makes.

Owner

attilamolnar commented Dec 25, 2012

fixed by @SaberUK, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment