lists.netmrg.net lists.netmrg.net
NetMRG discussion and support
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

building on FreeBSD 4.8

 
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support
Author Message
Rojer
Beginner


Joined: 07 Aug 2003
Posts: 5
Location: msk.ru

PostPosted: Thu Aug 07, 2003 3:59 pm    Post subject: building on FreeBSD 4.8 Reply with quote

through all the missing headers i managed to build all the necessary objects (.o) in src, but final linking fails horribly ;)

first of all, we configure:
./configure --prefix=/usr/local/netmrg \
'LDFLAGS=-L/usr/local/lib -L/usr/local/lib/mysql' \
'CPPFLAGS=-I/usr/local/include/mysql -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/ucd-snmp -I/ftp/build/snmp/ucd-snmp-4.2.2/snmplib'

the we make....we proceed successfully up until linking.

g++ -g -O2 -L/usr/local/lib -L/usr/local/lib/mysql -L/usr/lib/mysql -L/usr/lib -L/usr/local/lib -o netmrg-gatherer db.o devices.o events.o locks.o mappings.o monitors.o netmrg.o rrd.o settings.o snmp.o utils.o -lsnmp -lcrypto -lxml2 -lmysqlclient -lstdc++ -lz -pthread

this one spits out 174 lines of complaints.
one example line of output:
db.o: In function `db_query(st_mysql *, DeviceInfo *, basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >)':
/ftp/build/netmrg-0.10pre1/src/db.cpp:190: undefined reference to `debuglogger(int, int, DeviceInfo const *, basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const &)'

there are also undefined references to

strtoint(basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >)

and

U_to_NULL(basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > &)


please notice that utils.cpp was successfully compiled and utils.o exists.
i suspect that it might be that i've got g++ v 2.95.4
however, building newer gcc is undesirable. or is it absolutely necessary in this case?
Back to top
Rojer
Beginner


Joined: 07 Aug 2003
Posts: 5
Location: msk.ru

PostPosted: Fri Aug 08, 2003 12:08 pm    Post subject: Reply with quote

marvin# nm -C utils.o | grep debuglogger
00000db0 T debuglogger(int, int, DeviceInfo const *, basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > const &)


note the <false, 0>
as i was able to find out, this boolean variable passed to allocator controls thread-safety. the question, however, is how to make g++ build utils.cpp with thread support?
Back to top
silfreed
Site Admin


Joined: 19 Jan 2003
Posts: 394
Location: Shippensburg, PA, USA

PostPosted: Fri Aug 08, 2003 2:39 pm    Post subject: Reply with quote

Rojer,

I just wanted to let you know that we are watching your thread and following along; the work you're doing on it is going to be a great help to us getting this working on FreeBSD.
We (Brady and I) have just gotten FreeBSD and Solaris installed on some development boxes so we can work on this more, so hopefully we can get to working on this more Real Soon (tm).
Thanks again for your hard work; we'll be sure to try to get this working as soon as possible. If you do end up to get it working, feel free to send a patch to either Brady or I.
Back to top
Rojer
Beginner


Joined: 07 Aug 2003
Posts: 5
Location: msk.ru

PostPosted: Fri Aug 08, 2003 2:53 pm    Post subject: Reply with quote

finally i've got it up and running ;))
yep, successful build DOES require new version of gcc.
no matter how hard i tried, i failed to get it up with 2.95.4
so i downloaded and compiled gcc 3.2.2 as follows:

./configure --prefix=/usr/local/gcc3 --enable-languages=c,c++,f77

excluded java to speed things up.
then make install'ed and here i got /usr/local/gcc3

2 symlinks need to be made:
/usr/lib/libstdc++.so.5 -> /usr/local/gcc3/lib/libstdc++.so.5
/usr/lib/libgcc_s.so.1 -> /usr/local/gcc3/lib/libgcc_s.so.1

libstdc++.so and libgcc_s.so need not to be redirected and still point to old libraries.

okay, so far so good.
there's one more point. for successful compile of libnetsnmp, -ldes needs to be added as it contains some des functions that netsnmp needs (beside -lcrypto).

the final configure command i issued that "made it" was as follows:

./configure --prefix=/usr/local/netmrg \
'LDFLAGS=-L/usr/local/gcc3/lib -L/usr/local/lib -L/usr/local/lib/mysql -ldes' \
'CPPFLAGS=-I/usr/local/gcc3/include -I/usr/local/include/mysql -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/ucd-snmp' \
'CC=/usr/local/gcc3/bin/gcc' \
'CXX=/usr/local/gcc3/bin/g++'

-L/usr/local/gcc3/lib should be the first in the list of library directories.

after that make goes like a charm as does make install ;))

right now i'm in the middle of editing httpd.conf to try to bring the thing up.
Back to top
balleman
Site Admin


Joined: 20 Jan 2003
Posts: 282

PostPosted: Tue Aug 26, 2003 12:13 am    Post subject: Thanks for the help! Reply with quote

Rojer,

I'd like to thank you for doing all the investigation necessary to make compilation possible on FreeBSD. I've just set up a FreeBSD system and achieved success with your steps.

The next version (pre2 likely) will have better configure detection for the FreeBSD paths, but the requirement of gcc 3.x likely won't be going away.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support All times are GMT
Page 1 of 1

 



smartBlue Style © 2002 Smartor
Powered by phpBB © 2001, 2002 phpBB Group