latik / xbt

Automatically exported from code.google.com/p/xbt
0 stars 0 forks source link

FreeBSD 9.0 x64 #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi!
Again, the problem with freebsd

used to work instruction:
**************************************************
If anyone of you got interest compiling xbt on FreeBSD.

1. Change all references of 'atoll' to 'atoi'. Files involved: 
./tracker_input.cpp, ../misc/xbt/data_ref.h, ../misc/bvalue.cpp
2. Add the following to the header of connection.cpp: 

#include <sys/uio.h>
#include <sys/types.h>
#include <sys/socket.h>

3. Add the following to the header of server.cpp:

#include <sys/types.h>
#include <sys/socket.h>

4. Since my target FreeBSD machine has only version 8.2 you might need to 
install a new version of gcc. I have installed gcc 4.8 from the ports 
(/usr/ports/lang/gcc48). Contents of my ./make.sh:

g++48 $@ -DNDEBUG -O3 -I ../misc -I . -o xbt_tracker -I /usr/local/include 
-std=c++0x \
        ../misc/bt_misc.cpp \
        ../misc/database.cpp \
        ../misc/sha1.cpp \
        ../misc/socket.cpp \
        ../misc/sql_query.cpp \
        ../misc/xcc_z.cpp \
        config.cpp \
        connection.cpp \
        epoll.cpp \
        server.cpp \
        tracker_input.cpp \
        transaction.cpp \
        "XBT Tracker.cpp" \
        `mysql_config --libs` -lz && strip xbt_tracker

The latest version of Boost library is also needed. You can install it from 
ports. However it was simply downloaded from boost.org and placed in 
/usr/local/include/boost in my case. 
**************************************************

but now gives an error

# ./make.sh
In file included from connection.cpp:5:0:
stdafx.h:3:0: warning: "FD_SETSIZE" redefined [enabled by default]
 #define FD_SETSIZE 1024
 ^
In file included from 
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd9.0/4.8.1/include-fixed/sys/types
.h:287:0,
                 from connection.cpp:2:
/usr/include/sys/select.h:59:0: note: this is the location of the previous 
definition
 #define FD_SETSIZE 1024U
 ^
In file included from server.cpp:4:0:
stdafx.h:3:0: warning: "FD_SETSIZE" redefined [enabled by default]
 #define FD_SETSIZE 1024
 ^
In file included from 
/usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd9.0/4.8.1/include-fixed/sys/types
.h:287:0,
                 from server.cpp:1:
/usr/include/sys/select.h:59:0: note: this is the location of the previous 
definition
 #define FD_SETSIZE 1024U
 ^

# uname -a
FreeBSD name.test 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Fri Nov  2 15:44:15 EET 
2012     user@name.test:/usr/obj/usr/src/sys/CS  amd64

Original issue reported on code.google.com by M.Sergi...@gmail.com on 9 Jun 2013 at 7:54

GoogleCodeExporter commented 8 years ago
That's a warning, not an error. It's safe to ignore.

Original comment by olafvdspek on 9 Jun 2013 at 9:24

GoogleCodeExporter commented 8 years ago
if error:
Start XBT Tracker
/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11 required by 
/usr/home/xbt/xbt_tracker not found1

do:
mcedit /etc/libmap.conf

insert:
libstdc++.so.6 gcc48/libstdc++.so.6

Original comment by M.Sergi...@gmail.com on 12 Jun 2013 at 12:05

GoogleCodeExporter commented 8 years ago
Can FBSD 10 compile XBTT as-is?

Original comment by olafvdspek on 26 Jan 2014 at 5:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Couldn't compile XBTT on FBSD 10 at all. Tried all available versions of 
compilers and stuff.

Had to build FBSD 8.4 on Jail with ezjail and compile inside - worked 
successfully with instructions above.

Original comment by duelis...@gmail.com on 6 Sep 2014 at 9:46

GoogleCodeExporter commented 8 years ago
Got a report on success with compiling latest source on FreeBSD 10-RELEASE.
Installed packages(which take part in compiling):
 boost-all-1.55.0
 cmake-3.0.2
 gcc48-4.8.4.s20141016
 lzlib-1.5
 mysql56-client-5.6.21
Actions were the following:
 1. Added to connection.cpp:
   #include <sys/uio.h>
   include <sys/socket.h>
 2. Added to server.cpp:
   #include <sys/socket.h>
 3. Changed the first line of make.sh to the following:
g++ $@ -DNDEBUG -I ../misc -I /usr/local/include -I . -O3 -o xbt_tracker 
-std=c++0x \

After that compiling went successfully(a sort of), got a stack of warnings:
###########################################
connection.cpp:29:36: warning: '&&' within '||' [-Wlogical-op-parentheses]
        return FD_ISSET(m_s, fd_read_set) && recv()
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:29:36: note: place parentheses around the '&&' expression to 
silence this warning
        return FD_ISSET(m_s, fd_read_set) && recv()
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:30:34: warning: '&&' within '||' [-Wlogical-op-parentheses]
                || FD_ISSET(m_s, fd_write_set) && send()
                ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:30:34: note: place parentheses around the '&&' expression to 
silence this warning
                || FD_ISSET(m_s, fd_write_set) && send()
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:32:19: warning: '&&' within '||' [-Wlogical-op-parentheses]
                || m_state == 5 && m_r.empty();
                ~~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~
connection.cpp:32:19: note: place parentheses around the '&&' expression to 
silence this warning
                || m_state == 5 && m_r.empty();
                                ^
                   (                          )
connection.cpp:271:58: warning: '&&' within '||' [-Wlogical-op-parentheses]
        if (events & (EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP) && recv()
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:271:58: note: place parentheses around the '&&' expression to 
silence this warning
        if (events & (EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP) && recv()
                                                                ^
            (                                                            )
connection.cpp:272:24: warning: '&&' within '||' [-Wlogical-op-parentheses]
                || events & EPOLLOUT && send()
                ~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~
connection.cpp:272:24: note: place parentheses around the '&&' expression to 
silence this warning
                || events & EPOLLOUT && send()
                                     ^
                   (                          )
connection.cpp:273:19: warning: '&&' within '||' [-Wlogical-op-parentheses]
                || m_state == 5 && m_write_b.empty())
                ~~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
connection.cpp:273:19: note: place parentheses around the '&&' expression to 
silence this warning
                || m_state == 5 && m_write_b.empty())
                                ^
                   (                                )
6 warnings generated.
###########################################

Tracker itself is working fine, except for setting options in 'xbt_config' sql 
table. However if you place them there manually - it reads them well.

Original comment by duelis...@gmail.com on 24 Oct 2014 at 7:23

GoogleCodeExporter commented 8 years ago
I've added <sys/socket.h> and <sys/uio.h>

Original comment by olafvdspek on 25 Oct 2014 at 2:26

GoogleCodeExporter commented 8 years ago
Compiling latest XBTT on FreeBSD 10.1-RELEASE.

1. Installed packages:
 clang35-3.5.1
 cmake-3.1.3
 gcc48-4.8.5.s20150212
 mysql56-client-5.6.23
 lzlib-1.5
 boost-libs-1.55.0_4 !!I HAD to compile Boost from ports, not to install with pkg, otherwise it couldn't be found by complier!!

2. Changed only the first line in 'make.sh':
c++ $@ -DNDEBUG -I ../misc -I /usr/local/include -I . -O3 -o xbt_tracker 
-std=c++0x \

3. Compiled with 6 warnings, working properly except for setting options by 
itself in mysql table.

(Every time I feel that I write this more for myself to find this ticket later 
to remember "how the hell did I complie it, again?!")

Original comment by duelis...@gmail.com on 3 Mar 2015 at 12:48

GoogleCodeExporter commented 8 years ago
> except for setting options by itself in mysql table.

What do you mean?

Original comment by olafvdspek on 3 Mar 2015 at 12:50

GoogleCodeExporter commented 8 years ago
>> except for setting options by itself in mysql table.

>What do you mean?

I mean same as before problem: application does not fill its options into 
'xbt_config' sql table automaitcally(except for "torrent_pass_private_key"). 
And they work if you add them manually.

Sorry for delayed answer, I didn't check this ticket for a while.

Original comment by duelis...@gmail.com on 12 Jun 2015 at 1:54