From 2f329e1b325a3d3ae2e8fad44119dbaf7b1a272c Mon Sep 17 00:00:00 2001 From: AGULLO Emmanuel <emmanuel.agullo@inria.fr> Date: Mon, 30 Jan 2017 23:43:25 +0100 Subject: [PATCH] Enabling auto-completion for chameleon in emacs (spacemacs) --- AUTOCOMPLETE.org | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 AUTOCOMPLETE.org diff --git a/AUTOCOMPLETE.org b/AUTOCOMPLETE.org new file mode 100644 index 000000000..83a79b549 --- /dev/null +++ b/AUTOCOMPLETE.org @@ -0,0 +1,49 @@ +* Enabling auto-completion for chameleon in spacemacs +** Install clang compiler on the system +#+begin_src sh :results output :exports both +sudo aptitude install clang +#+end_src +** Enabling c-c++ layer in spacemacs +Enable [[https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/c-c%2B%2B][c-c++ spacemacs layer]] with clang support: +#+begin_src emacs-lisp +(setq-default dotspacemacs-configuration-layers + '((c-c++ :variables c-c++-enable-clang-support t))) +#+end_src +** Installing Chameleon +#+begin_src sh :results output :exports both +export CHAMELEON_DIR=/path/to/chameleon-src/ +spack install -v chameleon~simu@src ^mkl +#+end_src +** Loading modules +#+begin_src sh :results output :exports both +module purge +spack load chameleon ; spack load cmake ; spack load fxt ; spack load openmpi ; spack load hwloc ; spack load starpu +#+end_src +** Building chameleon with cc_args.py +#+begin_src sh :results output :exports both +cd $CHAMELEON_DIR +mkdir spack-cc_args-build +cd spack-cc_args-build +CC='cc_args.py gcc' +#+end_src +** 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: +#+begin_src sh :results output :exports both +find . | grep clang_complete | xargs cat | sort | uniq > ../clang_complete +#+end_src +** 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 + + -- GitLab