qBittorrent project needs help on Windows front

Windows specific questions, problems.
Dayman

Re: qBittorrent project needs help on Windows front

Post by Dayman »

Is libtorrent 0.16.1 supported?
Tried building 64-bit qbt against it and failed.
I'd say a lot of problems come from libtorrent. Linking it is not possible against --layout=system boost builds. A lot of undocumented (for Windows) jam features like disk-stats=on fail completely.
Also libtorrent build cmd from qbt wiki:

Code: Select all

bjam -q --with-filesystem --with-thread --toolset=msvc variant=release link=static runtime-link=shared
From what i've seen libtorrent (maybe it's just 0.16.1?) fails to build w/o --with-date_time boost.
From libtorrent Jamfile:

Code: Select all

feature timer : auto boost absolute performance clock system_time
	: composite propagated link-incompatible ;
feature.compose <timer>boost : <define>TORRENT_USE_BOOST_DATE_TIME=1 ;
feature.compose <timer>absolute : <define>TORRENT_USE_ABSOLUTE_TIME=1 ;
feature.compose <timer>performance : <define>TORRENT_USE_PERFORMANCE_TIMER=1 ;
feature.compose <timer>clock : <define>TORRENT_USE_CLOCK_GETTIME=1 ;
feature.compose <timer>system_time : <define>TORRENT_USE_SYSTEM_TIME=1 ;
Anything except timer=boost|auto fails for me on windows.

Will try to build 2.9.9 again.

About 64-bit stuff.  There are some native x64 applications, e.g. 7zip, Opera, 3rd party firefox builds (PaleMoon), MPHC. And they all work fine.
64-bit comes with a bunch of registers, which compiler can use unlike i686.
Anyway, the biggest problem of Windows is that most of the stuff was written UNPORTABLE to a different arch/OS or uses i686 only obfuscators/protectors. Hence the lack of native 64-bit soft.


EDIT:
The error i'm getting: http://pastebin.com/ryvBeszS

Trying with DEFINES += BOOST_ASIO_SEPARATE_COMPILATION in winconf.pri

Getting this: http://pastebin.com/j0XeNkeN

Looks like the culprit is BOOST_NO_EXCEPTIONS in libtorrents torrent_handle.hpp. Will try to get around this.
Last edited by Dayman on Mon Jun 18, 2012 10:03 am, edited 1 time in total.
User avatar
Nemo
Administrator
Administrator
Posts: 1730
Joined: Sat Jul 24, 2010 6:24 pm

Re: qBittorrent project needs help on Windows front

Post by Nemo »

Thanks for your effort Dayman, is greatly appreciated. Hope you can find a way to build without problems. Im not into coding so can't help you out with that error, sorry.
newborn

Re: qBittorrent project needs help on Windows front

Post by newborn »

hi dayman...second that; your efforts are appreciated. Take your time man...most of use are quite happy with qbt 2.9.7. We can wait a little longer. If a new windows version ever comes out the only thing we would like is STABILITY. As far as i am concerned the last built is quite good for most use
User avatar
Nemo
Administrator
Administrator
Posts: 1730
Joined: Sat Jul 24, 2010 6:24 pm

Re: qBittorrent project needs help on Windows front

Post by Nemo »

Can't agree more newborn, well said. Im also using 2.9.7.
Dayman

Re: qBittorrent project needs help on Windows front

Post by Dayman »

Hello. I managed to compile qbt for AMD64. Nevertheless it dies on startup with unhandled exception here:
Image

Digging deeper.

I taced this to line 370 of filterparserthread.h

Code: Select all

libtorrent::ip_filter filter = s->get_ip_filter();
Dies somewhere in libtorrent code.

In libtorrent session.cpp

Code: Select all

ip_filter session::get_ip_filter() const
	{
                
		TORRENT_SYNC_CALL_RET(ip_filter, get_ip_filter); // Dies right here
		return r;
	}
TORRENT_SYNC_CALL_RET exapnds into

Code: Select all

#define TORRENT_SYNC_CALL_RET(type, x) \
	bool done = false; \
	type r; \
	m_impl->m_io_service.post(boost::bind(&fun_ret<type>, &r, &done, &m_impl->cond, &m_impl->mut, boost::function<type(void)>(boost::bind(&session_impl:: x, m_impl.get())))); \
	TORRENT_WAIT // Dies here
TORRENT_WAIT expands into

Code: Select all

mutex::scoped_lock l(m_impl->mut); \
	while (!done) { m_impl->cond.wait(l); }; // Dies here
Going deeper (libtorrent thread.cpp)

Code: Select all

void condition::wait(mutex::scoped_lock& l)
	{
		TORRENT_ASSERT(l.locked());
		++m_num_waiters;
		l.unlock();
		WaitForSingleObject(m_sem, INFINITE); // Dies here
		l.lock();
		--m_num_waiters;
	}
Not sure what to think about this, 'cause libtorrent's client_test works fine




Never mind the above. I finally managed to compile and run qbt: http://img694.imageshack.us/img694/335/30914885.png
Looks like some libtorrent buidtime features have caused this.
I was building with this cmd:

Code: Select all

