Compiling fails

General support for problems installing or using Deluge
Post Reply
pdoes
New User
New User
Posts: 5
Joined: Mon Dec 08, 2008 2:33 pm

Compiling fails

Post by pdoes »

When I tried to compile version 1.0.6 on a fresh Ubuntu it fails on libtorrent compilation

./libtorrent/src/memdebug.cpp: In static member function 'static void* memdebug::my_malloc_hook(size_t, const void*)':
./libtorrent/src/memdebug.cpp:146: error: 'demangle' was not declared in this scope
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Compiling fails

Post by johnnyg »

were you following this: http://dev.deluge-torrent.org/wiki/Inst ... FromSource ? in particular make sure you have all the dependencies installed.
also, out of curiosity, why would you want to compile deluge for ubuntu when there are .deb ready available?
pdoes
New User
New User
Posts: 5
Joined: Mon Dec 08, 2008 2:33 pm

Re: Compiling fails

Post by pdoes »

All the dependencies are installed, I believe the problem lays in the libtorrent/include/libtorrent/assert.hpp file, it's included in the memdebug.cpp file

This file has changed since version 1.0.5, the new version starts like this:

Code: Select all

#ifndef TORRENT_ASSERT

#include "libtorrent/config.hpp"

#if !defined TORRENT_DEBUG
#define TORRENT_ASSERT(a) do {} while(false)
#else

#include <string>

#ifdef __GNUC__
std::string demangle(char const* name);
#endif
The if for the TORRENT_DEBUG has been added and If I haven't defined TORRENT_DEBUG the function demangle will never be declared resulting in the error message. In the previous version the declaration was always done. I don't want to compile with debugging code.

As to why I like to compile instead of using the deb file => :geek:
barjac
Member
Member
Posts: 16
Joined: Sun Sep 28, 2008 5:40 pm

Re: Compiling fails

Post by barjac »

It built fine here under Mandriva 2009.0 from the deluge-1.0.6.tar.gz
pdoes
New User
New User
Posts: 5
Joined: Mon Dec 08, 2008 2:33 pm

Re: Compiling fails

Post by pdoes »

barjac wrote:It built fine here under Mandriva 2009.0 from the deluge-1.0.6.tar.gz
Did you build on a machine already running deluge? Because if you did the libtorrent won't be rebuild.
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: Compiling fails

Post by andar »

Just delete the memdebug.cpp file in libtorrent/src

I have removed it from future versions because it's no longer used and it's only for debug builds anyways.
pdoes
New User
New User
Posts: 5
Joined: Mon Dec 08, 2008 2:33 pm

Re: Compiling fails

Post by pdoes »

OK I found the problem.

There's a bug in the setup.py:

Code: Select all

_sources = glob.glob("./libtorrent/src/*.cpp") + \
                        glob.glob("./libtorrent/src/*.c") + \
                        glob.glob("./libtorrent/src/kademlia/*.cpp") + \
                        glob.glob("./libtorrent/bindings/python/src/*.cpp")

# Remove some files from the source that aren't needed
_source_removals = ["mapped_storage.cpp", "memdebug.cpp"]

for source in _sources:
    for rem in _source_removals:
        if rem in source:
            _sources.remove(source)
The above code should remove the memdebug from the _sources list but it doesn't.

From : http://effbot.org/zone/python-list.htm
Note that the for-in statement maintains an internal index, which is incremented for each loop iteration. This means that if you modify the list you’re looping over, the indexes will get out of sync, and you may end up skipping over items, or process the same item multiple times.
if I change it in :

Code: Select all

_sources = glob.glob("./libtorrent/src/*.cpp") + \
                        glob.glob("./libtorrent/src/*.c") + \
                        glob.glob("./libtorrent/src/kademlia/*.cpp") + \
                        glob.glob("./libtorrent/bindings/python/src/*.cpp")

# Remove some files from the source that aren't needed
_source_removals = ['mapped_storage.cpp', 'memdebug.cpp']


for rem in _source_removals:
    for source in _sources:
        if rem in source:
           _sources.remove(source)
The memdebug.cpp file is removed from the _sources list and the memdebug.cpp isn't compiled.
Post Reply