Opened 13 years ago

Closed 3 years ago

#27289 closed defect (fixed)

libtorrent, libtorrent-devel fail to build on 10.5 and 10.4

Reported by: gorzarg@… Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: leopard tiger Cc: shadow.fst@…, macdork@…, bitmail@…
Port: libtorrent libtorrent-devel

Description (last modified by ryandesign (Ryan Carsten Schmidt))

  • OS: Mac OS 10.4.11
  • Xcode: version 2.5

I was trying to upgrade rtorrent-devel, which needs libtorrent-devel (among other things). It fails in the build stage with the error:

Error: Target org.macports.build returned: shell command failed (see log for details)

Log file is attached.

Attachments (2)

main.log (17.6 KB) - added by gorzarg@… 13 years ago.
Build error log file.
main.2.log (32.0 KB) - added by gorzarg@… 13 years ago.
Log file of build error that *includes* the patch.

Download all attachments as: .zip

Change History (22)

Changed 13 years ago by gorzarg@…

Attachment: main.log added

Build error log file.

comment:1 Changed 13 years ago by gorzarg@…

Cc: gorzarg@… added

Cc Me!

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: gorzarg@… removed
Owner: changed from macports-tickets@… to gardnermj@…
Summary: libtorrent-devel 0.12.7_0 Build Error: "shell command failed"libtorrent-devel: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be available

The revelant error from the log seems to be:

:info:build ../../../rak/allocators.h: In static member function 'static T* rak::cacheline_allocator<T>::alloc_size(size_t)':
:info:build ../../../rak/allocators.h:80: error: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be available
:info:build ../../../rak/allocators.h:80: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
:info:build ../../../rak/allocators.h: In static member function 'static T* rak::cacheline_allocator<T>::alloc_size(size_t) [with T = rak::priority_item*]':
:info:build ../../../rak/allocators.h:76:   instantiated from 'T* rak::cacheline_allocator<T>::allocate(size_t, const void*) [with T = rak::priority_item*]'
:info:build /usr/include/c++/4.0.0/bits/stl_vector.h:117:   instantiated from '_Tp* std::_Vector_base<_Tp, _Alloc>::_M_allocate(size_t) [with _Tp = rak::priority_item*, _Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build /usr/include/c++/4.0.0/bits/vector.tcc:275:   instantiated from 'void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = rak::priority_item*, _Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build /usr/include/c++/4.0.0/bits/stl_vector.h:610:   instantiated from 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = rak::priority_item*, _Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build ../../../rak/priority_queue.h:77:   instantiated from 'void rak::priority_queue<Value, Compare, Equal, Alloc>::push(const typename std::vector<Value, Alloc>::value_type&) [with Value = rak::priority_item*, Compare = rak::priority_compare, Equal = rak::priority_equal, Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build ../../../rak/priority_queue_default.h:116:   instantiated from here
:info:build ../../../rak/allocators.h:80: error: 'posix_memalign' was not declared in this scope

I see you are trying to install this on an Intel Mac running Tiger. I suppose Tiger does not contain the posix_memalign function. I know Snow Leopard does.

This Stack Overflow question suggests posix_memalign may not even be needed on the Mac (though Apple did add it to Mac OS X some time after Tiger, so it must serve some purpose...)

comment:3 Changed 13 years ago by gardnermj@…

Looks like this has been known upstream for a while: http://libtorrent.rakshasa.no/ticket/2086

Especially since this appears not to be an issue in the latest version of Mac OS X, I don't plan to implement a fix in this port. Your best bet if you can't upgrade would be to get upstream to integrate the patches from the above ticket, or else apply them manually.

comment:4 Changed 13 years ago by gorzarg@…

Cc: gorzarg@… added

Cc Me!

comment:5 in reply to:  3 Changed 13 years ago by gorzarg@…

Replying to gardnermj@…:

Looks like this has been known upstream for a while: http://libtorrent.rakshasa.no/ticket/2086

Especially since this appears not to be an issue in the latest version of Mac OS X, I don't plan to implement a fix in this port. Your best bet if you can't upgrade would be to get upstream to integrate the patches from the above ticket, or else apply them manually.

So I used the patch you suggested for libtorrent-devel, but it didn't work either. (Log file is attached.) The thing is, the patch was for a previous version of libtorrent, not the one that just came out at the end of October, 2010, so that might be the reason why it fails also...

Changed 13 years ago by gorzarg@…

Attachment: main.2.log added

Log file of build error that *includes* the patch.

comment:6 Changed 13 years ago by shadow.fst@…

Cc: shadow.fst@… added

Cc Me!

comment:7 Changed 13 years ago by shadow.fst@…

Can't build libtorrent-devel 0.12.7 under PPC Leopard (Darwin macmini 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh).

Quote from mail.log:

:info:configure checking for posix_memalign... no
<...>
:info:build ../../../rak/allocators.h: In static member function 'static T* rak::cacheline_allocator<T>::alloc_size(size_t)':
:info:build ../../../rak/allocators.h:80: error: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must 
be available
:info:build ../../../rak/allocators.h:80: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
:info:build ../../../rak/allocators.h: In static member function 'static T* rak::cacheline_allocator<T>::alloc_size(size_t) [with T = rak::priority_item*]':
:info:build ../../../rak/allocators.h:76:   instantiated from 'T* rak::cacheline_allocator<T>::allocate(size_t, const void*) [with T = rak::priority_item*]'
:info:build /usr/include/c++/4.0.0/bits/stl_vector.h:117:   instantiated from '_Tp* std::_Vector_base<_Tp, _Alloc>::_M_allocate(size_t) [with _Tp = rak::priority_item*, _A
lloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build /usr/include/c++/4.0.0/bits/vector.tcc:275:   instantiated from 'void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename _Alloc::poi
nter, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = rak::priority_item*, _Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build /usr/include/c++/4.0.0/bits/stl_vector.h:610:   instantiated from 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = rak::priority_item*, _Alloc
 = rak::cacheline_allocator<rak::priority_item*>]'
:info:build ../../../rak/priority_queue.h:77:   instantiated from 'void rak::priority_queue<Value, Compare, Equal, Alloc>::push(const typename std::vector<Value, Alloc>::v
alue_type&) [with Value = rak::priority_item*, Compare = rak::priority_compare, Equal = rak::priority_equal, Alloc = rak::cacheline_allocator<rak::priority_item*>]'
:info:build ../../../rak/priority_queue_default.h:116:   instantiated from here
:info:build ../../../rak/allocators.h:80: error: 'posix_memalign' was not declared in this scope
:info:build make[4]: *** [block.lo] Error 1
:info:build make[3]: *** [all-recursive] Error 1
:info:build make[2]: *** [all-recursive] Error 1
:info:build make[1]: *** [all-recursive] Error 1
:info:build make: *** [all] Error 2
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_libtorrent-devel/work/libtorrent-0.12.7"
 && /usr/bin/make all " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for libtorrent-devel): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:error:build Failed to install libtorrent-devel
:notice:build Log for libtorrent-devel is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_libtorrent-devel/main.log

comment:8 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: macdork@… added
Description: modified (diff)
Keywords: libtorrent-devel rtorrent-devel removed
Port: libtorrent added
Summary: libtorrent-devel: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be availablelibtorrent, libtorrent-devel: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be available

Has duplicate #30528.

comment:9 Changed 12 years ago by jmroot (Joshua Root)

Cc: gorzarg@… removed
Keywords: leopard tiger added
Summary: libtorrent, libtorrent-devel: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be availablelibtorrent, libtorrent-devel fail to build on 10.5 and 10.4

I fixed the posix_memalign issue in r85232, but it still fails to build on 10.5.

comment:10 Changed 12 years ago by jmroot (Joshua Root)

OK, turns out it was just telling me that I forgot to cast the return value, in inimitable C++ style. Fixed in r85233.

The other error about __sync_add_and_fetch appears to be because libtorrent requires gcc 4.2.

comment:11 Changed 12 years ago by jmroot (Joshua Root)

Using gcc-4.2 as of r85240, but there are still STL issues that cause the build to fail, probably because Leopard's libstdc++ and STL headers are derived from gcc 4.0.

comment:12 Changed 12 years ago by jmroot (Joshua Root)

Making the current libtorrent source compatible with the old STL would probably be a major undertaking, so the easiest way to fix this might be to add a libstdcxx port. Apple's sources are at http://opensource.apple.com/source/libstdcxx/.

comment:13 Changed 12 years ago by bitmail@…

Cc: bitmail@… added

Cc Me!

comment:14 in reply to:  12 Changed 12 years ago by adiosf6f@…

Replying to jmr@…:

Making the current libtorrent source compatible with the old STL would probably be a major undertaking, so the easiest way to fix this might be to add a libstdcxx port. Apple's sources are at http://opensource.apple.com/source/libstdcxx/.

confirmed.

  • GNU GCC 4.6.2
  • make posix_memalign() optional.
  • compile-able and works.

for PPC Homebrew user, there are patched formulas and gcc.rb on github.com

comment:15 Changed 9 years ago by jmroot (Joshua Root)

Owner: changed from gardnermj@… to macports-tickets@…

-> nomaintainer

comment:16 Changed 9 years ago by mf2k (Frank Schima)

Port: libtorrent, libtorrent-devellibtorrent libtorrent-devel

comment:17 Changed 7 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to stuartwesterman
Status: newassigned

comment:18 Changed 7 years ago by mf2k (Frank Schima)

Owner: stuartwesterman deleted

comment:19 Changed 5 years ago by kencu (Ken)

this is the only remaining libtorrent / rtorrent ticket at the moment. these ports now build as c++11. I'll see if there is any chance of getting them to built on 10.4 / 10.5 with gcc6 or gcc7.

comment:20 Changed 3 years ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: assignedclosed

In 1ec35c805f7340652db008403d94e8b1bf2dc391/macports-ports (master):

libtorrent: fix build on < 10.6

closes: #27289

Note: See TracTickets for help on using tickets.