Linux HOWTOs

About | Home | Search


HOWTO: libatomic_ops
Description: Atomic memory update operations on a number of architectures
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# libatomic_ops 1.2
# =================
cd
test -f installed/libatomic_ops-1.2.tar.gz &&
 mv installed/libatomic_ops-1.2.tar.gz .
test ! -f libatomic_ops-1.2.tar.gz &&
 wget http://www.hpl.hp.com/research/linux/atomic_ops/download/\
libatomic_ops-1.2.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "libatomic_ops-*" -exec rm -r {} \;
tar xzvf ~/libatomic_ops-1.2.tar.gz
cd libatomic_ops-1.2
test $UID = 0 && chown -R root:root .
./configure
make

# Become root
su

# Remove old shared libraries, install it
( cd /usr/local/lib ; rm -f libatomic_ops.* libatomic_ops_gpl.* )
make install
ldconfig

# Make sure your non-root account can remove the source directory later
chown -R $USER .
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/libatomic_ops-*.tar.*
mv libatomic_ops-1.2.tar.gz installed/


# If you ever want to uninstall libatomic_ops, this should do it:
cd
su
test -d src/libatomic_ops-* && ( cd src/libatomic_ops-* ; make uninstall )
( cd /usr/local/include
  rm -f atomic_ops.h atomic_ops_stack.h atomic_ops_malloc.h )
/usr/local/include/atomic_ops/
( cd /usr/local/lib ; rm -f libatomic_ops.* libatomic_ops_gpl.* )
/usr/local/share/libatomic_ops/
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libatomic_ops-*" -exec rm -r {} \;
rm -f ~/installed/libatomic_ops-*.tar.*

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>