123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- ;;; Directory Local Variables
- ;;; For more information see (info "(emacs) Directory Variables")
- ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
- (
- ;; Default variables for all directories and modes
- (nil
- .
- (
- ;; (eval ;https://emacs.stackexchange.com/a/35965
- ;; . (progn
- ;; (with-temp-buffer ;https://stackoverflow.com/a/16789182
- ;; (call-process "bash" nil t nil "-c"
- ;; "source /opt/moose/environments/moose_profile; env")
- ;; (goto-char (point-min))
- ;; (while (not (eobp))
- ;; (setq process-environment
- ;; (cons (buffer-substring (point) (line-end-position))
- ;; process-environment))
- ;; (forward-line 1)))
- ;; ;; (setenv "METHOD" "dbg")
- ;; ))
- ))
- ;; Default variables for C mode in all directories
- (c-mode
- .
- (( ; Use c-mode as c++
- mode ; https://stackoverflow.com/a/6912415
- .
- c++)
- (compile-command
- .
- (concat
- ;; Modify moose_profile manually to have
- ;; moose-dev-clang instaed of moose-dev-gcc
- ;; Check for OS name (if in Parabola or Arch)
- "cd .. && "
- "[[ $(python3 -c 'import platform; "
- "a = 1 if \"arch\" in platform.platform() else 0; "
- "print(a)') ]]" ; https://unix.stackexchange.com/a/195808
- " && source ./setmooseenv.sh"
- ;; (if not in Parabola or Arch)
- " || source /opt/moose/environments/moose_profile;"
- " make -j 4;"
- ;; ;; Compile with debugging symbols
- ;; "LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 METHOD=dbg make -j $MOOSE_JOBS -C ../"
- ))
- ))
- ;; Default variables for C++ mode in all directories
- (c++-mode
- .
- ((compile-command
- .
- (concat
- ;; Modify moose_profile manually to have
- ;; moose-dev-clang instaed of moose-dev-gcc
- ;; Check for OS name (if in Parabola or Arch)
- "cd .. && "
- "[[ $(python3 -c 'import platform; "
- "a = 1 if \"arch\" in platform.platform() else 0; "
- "print(a)') ]]" ; https://unix.stackexchange.com/a/195808
- " && source ./setmooseenv.sh"
- ;; (if not in Parabola or Arch)
- " || source /opt/moose/environments/moose_profile;"
- " make -j 4;"
- ))
- ))
- ;; Default variables for GetPot mode in all directories
- (getpot-mode
- .
- ((compile-command
- .
- (concat
- ;; Modify moose_profile manually to have
- ;; moose-dev-clang instaed of moose-dev-gcc
- ;; Check for OS name (if in Parabola or Arch)
- "[[ $(python3 -c 'import platform; "
- "a = 1 if \"arch\" in platform.platform() else 0; "
- "print(a)') ]]" ; https://unix.stackexchange.com/a/195808
- " && cd ../ && source ./setmooseenv.sh && cd -"
- ;; (if not in Parabola or Arch)
- " || source /opt/moose/environments/moose_profile;"
- ;; "mpirun -np $(lscpu | awk '/^CPU\\(s\\)/{print $2}')" ; set mpirun with max cpus
- ;; "mpirun -np $MOOSE_JOBS" ; set mpirun with MOOSE_JOBS
- " mpirun -np 4" ; set mpirun with suboptimal cpus
- " ../heron-opt -i " ;executable to use
- (if buffer-file-name
- (shell-quote-argument
- (buffer-file-name)))))))
- ;; Default variables for Gmsh mode in all directories
- (gmsh-mode
- .
- ((compile-command
- .
- (concat "gmsh -optimize_ho -format msh -3 -o "
- (if buffer-file-name
- (shell-quote-argument
- (file-name-sans-extension buffer-file-name)))
- ".msh "
- (if buffer-file-name
- (shell-quote-argument
- (buffer-file-name)))
- ))))
- )
|