bjam -j3 -q --toolset=msvc --prefix=%BUILDROOT%\libtorrent64d boost=system boost-link=static link=static runtime-link=shared variant=debug debug-symbols=on resolve-countries=on logging=none full-stats=on ipv6=off dht-support=on character-set=unicode geoip=static encryption=openssl windows-version=win7 threading=multi address-model=64 host-os=windows target-os=windows embed-manifest=on architecture=x86 warnings=off warnings-as-errors=off define="BOOST_FILESYSTEM_VERSION=2" "cflags=/MP /favor:AMD64" "linkflags=/NOLOGO /OPT:REF /OPT:ICF=5"
The following cmd works ok:

Code: Select all

bjam -j3 -q --toolset=msvc --prefix=%BUILDROOT%\libtorrent64d boost=system boost-link=static link=static runtime-link=shared variant=debug debug-symbols=on address-model=64 architecture=x86 warnings=off warnings-as-errors=off encryption=openssl geoip=static define="BOOST_FILESYSTEM_VERSION=2" "cflags=/MP /favor:AMD64" "linkflags=/NOLOGO /OPT:REF /OPT:ICF=5"
I'll be turning features on 1b1 to see what's causing the errors.
Like i said in my 1st post
A lot of undocumented (for Windows) jam features like disk-stats=on fail completely

Yup. ipv6=off was the culprit. 2.9.9 works ok on windows.
Last edited by Dayman on Sun Jun 24, 2012 4:53 pm, edited 1 time in total.
ironcross

Re: qBittorrent project needs help on Windows front

Post by ironcross »

Thanks a lot for your time and effort, Dayman.
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

christophe.dumez wrote:The documentation to help people build qBittorrent on Windows is there]
Unfortunately not (any longer?). But I found it on This new site.
If you cannot contribute code
I'd love to contribute. Just tell me what I have to do. And I'd love to maintain a Win64 version. I totally agree with the above commentators, that a 64 version is essential.
Last edited by bfelten on Thu Nov 22, 2012 6:29 pm, edited 1 time in total.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: qBittorrent project needs help on Windows front

Post by sledgehammer_999 »

bfelten wrote:
christophe.dumez wrote:The documentation to help people build qBittorrent on Windows is there]
Unfortunately not (any longer?). But I found it on This new site.
If you cannot contribute code
I'd love to contribute. Just tell me what I have to do. And I'd love to maintain a Win64 version. I totally agree with the above commentators, that a 64 version is essential.
I assume that you know how to code. If not disregard the following:
1. Learn the basics of using git(not mandatory, but helpful)
2a. Sign up in github and fork the official repo. Push your changes in your repo and then make Pull requests for them.
2b. Or you can download the source, make your changes and post the patches in the bug tracker.

2b is not really encouraged, unless you plan to make only 1-2 contributions and then leave.

Also the new wiki is here->http://wiki.qbittorrent.org/
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

Well, I followed the instructions on the wiki exactly, and ended up with 89,000 files in 6,823 folders (a total of 3.63GB). Are all those files really necessary?

Already the first step (the OpenSSL part) gave me trouble. I got warnings about 'enable_threads' not being an option. So I deleted the word 'threads' from the Perl command, and got no warnings. But I also didn't get a 'my_build' folder.

Well, I then copied the include files from the level above (75 files) instead, and then I managed to succeed with all the rest of the steps until the last part -- compiling qBittorrent.

I then got errors about missing hpp files in the libtorrent folder. In fact there was no libtorrent folder at all. So I copied it from rasterbar/include, and then it compiled away. Giving several hundreds of warning, but only one error:

Code: Select all

C:\qbt\qbittorrent-3.0.6\src\qtlibtorrent\qtorrenthandle.cpp:98: error: C2665: 'misc::toQString' : none of the 4 overloads could convert all the argument types
c:\qbt\qbittorrent-3.0.6\src\misc.h(61): could be 'QString misc::toQString(const std::string &)'
c:\qbt\qbittorrent-3.0.6\src\misc.h(65): or       'QString misc::toQString(const char *)'
c:\qbt\qbittorrent-3.0.6\src\misc.h(77): or       'QString misc::toQString(const libtorrent::sha1_hash &)'
c:\qbt\qbittorrent-3.0.6\src\misc.h(117): or       'QString misc::toQString(const boost::posix_time::ptime &)'
while trying to match the argument list '(time_t)'
After that I gave up...

My immediate question must be why it's necessary to take all those steps. Isn't it possible to make one big VS project of it all, and use the GUI?
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

[quote="loki"]
I did the whole install of MSVC, but I got lost on how to setup a build environment... and have never really built anything from source ever. (on windows especially)
Would it be easier to cross-compile, if that's the proper term, build windows binaries on linux? Wouldn't have to worry about setting an environment, or easier to set up an environment? Maybe I'm over complicating things...
[/quote]

I totally agree with you! I too just installed the massive GB MSVC and tried to follow the wiki, but to no avail.

I've been working as a professional programmer since the 1970s, and as you might expect ASM and PAS is my forte. I never really liked C that I still regard as a big joke (you know, UNIX, C and LSD all comes from Berkeley?)

