Search code examples
linuxllvmuninstallationllvm-clanglibc++

How to uninstall libc++ after installing from source?


I installed libc++ from source using following script. The make uninstall is not supported. What would be the best way to uninstall it?

git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source
git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx
git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi

export C_COMPILER=clang
export COMPILER=clang++

# Build and install libc++ 
mkdir llvm-build && cd llvm-build
cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \
      ../llvm-source
make cxx
sudo make install-cxxabi install-cxx

Solution

  • Well, after lot of searching, it is clear that there is no automatic or even semi-automatic way to uninstall when make unintsall is not implemented. There are two ways to get around this:

    1. If using cmake then run the install again but set the flag like -DCMAKE_INSTALL_PREFIX=./output. This will cause cmake to put all files in ./output. Now you can observe the files, and manually delete them. I think by default cmake would put these files at /usr/local.

    2. Another cool trick you can use if install_manifest.txt file is generated: cat install_manifest.txt | xargs echo sudo rm | sh.