Merge remote-tracking branch 'origin/bgschaid/minorAdditions' into nextRelease

This commit is contained in:
Hrvoje Jasak 2013-11-08 16:44:54 +00:00
commit bd40dc3d91
30 changed files with 4270 additions and 11 deletions

View file

@ -32,9 +32,34 @@
#
#------------------------------------------------------------------------------
unset WM_PROJECT_VERSION_ADDITION
prefSettingFile=$0.preset
if [ -f $prefSettingFile ]
then
# echo "Found presettings $prefSettingFile"
. $prefSettingFile
fi
unset prefSettingFile
export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=1.6-ext
if [ -z "$WM_PROJECT_VERSION_ADDITION" ]
then
thisScript="${BASH_SOURCE[0]}"
if [ ! -n "$thisScript" ]
then
# this is vor bash version < 4 and zsh
thisScript=$0
fi
export WM_PROJECT_VERSION_ADDITION=`python -c "from os.path import *;print abspath(join(curdir,'$thisScript')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"`
unset thisScript
fi
if [ -n "$WM_PROJECT_VERSION_ADDITION" ]
then
export WM_PROJECT_VERSION=$WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
fi
# helps to easily write #ifdefs to detect a dev-version
export FOAM_DEV=1
@ -285,39 +310,67 @@ Darwin)
case $WM_COMPILER in
Gcc42)
export WM_MACPORT_VERSION=4.2
export WM_BASE_COMPILER=Gcc
;;
Gcc43)
export WM_MACPORT_VERSION=4.3
export WM_BASE_COMPILER=Gcc
;;
Gcc44)
export WM_MACPORT_VERSION=4.4
export WM_BASE_COMPILER=Gcc
;;
Gcc45)
export WM_MACPORT_VERSION=4.5
export WM_BASE_COMPILER=Gcc
;;
Gcc46)
export WM_MACPORT_VERSION=4.6
export WM_BASE_COMPILER=Gcc
;;
Gcc47)
export WM_MACPORT_VERSION=4.7
export WM_BASE_COMPILER=Gcc
;;
Gcc48)
export WM_MACPORT_VERSION=4.8
export WM_BASE_COMPILER=Gcc
;;
Clang32)
export WM_BASE_COMPILER=Clang
export WM_MACPORT_VERSION=3.2
;;
Clang33)
export WM_BASE_COMPILER=Clang
export WM_MACPORT_VERSION=3.3
;;
Clang34)
export WM_BASE_COMPILER=Clang
export WM_MACPORT_VERSION=3.4
;;
Gcc)
;;
*)
echo "Unsupported MacPorts-Compiler $WM_COMPILER"
;;
esac
if [ "$WM_COMPILER" != "Gcc" ]
if [ "$WM_MACPORT_VERSION" != "" ]
then
export WM_CC="gcc-mp-$WM_MACPORT_VERSION"
export WM_CXX="g++-mp-$WM_MACPORT_VERSION"
export WM_FC="gfortran-mp-$WM_MACPORT_VERSION"
if [ "$WM_BASE_COMPILER" == "Gcc" ]
then
export WM_CC="gcc-mp-$WM_MACPORT_VERSION"
export WM_CXX="g++-mp-$WM_MACPORT_VERSION"
export WM_FC="gfortran-mp-$WM_MACPORT_VERSION"
else
export WM_CC="clang-mp-$WM_MACPORT_VERSION"
export WM_CXX="clang++-mp-$WM_MACPORT_VERSION"
ruleDirBase=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH
ruleDir=$ruleDirBase$WM_COMPILER
# hardcoded. Needed for ThirdParty
export WM_FC="gfortran-mp-4.5"
fi
ruleDirBase=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_BASE_COMPILER
ruleDir=$WM_PROJECT_DIR/wmake/rules/$WM_ARCH$WM_COMPILER
if [ ! -e $ruleDir ]
then
echo "Rule directory $ruleDir not existing. Linking to $ruleDirBase"

View file

@ -31,9 +31,43 @@
#
#------------------------------------------------------------------------------
# make sure that this variable is set un purpose
unset WM_PROJECT_VERSION_ADDITION
unsetenv WM_PROJECT_VERSION_ADDITION
set called=($_)
if ( $#called > 1 ) then
# tcsh - csh doesn't know about the location
set thisScript=$called[2]
set prefSettingFile=$thisScript.preset
if ( -r $prefSettingFile ) then
# echo "Found presettings $prefSettingFile"
source $prefSettingFile
endif
else
echo "csh or tcsh called from .cshrc - WM_PROJECT_VERSION_ADDITION not supported"
endif
setenv WM_PROJECT OpenFOAM
setenv WM_PROJECT_VERSION 1.6-ext
if ( $#called > 1 ) then
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
setenv WM_PROJECT_VERSION_ADDITION `python -c "from os.path import *;print abspath(join(curdir,'$thisScript')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"`
if ( "$WM_PROJECT_VERSION_ADDITION" == "" ) then
unsetenv WM_PROJECT_VERSION_ADDITION
endif
endif
unset prefSettingFile thisScript
endif
unset called
if ( $?WM_PROJECT_VERSION_ADDITION ) then
setenv WM_PROJECT_VERSION $WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION
endif
# helps to easily write #ifdefs to detect a dev-version
setenv FOAM_DEV 1
@ -77,7 +111,14 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_DIR/ThirdParty
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
if ( $status == 0 ) then
if ( "$foamPrefs" != "" ) then
_foamSource $foamPrefs
endif
endif
unset foamPrefs
# Evaluate command-line parameters
while ( $#argv > 0 )

View file

@ -45,6 +45,12 @@ License
# include <sigfpe.h>
#elif defined(__APPLE__)
// # include <fenv.h>
#include <xmmintrin.h>
#include <mach/mach.h>
#endif
@ -102,10 +108,40 @@ void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller)
return result;
}
#elif defined(__APPLE__)
void *(*Foam::sigFpe::system_malloc_)(malloc_zone_t *zone, size_t size)=NULL;
void* Foam::sigFpe::nan_malloc_(malloc_zone_t *zone, size_t size)
{
void *result=system_malloc_(zone,size);
// initialize to signalling NaN
# ifdef WM_SP
const uint32_t sNAN = 0x7ff7fffflu;
uint32_t* dPtr = reinterpret_cast<uint32_t*>(result);
# else
const uint64_t sNAN = 0x7ff7ffffffffffffllu;
uint64_t* dPtr = reinterpret_cast<uint64_t*>(result);
# endif
const size_t nScalars = size/sizeof(scalar);
for (size_t i = 0; i < nScalars; ++i)
{
*dPtr++ = sNAN;
}
return result;
}
#endif
#ifdef LINUX_GNUC
#if defined(LINUX_GNUC) || defined(__APPLE__)
void Foam::sigFpe::sigFpeHandler(int)
{
@ -170,6 +206,44 @@ Foam::sigFpe::~sigFpe()
__malloc_hook = old_malloc_hook;
}
# elif defined(__APPLE__)
if(system_malloc_!=NULL) {
malloc_zone_t *zone = malloc_default_zone();
if(zone==NULL) {
FatalErrorIn("Foam__sigFpe::set")
<< "Could not get malloc_default_zone()." << endl
<< "Seems like this version of Mac OS X doesn't support FOAM_SETNAN"
<< endl
<< exit(FatalError);
}
if(zone->version>=8)
{
vm_protect(
mach_task_self(),
(uintptr_t)zone,
sizeof(malloc_zone_t),
0,
VM_PROT_READ | VM_PROT_WRITE
);//remove the write protection
}
zone->malloc=system_malloc_;
system_malloc_=NULL;
if(zone->version==8)
{
vm_protect(
mach_task_self(),
(uintptr_t)zone,
sizeof(malloc_zone_t),
0,
VM_PROT_READ
);//put the write protection back
}
}
# endif
}
}
@ -240,6 +314,26 @@ void Foam::sigFpe::set(const bool verbose)
NULL
);
# elif defined(__APPLE__)
struct sigaction newAction;
newAction.sa_handler = sigFpeHandler;
newAction.sa_flags = SA_NODEFER;
sigemptyset(&newAction.sa_mask);
if (sigaction(SIGFPE, &newAction, &oldAction_) < 0)
{
FatalErrorIn
(
"Foam::sigFpe::set()"
) << "Cannot set SIGFPE trapping"
<< abort(FatalError);
}
_MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~_MM_MASK_INVALID);
_MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~_MM_MASK_DIV_ZERO);
_mm_setcsr( _MM_MASK_MASK &~
(_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) );
# endif
}
@ -257,6 +351,48 @@ void Foam::sigFpe::set(const bool verbose)
// Set our malloc
__malloc_hook = Foam::sigFpe::my_malloc_hook;
#elif defined(__APPLE__)
if(system_malloc_!=NULL) {
FatalErrorIn("Foam__sigFpe::set")
<< "system_malloc_ already reset." << endl
<< "This should never happen"
<< endl
<< exit(FatalError);
}
malloc_zone_t *zone = malloc_default_zone();
if(zone==NULL) {
FatalErrorIn("Foam__sigFpe::set")
<< "Could not get malloc_default_zone()." << endl
<< "Seems like this version of Mac OS X doesn't support FOAM_SETNAN"
<< endl
<< exit(FatalError);
}
// According to http://bkdc.ubiquity.ro/2011/07/how-to-set-malloc-hooks-in-osx-lion-107.html
if(zone->version>=8)
{
vm_protect(
mach_task_self(),
(uintptr_t)zone,
sizeof(malloc_zone_t),
0,
VM_PROT_READ | VM_PROT_WRITE
);//remove the write protection
}
system_malloc_=zone->malloc;
zone->malloc=Foam::sigFpe::nan_malloc_;
if(zone->version==8)
{
vm_protect(
mach_task_self(),
(uintptr_t)zone,
sizeof(malloc_zone_t),
0,
VM_PROT_READ
);//put the write protection back
}
# endif
}
}

