Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save pyed/197f6a9348212e92c211ad3d3cff710a to your computer and use it in GitHub Desktop.
Save pyed/197f6a9348212e92c211ad3d3cff710a to your computer and use it in GitHub Desktop.
Compiling rtorrent on a mac
#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl pkg-config xmlrpc-c
# Uninstall libtorrent-rasterbar if you already have it
brew uninstall libtorrent-rasterbar
# Get the repos
git clone https://github.com/rakshasa/rtorrent.git
git clone https://github.com/rakshasa/libtorrent.git
cd libtorrent
./autogen.sh
# Adds the openssl includes to your build command
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
CC=clang CXX=clang++ CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" ./configure
make
# Installs libtorrent to /usr/local/lib
make install
cd ../rtorrent
./autogen.sh
CC=clang CXX=clang++ CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" ./configure --with-xmlrpc-c
make
# Installs rtorrent to /usr/local/bin
make install
# Run rtorrent
rtorrent
@arafat5549
Copy link

evertything works perfect except xml-prctest

checking for XMLRPC-C... failed
configure: error: Could not compile XMLRPC-C test.
make: *** No targets specified and no makefile found. Stop.

I user macops High serar 10.13.3
use clang++
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0

who could possible worng here ?

@danchristal
Copy link

Worked fine on a fresh install of MacOS 10.13.4 only needing to change line 7 to

sudo chown -R $(whoami) $(brew --prefix)/*

@katiepea
Copy link

katiepea commented Jun 6, 2018

Thanks so much , I’m wondering and this is probably not the best place to ask but I can’t find documentation anywhere for this , I have a full rtorrent / rutorrent autodl seedbox running on 10.12. I’ve tried to migrate the web server over to 10.13 and Apache seems to be completely different and breaks completely completely. Are any of you running rutorrent with this on high Sierra ?

@c0llision
Copy link

Thanks. I got it working, but before I did CC=clang... on the rtorrent folder, I had to run

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Because my libtorrent was installed there.

@maliksjsu
Copy link

maliksjsu commented Jun 2, 2019

checking for XMLRPC-C... failed
for people who get ^ error
do 👍
./configure --disable-instrumentation
and make install

@mkllrtxn
Copy link

mkllrtxn commented Jul 18, 2019

Thanks for your guide, but when I try to "make" rtorrent I get the following error:

command_logging.cc:134:59: error: no member named 'log_close_output_str' in namespace 'torrent'; did you mean 'log_close_output'?
  CMD2_ANY_STRING_V("log.close",      std::bind(&torrent::log_close_output_str, std::placeholders::_2));
                                                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
                                                          log_close_output
./command_helpers.h:70:123: note: expanded from macro 'CMD2_ANY_STRING_V'
#define CMD2_ANY_STRING_V(key, slot) CMD2_A_FUNCTION(key, command_base_call_string<rpc::target_type>, object_convert_void(slot), "i:s", "")
                                                                                                                          ^~~~
./command_helpers.h:51:82: note: expanded from macro 'CMD2_A_FUNCTION'
  rpc::commands.insert_slot<rpc::command_base_is_type<rpc::function>::type>(key, slot, &rpc::function, \
                                                                                 ^~~~
/opt/local/include/torrent/utils/log.h:231:6: note: 'log_close_output' declared here
void log_close_output(const char* name) LIBTORRENT_EXPORT;
     ^
In file included from command_logging.cc:19:
./command_helpers.h:182:70: error: no matching function for call to object of type 'std::__1::__bind<void (*)(const char *), const std::__1::placeholders::__ph<2> &>'
  torrent::Object operator () (const Arg1& arg1, const Arg2& arg2) { m_slot(arg1, arg2); return torrent::Object(); }
                                                                     ^~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/type_traits:4339:23: note: in instantiation of function template specialization 'object_convert_type<std::__1::__bind<void
      (*)(const char *), const std::__1::placeholders::__ph<2> &>, void>::operator()<rpc::rt_triple<int, void *, void *>, std::__1::basic_string<char> >' requested here
_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))

Any clues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment