Skip to content

Instantly share code, notes, and snippets.

@doctorpangloss
Last active February 8, 2021 13:22
Show Gist options
  • Save doctorpangloss/ecfbe70c61de9332698d4d4445848f81 to your computer and use it in GitHub Desktop.
Save doctorpangloss/ecfbe70c61de9332698d4d4445848f81 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
# 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
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
@doctorpangloss
Copy link
Author

doctorpangloss commented Jul 15, 2017

This works as of master on rtorrent & libtorrent

@pyed
Copy link

pyed commented Sep 28, 2017

Thank you. works on macOS High Sierra. I had to edit it a bit.

@jef
Copy link

jef commented Dec 1, 2018

line 25: make -j4 # if you want to speed it up

@jef
Copy link

jef commented Dec 7, 2018

also need to add the xmlrpc-c library if you don't have it. i.e. brew install xmlrpc-c

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