Other than having to install the required libraries and JWasm, I had no problems building v0.10 on a 32-bit Ubuntu 10.10 system. Running it on my 64-bit systems was a non-issue with ia32 libraries installed, but building on a 64-bit system took some tweaking.
Comparing the 32-bit Ufasoft bitcoin-miner to the jgarzik minerd using sse2_64, I'm seeing about 10% improvement. On the 32-bit system which did best using the cryptopp algorithm, switching to Ufasoft's miner produced about 30% greater Mh/s. Granted, this is still CPU mining, but the delta is interesting.
Obviously, you'd need the Linux
source for the
miner.
For a 32-bit Ubuntu 10.04 or later system (gcc 4.4 is default in 10.xx, 4.5 in 11.04), the required 32-bit C++ build libraries are:
sudo apt-get install libcurl4-gnutls-dev libpcre++0 libpcre++-dev gcc-4.5-base g++-4.5
If preferred in the above command, you can use either the OpenSSL (libcurl4-openssl-dev) or Mozilla NSS (libcurl4-nss-dev) version of libcurl instead of GnuTLS.
For
JWasm, I simply extracted the
binary to the build directory, made it executable and added the current working directory to the path:
chmod +x jwasm
PATH=$PATH:./; export PATH
If it isn't the default and you get a compiler version error, to avoid having to change the entire environment from gcc 4.4 to 4.5, rocksalt's method of specifying the compilers in the command with the CC= and CXX= definitions works best:
sudo CC=gcc-4.5 CXX=g++-4.5 ./configure && sudo make && sudo make install
With 64-bit systems, instead of creating a chroot environment to build 32-bit binaries, you can just add the necessary dev files and make a few tweaks. First, make sure the 32-bit sources are installed:
sudo apt-get install ia32-libs libc6-dev-i386 g++-multilib
This isn't pretty, but it works - in
configure, search for
JASMFLAGS and add "
JASMFLAGS=-elf" immediately after the section shown to make it appear as so:
if test x$build_cpu = xx86_64 ; then
JASMFLAGS="-DX64=1 -10 -elf64"
else
JASMFLAGS=-elf
fi
JASMFLAGS=-elf
Make sure the compiler is going to generate a 32-bit binary and run
configure:
CFLAGS=-m32 CXXFLAGS=-m32; export CFLAGS CXXFLAGS
./configure
The real
sticking point is the curl header file
curlbuild.h - it has a fixed defined value that will prevent a 32-bit compile. We can fix that for now by editing it.
WARNING! This isn't going to hose your system, but it might cause issues with further compiling efforts if you don't undo it after building the 32-bit miner.
sudo sed -i 's/SIZEOF_LONG 8/SIZEOF_LONG 4/g' /usr/include/curl/curlbuild.h
sudo sed -i 's/SIZEOF_CURL_OFF_T 8/SIZEOF_CURL_OFF_T 4/g' /usr/include/curl/curlbuild.h
In order to reverse this action, simply do the following:
sudo sed -i 's/SIZEOF_LONG 4/SIZEOF_LONG 8/g' /usr/include/curl/curlbuild.h
sudo sed -i 's/SIZEOF_CURL_OFF_T 4/SIZEOF_CURL_OFF_T 8/g' /usr/include/curl/curlbuild.h
If
curlbuild.h isn't there, you either don't have libcurl installed or it's somewhere else. Just search for the file and replace the relevant lines.
Now you can compile successfully.
make && sudo make install
Out of curiosity, I'd like to find out whether there'd be a statistically significant increase with a native 64-bit implementation. Too bad I haven't touched assembly in years...