View file

@ -55,6 +55,15 @@ SourceFiles
# define LINUX_GNUC
#endif
#ifdef __APPLE__
#include <malloc/malloc.h>
// these are defined by the mach-headers and would break compilation of Switch.H
#undef TRUE
#undef FALSE
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -79,12 +88,20 @@ class sigFpe
//- nan malloc function. From malloc_hook manpage.
static void* my_malloc_hook(size_t size, const void *caller);
#elif defined (__APPLE__)
//- pointer to the original malloc that is overrided
static void *(*system_malloc_)(malloc_zone_t *zone, size_t size);
//- the overriding handler
static void* nan_malloc_(malloc_zone_t *zone, size_t size);
# endif
// Static data members
# ifdef LINUX_GNUC
# if defined(LINUX_GNUC) || defined(__APPLE__)
//- Handler for caught signals
static void sigFpeHandler(int);

34
vagrantSandbox/README Normal file
View file

@ -0,0 +1,34 @@
# -*- mode: org -*-
#+TITLE: Virtual machines for testing and Packaging
* Prerequisites
These virtual machines require
- VirtualBox :: for running from [[https://www.virtualbox.org]]
- Vagrant :: to automatically set them up from [[http://www.vagrantup.com]]
* Starting
A virtual machine is set up with
: vagrant up <machineName>
will download a virtual machine image and set it up. It will then
modify the image:
- add packages required to compile OpenFOAM and package it
- mount the directory of the sources
- from this directory clone it to the local disc with mercurial or
git (whatever the parent uses)
One can then connect to the virtual machine with
: vagrant ssh <machinName>
and will be in the =$HOME= directory of the user =vagrant= where in
the directory =~/OpenFOAM/OpenFOAM-1.6-ext= the sources are
available. Modifications can be pushed "outside" the virtual machine
with
: hg push
There is also a symbolic link =~/OpenFOAM/OpenFOAM-1.6-ext-parent=
to the sources if you want to edit there directly. Use with care
and don't compile in that directory unless you know what you're
doing
* Virtual machines
Currently existing virtual machines are
- precise :: Latest LTS Ubuntu.
- lucid :: Previous LTS Ubuntu. Currently problems
with automatic setting up (something with the
=postfix=-package)
- maverick :: Tries to fix the problems with the
=lucid=-machine. Not yet working

42
vagrantSandbox/Vagrantfile vendored Normal file
View file

@ -0,0 +1,42 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.synced_folder "..", "/OpenFOAM-sources"
config.vm.provider :virtualbox do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.define :lucid do |lucid|
lucid.vm.box = "lucid64"
lucid.vm.box_url = "http://files.vagrantup.com/lucid64.box"
lucid.vm.provision :shell do |s|
s.args = "lucid"
s.path = "initUbunutuScript.sh"
end
end
config.vm.define :maverick do |maverick|
maverick.vm.box = "maverick64"
maverick.vm.box_url = "http://mathie-vagrant-boxes.s3.amazonaws.com/maverick64.box"
maverick.vm.provision :shell do |s|
s.args = "lucid"
s.path = "initUbunutuScript.sh"
end
end
config.vm.define :precise do |precise|
precise.vm.box = "precise64"
precise.vm.box_url = "http://files.vagrantup.com/precise64.box"
precise.vm.provision :shell do |s|
s.args = "precise"
s.path = "initUbunutuScript.sh"
end
end
end

View file

@ -0,0 +1,77 @@
#! /bin/bash
echo
echo "Copying stuff from skeleton"
echo
for f in $(ls -A /vagrant/skel)
do
target="/home/vagrant/$f"
if [ -e $target ]
then
echo "$target already there"
else
echo "Copying $target from skeleton"
cp -r "/vagrant/skel/$f" $target
fi
done
OFDIR=/home/vagrant/OpenFOAM/
mkdir -vp $OFDIR
chown -R vagrant:vagrant $OFDIR
OFClone=$OFDIR/OpenFOAM-1.6-ext
OFReference=$OFDIR/OpenFOAM-1.6-ext-parent
OFParent=/OpenFOAM-sources
if [ ! -e $OFClone ]
then
echo
echo "Cloning the OF-sources"
echo
if [ -e "$OFParent/.git" ]
then
echo
echo "Parent is git"
echo
su vagrant - -c "git clone $OFParent $OFClone"
echo
echo "Git cloned: TODO: set same branch as parent"
echo
elif [ -e "$OFParent/.hg" ]
then
echo
echo "Parent is mercurial. Hello Bernhard"
echo
branchName=`hg branch -R $OFParent`
echo "Parent is on branch $branchName"
su vagrant - -c "hg clone -u $branchName $OFParent $OFClone"
echo
else
echo
echo "Problem. Parent $OFParent is neither git nor mercurial"
echo
fi
else
echo "Repository $OFClone already there. No cloning"
fi
if [ ! -e $OFReference ]
then
echo
echo "Linking $OFReference to $OFParent"
echo
ln -s $OFParent $OFReference
else
echo
echo "Link $OFReference already there"
echo
fi
chown -R vagrant:vagrant $OFDIR
echo
echo "Current ccache:"
export CCACHE_DIR=/vagrant/ccache4vm; ccache --show-stats

View file

@ -0,0 +1,76 @@
#! /bin/bash
boxName=$1
echo
echo "Init script for $boxName"
echo
if [ "$boxName" == "lucid" ]
then
echo
echo "Additional Python-Repository"
echo
# needed for add-appt-repository
apt-get -y install python-software-properties
add-apt-repository ppa:mercurial-ppa/releases
fi
apt-get update -y
echo
echo "Installing additional packages"
echo
apt-get -y install mercurial
apt-get -y install bison
apt-get -y install flex
apt-get -y install g++
apt-get -y install make
#apt-get -y install python-dev
apt-get -y install ccache
# test scripts with different shells
apt-get -y install csh
apt-get -y install tcsh
apt-get -y install zsh
# to make the ThirdParty-Stuff work
apt-get -y install rpm
# this is needed for the packaging stuff
echo
echo "Setting for postfix"
echo
# Make sure that default-mta installs
debconf-set-selections <<< "postfix postfix/mailname string vagrant.test.machine.com"
debconf-set-selections <<< "postfix postfix/myhostname string vagrant.test.machine.com"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
debconf-set-selections <<< "postfix postfix/destinations string localhost"
# this workaround doesn't work for lucid
export DEBIAN_FRONTEND=noninteractive
echo
echo "Tools for packaging"
echo
# Needed for packaging
apt-get -y install default-mta
apt-get -y install dpkg-dev
apt-get -y install debhelper devscripts cdbs
# Not needed. Just to keep Bernhard happy
apt-get -y install emacs
echo
echo "Ubuntu-specific ended. Now doing general stuff"
echo
/vagrant/initGeneralScript.sh
echo
echo "Ended"

View file

@ -0,0 +1,2 @@
export WM_SCHEDULER=ccache
export CCACHE_DIR=/vagrant/ccache4vm

35
vagrantSandbox/skel/.hgrc Normal file
View file

@ -0,0 +1,35 @@
[ui]
merge = emacs
editor = emacs
[extensions]
color =
fetch =
graphlog =
hgk =
keyword =
pager =
transplant =
purge =
rebase =
bookmarks =
extdiff =
interhg =
highlight =
progress =
[diff]
git=1
nodates=1
[pager]
pager = LESS='FSRX' less
attend = help,annotate, cat, diff, export, glog, log, qdiff, incoming, outgoing,interdiff,slog,rlog
[merge-tools]
emacs.args = -q --eval "(require 'ediff)" --eval "(setq ediff-window-setup-function 'ediff-setup-windows-plain)" --eval "(add-hook 'ediff-quit-hook 'save-buffers-kill-emacs)" --eval "(ediff-merge-with-ancestor \""$local"\" \""$other"\" \""$base"\" nil \""$output"\")"
[alias]
slog = log --template '{rev}:{node|short} {date|age} {author|email}: {desc|firstline}\n'
rlog = log -r : --template '{rev}:{node|short} {date|shortdate} {author|user}: Statistics: {diffstat}\n{desc}\n\n'

3319
vagrantSandbox/skel/.zshrc Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,343 @@
# Filename: /etc/skel/.zshrc
# Purpose: config file for zsh (z shell)
# Authors: (c) grml-team (grml.org)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
################################################################################
# Nowadays, grml's zsh setup lives in only *one* zshrc file.
# That is the global one: /etc/zsh/zshrc (from grml-etc-core).
# It is best to leave *this* file untouched and do personal changes to
# your zsh setup via ${HOME}/.zshrc.local which is loaded at the end of
# the global zshrc.
#
# That way, we enable people on other operating systems to use our
# setup, too, just by copying our global zshrc to their ${HOME}/.zshrc.
# Adjustments would still go to the .zshrc.local file.
################################################################################
## Inform users about upgrade path for grml's old zshrc layout, assuming that:
## /etc/skel/.zshrc was installed as ~/.zshrc,
## /etc/zsh/zshrc was installed as ~/.zshrc.global and
## ~/.zshrc.local does not exist yet.
if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then
printf '-!-\n'
printf '-!- Looks like you are using the old zshrc layout of grml.\n'
printf '-!- Please read the notes in the grml-zsh-refcard, being'
printf '-!- available at: http://grml.org/zsh/\n'
printf '-!-\n'
printf '-!- If you just want to get rid of this warning message execute:\n'
printf '-!- touch ~/.zshrc.local\n'
printf '-!-\n'
fi
## Settings for umask
#if (( EUID == 0 )); then
# umask 002
#else
# umask 022
#fi
## Now, we'll give a few examples of what you might want to use in your
## .zshrc.local file (just copy'n'paste and uncomment it there):
## Prompt theme extension ##
# Virtualenv support
#function virtual_env_prompt () {
# REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) }
#}
#grml_theme_add_token virtual-env -f virtual_env_prompt '%F{magenta}' '%f'
#zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent
## ZLE tweaks ##
## use the vi navigation keys (hjkl) besides cursor keys in menu completion
#bindkey -M menuselect 'h' vi-backward-char # left
#bindkey -M menuselect 'k' vi-up-line-or-history # up
#bindkey -M menuselect 'l' vi-forward-char # right
#bindkey -M menuselect 'j' vi-down-line-or-history # bottom
## set command prediction from history, see 'man 1 zshcontrib'
#is4 && zrcautoload predict-on && \
#zle -N predict-on && \
#zle -N predict-off && \
#bindkey "^X^Z" predict-on && \
#bindkey "^Z" predict-off
## press ctrl-q to quote line:
#mquote () {
# zle beginning-of-line
# zle forward-word
# # RBUFFER="'$RBUFFER'"
# RBUFFER=${(q)RBUFFER}
# zle end-of-line
#}
#zle -N mquote && bindkey '^q' mquote
## define word separators (for stuff like backward-word, forward-word, backward-kill-word,..)
#WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' # the default
#WORDCHARS=.
#WORDCHARS='*?_[]~=&;!#$%^(){}'
#WORDCHARS='${WORDCHARS:s@/@}'
# just type '...' to get '../..'
#rationalise-dot() {
#local MATCH
#if [[ $LBUFFER =~ '(^|/| | |'$'\n''|\||;|&)\.\.$' ]]; then
# LBUFFER+=/
# zle self-insert
# zle self-insert
#else
# zle self-insert
#fi
#}
#zle -N rationalise-dot
#bindkey . rationalise-dot
## without this, typing a . aborts incremental history search
#bindkey -M isearch . self-insert
#bindkey '\eq' push-line-or-edit
## some popular options ##
## add `|' to output redirections in the history
#setopt histallowclobber
## warning if file exists ('cat /dev/null > ~/.zshrc')
#setopt NO_clobber
## don't warn me about bg processes when exiting
#setopt nocheckjobs
## alert me if something failed
#setopt printexitvalue
## with spelling correction, assume dvorak kb
#setopt dvorak
## Allow comments even in interactive shells
#setopt interactivecomments
## compsys related snippets ##
## changed completer settings
#zstyle ':completion:*' completer _complete _correct _approximate
#zstyle ':completion:*' expand prefix suffix
## another different completer setting: expand shell aliases
#zstyle ':completion:*' completer _expand_alias _complete _approximate
## to have more convenient account completion, specify your logins:
#my_accounts=(
# {grml,grml1}@foo.invalid
# grml-devel@bar.invalid
#)
#other_accounts=(
# {fred,root}@foo.invalid
# vera@bar.invalid
#)
#zstyle ':completion:*:my-accounts' users-hosts $my_accounts
#zstyle ':completion:*:other-accounts' users-hosts $other_accounts
## add grml.org to your list of hosts
#hosts+=(grml.org)
#zstyle ':completion:*:hosts' hosts $hosts
## telnet on non-default ports? ...well:
## specify specific port/service settings:
#telnet_users_hosts_ports=(
# user1@host1:
# user2@host2:
# @mail-server:{smtp,pop3}
# @news-server:nntp
# @proxy-server:8000
#)
#zstyle ':completion:*:*:telnet:*' users-hosts-ports $telnet_users_hosts_ports
## the default grml setup provides '..' as a completion. it does not provide
## '.' though. If you want that too, use the following line:
#zstyle ':completion:*' special-dirs true
## aliases ##
## translate
#alias u='translate -i'
## ignore ~/.ssh/known_hosts entries
#alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "PreferredAuthentications=keyboard-interactive"'
## global aliases (for those who like them) ##
#alias -g '...'='../..'
#alias -g '....'='../../..'
#alias -g BG='& exit'
#alias -g C='|wc -l'
#alias -g G='|grep'
#alias -g H='|head'
#alias -g Hl=' --help |& less -r'
#alias -g K='|keep'
#alias -g L='|less'
#alias -g LL='|& less -r'
#alias -g M='|most'
#alias -g N='&>/dev/null'
#alias -g R='| tr A-z N-za-m'
#alias -g SL='| sort | less'
#alias -g S='| sort'
#alias -g T='|tail'
#alias -g V='| vim -'
## instead of global aliase it might be better to use grmls $abk assoc array, whose contents are expanded after pressing ,.
#$abk[SnL]="| sort -n | less"
## get top 10 shell commands:
#alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
## Execute \kbd{./configure}
#alias CO="./configure"
## Execute \kbd{./configure --help}
#alias CH="./configure --help"
## miscellaneous code ##
## Use a default width of 80 for manpages for more convenient reading
#export MANWIDTH=${MANWIDTH:-80}
## Set a search path for the cd builtin
#cdpath=(.. ~)
## variation of our manzsh() function; pick you poison:
#manzsh() { /usr/bin/man zshall | most +/"$1" ; }
## Switching shell safely and efficiently? http://www.zsh.org/mla/workers/2001/msg02410.html
#bash() {
# NO_SWITCH="yes" command bash "$@"
#}
#restart () {
# exec $SHELL $SHELL_ARGS "$@"
#}
## Handy functions for use with the (e::) globbing qualifier (like nt)
#contains() { grep -q "$*" $REPLY }
#sameas() { diff -q "$*" $REPLY &>/dev/null }
#ot () { [[ $REPLY -ot ${~1} ]] }
## get_ic() - queries imap servers for capabilities; real simple. no imaps
#ic_get() {
# emulate -L zsh
# local port
# if [[ ! -z $1 ]] ; then
# port=${2:-143}
# print "querying imap server on $1:${port}...\n";
# print "a1 capability\na2 logout\n" | nc $1 ${port}
# else
# print "usage:\n $0 <imap-server> [port]"
# fi
#}
## List all occurrences of programm in current PATH
#plap() {
# emulate -L zsh
# if [[ $# = 0 ]] ; then
# echo "Usage: $0 program"
# echo "Example: $0 zsh"
# echo "Lists all occurrences of program in the current PATH."
# else
# ls -l ${^path}/*$1*(*N)
# fi
#}
## Find out which libs define a symbol
#lcheck() {
# if [[ -n "$1" ]] ; then
# nm -go /usr/lib/lib*.a 2>/dev/null | grep ":[[:xdigit:]]\{8\} . .*$1"
# else
# echo "Usage: lcheck <function>" >&2
# fi
#}
## Download a file and display it locally
#uopen() {
# emulate -L zsh
# if ! [[ -n "$1" ]] ; then
# print "Usage: uopen \$URL/\$file">&2
# return 1
# else
# FILE=$1
# MIME=$(curl --head $FILE | \
# grep Content-Type | \
# cut -d ' ' -f 2 | \
# cut -d\; -f 1)
# MIME=${MIME%$'\r'}
# curl $FILE | see ${MIME}:-
# fi
#}
## Memory overview
#memusage() {
# ps aux | awk '{if (NR > 1) print $5;
# if (NR > 2) print "+"}
# END { print "p" }' | dc
#}
## print hex value of a number
#hex() {
# emulate -L zsh
# if [[ -n "$1" ]]; then
# printf "%x\n" $1
# else
# print 'Usage: hex <number-to-convert>'
# return 1
# fi
#}
## log out? set timeout in seconds...
## ...and do not log out in some specific terminals:
#if [[ "${TERM}" == ([Exa]term*|rxvt|dtterm|screen*) ]] ; then
# unset TMOUT
#else
# TMOUT=1800
#fi
## associate types and extensions (be aware with perl scripts and anwanted behaviour!)
#check_com zsh-mime-setup || { autoload zsh-mime-setup && zsh-mime-setup }
#alias -s pl='perl -S'
## ctrl-s will no longer freeze the terminal.
#stty erase "^?"
## you want to automatically use a bigger font on big terminals?
#if [[ "$TERM" == "xterm" ]] && [[ "$LINES" -ge 50 ]] && [[ "$COLUMNS" -ge 100 ]] && [[ -z "$SSH_CONNECTION" ]] ; then
# large
#fi
## Some quick Perl-hacks aka /useful/ oneliner
#bew() { perl -le 'print unpack "B*","'$1'"' }
#web() { perl -le 'print pack "B*","'$1'"' }
#hew() { perl -le 'print unpack "H*","'$1'"' }
#weh() { perl -le 'print pack "H*","'$1'"' }
#pversion() { perl -M$1 -le "print $1->VERSION" } # i. e."pversion LWP -> 5.79"
#getlinks () { perl -ne 'while ( m/"((www|ftp|http):\/\/.*?)"/gc ) { print $1, "\n"; }' $* }
#gethrefs () { perl -ne 'while ( m/href="([^"]*)"/gc ) { print $1, "\n"; }' $* }
#getanames () { perl -ne 'while ( m/a name="([^"]*)"/gc ) { print $1, "\n"; }' $* }
#getforms () { perl -ne 'while ( m:(\</?(input|form|select|option).*?\>):gic ) { print $1, "\n"; }' $* }
#getstrings () { perl -ne 'while ( m/"(.*?)"/gc ) { print $1, "\n"; }' $*}
#getanchors () { perl -ne 'while ( m/«([^«»\n]+)»/gc ) { print $1, "\n"; }' $* }
#showINC () { perl -e 'for (@INC) { printf "%d %s\n", $i++, $_ }' }
#vimpm () { vim `perldoc -l $1 | sed -e 's/pod$/pm/'` }
#vimhelp () { vim -c "help $1" -c on -c "au! VimEnter *" }
function openfoam_version_prompt () {
REPLY="%U(OF:$WM_PROJECT_VERSION-$WM_COMPILE_OPTION)%u "
}
grml_theme_add_token ofversion -f openfoam_version_prompt '%F{magenta}' '%f'
zstyle ':prompt:grml:left:setup' items rc ofversion change-root user at host path vcs percent
zstyle ':prompt:grml-large:left:setup' items rc jobs history shell-level change-root time date newline ofversion user at host path vcs percent
prompt grml-large
## END OF FILE #################################################################

View file

@ -0,0 +1 @@
by bgschaid. 2010-10-05

View file

@ -0,0 +1,3 @@
XFLAGS =
XINC = $(XFLAGS) -I/usr/X11R6/include
XLIBS = -L/usr/X11R6/lib -lXext -lX11

View file

@ -0,0 +1,17 @@
.SUFFIXES: .c .h
cWARN = -Wall
cc = $(WM_CC) -m64 -ftrapping-math
# -fsignaling-nans
include $(RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC -Ddarwin
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -dynamiclib -flat_namespace -undefined suppress
LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs

View file

@ -0,0 +1,23 @@
.SUFFIXES: .C .cxx .cc .cpp
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison
CC = $(WM_CXX) -m64 -ftrapping-math
# -fsignaling-nans
include $(RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-200
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -Ddarwin
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
cxxtoo = $(Ctoo)
cctoo = $(Ctoo)
cpptoo = $(Ctoo)
LINK_LIBS = $(c++DBUG) -lpthread
LINKLIBSO = $(CC) $(c++FLAGS) -lpthread -dynamiclib -undefined dynamic_lookup
# LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_LIBBIN) -lOpenFOAM -L$(FOAM_MPI_LIBBIN) -lPstream
LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_MPI_LIBBIN) -lPstream

View file

@ -0,0 +1,4 @@
# c++DBUG = -ggdb2 -DFULLDEBUG
c++DBUG = -g -DFULLDEBUG
# c++OPT = -O0 -fdefault-inline
c++OPT = -O0

View file

@ -0,0 +1,5 @@
c++DBUG =
# c++OPT = -O4
c++OPT = -O3
#c++OPT = -march=nocona -O3
# -ftree-vectorize -ftree-vectorizer-verbose=3

View file

@ -0,0 +1,2 @@
c++DBUG = -pg
c++OPT = -O2

View file

@ -0,0 +1,4 @@
cDBUG = -g -DFULLDEBUG
cOPT = -O0
# cDBUG = -ggdb -DFULLDEBUG
# cOPT = -O1 -fdefault-inline -finline-functions

View file

@ -0,0 +1,2 @@
cDBUG =
cOPT = -O3

View file

@ -0,0 +1,2 @@
cDBUG = -pg
cOPT = -O2

View file

@ -0,0 +1,11 @@
CPP = cpp --traditional-cpp $(GFLAGS)
LD = ld
# LD = /opt/local/libexec/llvm-3.3/bin/ld
PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard
include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++

View file

@ -0,0 +1,3 @@
PFLAGS =
PINC =
PLIBS =

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include/openmpi
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi

View file

@ -0,0 +1 @@
PFLAGS = -DOMPI_SKIP_MPICXX

View file

@ -2,7 +2,7 @@
cWARN = -Wall
cc = $(WM_CC) $(WM_CXXFLAGS)
cc = $(WM_CC) $(WM_CXXFLAGS) -fsignaling-nans -ftrapping-math
include $(RULES)/c$(WM_COMPILE_OPTION)

View file

@ -2,7 +2,7 @@
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-overloaded-virtual -Wno-unsequenced -Wno-c++11-extensions -Wno-unused-comparison
CC = $(WM_CXX) $(WM_CXXFLAGS)
CC = $(WM_CXX) $(WM_CXXFLAGS) -fsignaling-nans -ftrapping-math
include $(RULES)/c++$(WM_COMPILE_OPTION)