What I do like is this project, and I'd really, really want to contribute to it, but I can't even get my Ubuntu Virtual Box to compile it. Little own my Windows box.

There simply must be a better way to make a Windows install version, than the (not working) variant on the wiki?
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: qBittorrent project needs help on Windows front

Post by sledgehammer_999 »

In the wiki (openssl part)  there is no "enable_threads" in the cmdline.

https://github.com/qbittorrent/qBittorr ... ng_OpenSSL

Have you followed the instructions on the above link?

EDIT: Of course you are welcome to contribute. So I will try to help you setup a working build environment.
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

[quote="sledgehammer_999"]
In the wiki (openssl part)  there is no "enable_threads" in the cmdline. [/quote]

I know, I guess it comes from one of the huge scripts. Fact of the matter is, that when I removed 'threads' from the command line the  error went away. But, as I said, the entire batch of commands didn't seem to do anything. Only changing two files in the crypto folder.

And yes, I followed every single step in that wiki. I even installed the Strawberry Perl. The one I had was newer,  but was the same build (perl5 -- revision 5 version 16 subversion 1).

When I tried 'nmake -f ms\ntdll.mak' it compiled away for a long time, and created the DLLs and LIBs and other stuff, but that's not what I want, is it?

Any help would be greatly appreciated. I'm using WinXP/SP3 if that matters...
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

Here's the full output from a run:

Code: Select all

C:\qbt\openssl-1.0.1c>perl Configure VC-WIN32 no-shared no-zlib-dynamic threads
--prefix=C:\qbt\openssl-1.0.1c\my_build
Configuring for VC-WIN32
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
    no-shared       [option]
    no-store        [experimental] OPENSSL_NO_STORE (skip dir)
    no-zlib         [default]
    no-zlib-dynamic [option]
IsMK1MF=1
CC            =cl
CFLAG         =-DOPENSSL_THREADS  -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL
_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE -DOPE
NSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_AS
M_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DV
PAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
EX_LIBS       =
CPUID_OBJ     =x86cpuid.o
BN_ASM        =bn-586.o co-586.o x86-mont.o x86-gf2m.o
DES_ENC       =des-586.o crypt586.o
AES_ENC       =aes-586.o vpaes-x86.o aesni-x86.o
BF_ENC        =bf-586.o
CAST_ENC      =cast-586.o
RC4_ENC       =rc4-586.o
RC5_ENC       =rc5-586.o
MD5_OBJ_ASM   =md5-586.o
SHA1_OBJ_ASM  =sha1-586.o sha256-586.o sha512-586.o
RMD160_OBJ_ASM=rmd-586.o
CMLL_ENC      =cmll-x86.o
MODES_OBJ     =ghash-x86.o
ENGINES_OBJ   =
PROCESSOR     =
RANLIB        =true
ARFLAGS       =
PERL          =perl
THIRTY_TWO_BIT mode
BN_LLONG mode
RC4_INDEX mode
RC4_CHUNK is undefined

Configured for VC-WIN32.

C:\qbt\openssl-1.0.1c>ms\do_nasm

C:\qbt\openssl-1.0.1c>perl util\mkfiles.pl  1>MINFO

C:\qbt\openssl-1.0.1c>perl util\mk1mf.pl nasm VC-WIN32  1>ms\nt.mak
unknown option - enable-threads

C:\qbt\openssl-1.0.1c>perl util\mk1mf.pl dll nasm VC-WIN32  1>ms\ntdll.mak
unknown option - enable-threads

C:\qbt\openssl-1.0.1c>perl util\mk1mf.pl nasm BC-NT  1>ms\bcb.mak
unknown option - enable-threads

C:\qbt\openssl-1.0.1c>perl util\mkdef.pl 32 libeay  1>ms\libeay32.def

C:\qbt\openssl-1.0.1c>perl util\mkdef.pl 32 ssleay  1>ms\ssleay32.def

C:\qbt\openssl-1.0.1c>nasm -v
NASM version 2.10.05 compiled on Sep  9 2012

C:\qbt\openssl-1.0.1c>
Last edited by bfelten on Sun Nov 25, 2012 9:44 pm, edited 1 time in total.
bfelten

Re: qBittorrent project needs help on Windows front

Post by bfelten »

How absolutely stupid of me. Disregard everything I've said about the OpenSSL instructions. They do work.

But don't try to add all four commands into a single batch file, after the second command (starting another batchfile) has ended, the entire process ends, and it'll never come to the two nmake commands.

Unfortunately that didn't help in the end. I still get 186 warnings and one error on the project in Qt.  :'(

UPDATE: I still get the enable-thread error from the 'ms\do_nasm' command though. Three times over, as can be seen in my snapshot above.
Last edited by bfelten on Sun Nov 25, 2012 11:08 pm, edited 1 time in total.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: qBittorrent project needs help on Windows front

Post by sledgehammer_999 »

I am a bit sleepy now. Expect a better answer tomorrow.

The "enable-thread error" doesn't seem like an error. It seems like a warning. You should proceed with the other commands after this. I will try to rebuild OpenSSL tommorow, with the wiki commands, and see what happens.
Post Reply