Skip to content

Latest commit

 

History

History
57 lines (55 loc) · 2 KB

AUTOCOMPLETE.org

File metadata and controls

57 lines (55 loc) · 2 KB

Enabling auto-completion for chameleon in spacemacs

Install clang compiler on the system

sudo aptitude install clang

Installing cc_args.py

We assume ~/bin/ is in the PATH environment variable

cd ~/bin/
wget https://raw.githubusercontent.com/Rip-Rip/clang_complete/master/bin/cc_args.py
chmod +x cc_args.py

Enabling c-c++ layer in spacemacs

Enable c-c++ spacemacs layer with clang support:

(setq-default dotspacemacs-configuration-layers
  '((c-c++ :variables c-c++-enable-clang-support t)))

Installing Chameleon

export CHAMELEON_DIR=/path/to/chameleon-src/
spack install -v chameleon~simu@src ^mkl

Loading modules

module purge
spack load chameleon ; spack load cmake ; spack load fxt ; spack load openmpi ; spack load hwloc ; spack load starpu

Building chameleon with cc_args.py

cd $CHAMELEON_DIR
mkdir spack-cc_args-build
cd spack-cc_args-build
CC='cc_args.py gcc' cmake ..
make

Gathering the clang_complete information to the src directory

We now gather, sort and unify the .clang_complete information we obtained from the build to the src directory:

find . | grep clang_complete | xargs cat | sort | uniq > ../clang_complete

Restart spacemacs (optional)

M-m q r: restart both emacs and the server, prompting to save any changed buffers

Check company state

M-m h d v: company-clang-arguments

Enjoy

Sources

Beautiful spacemacs tutorial on advanced c/c++ usage

https://www.youtube.com/watch?v=OjbkCEkboA8 (starting ~40’)

.clang_complete

https://github.com/Rip-Rip/clang_complete

cc_args.py

https://github.com/Rip-Rip/clang_complete/blob/master/bin/cc_args.py