Building 64-bit Binaries ------------------------ "-fPIC" should be added to the compiler flags. Additionally, libraries should be installed to lib64/, not lib/. For example, under autotools-based build systems: CFLAGS="-O2 -fPIC" \ CXXFLAGS="-O2 -fPIC" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib64 Is suitable in most cases when a package is being created. With cmake, compiler flags should be set automatically, and "cmake -DLIB_SUFFIX=64" should set the library path correctly. Building 32-bit Binaries ------------------------ All that is needed is adding "-m32" to the compiler flags. Quite a few build systems however insist on adding -m64, regardless of what you tell it. For this reason, a few scripts have been written to enforce 32-bit builds. To load them into your path (including wrappers around gcc): . /etc/profile.d/32dev.sh Additionally, if any binaries conflict with 64-bit versions, on Slamd64, they are installed into bin/32/, not bin/. For example, again with autotools: . /etc/profile.d/32dev.sh ./configure \ --prefix=/usr \ --bindir=/usr/bin/32