From 1f0569230b269af744bd5c204fbd832e16dca768 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 11 Mar 2011 09:20:37 +0000 Subject: [PATCH] new installation/setup dir to hold all top-level make_*-scripts --- .../makeMe.py => installation/setup/make_code | 3 ++- .../setup/make_processing | 23 +++++++++++++++---- processing/post/make_postprocessingMath | 12 ++++++++-- 3 files changed, 31 insertions(+), 7 deletions(-) rename code/makeMe.py => installation/setup/make_code (92%) rename processing/make_public => installation/setup/make_processing (70%) diff --git a/code/makeMe.py b/installation/setup/make_code similarity index 92% rename from code/makeMe.py rename to installation/setup/make_code index 91ced1a78..409fa14a4 100755 --- a/code/makeMe.py +++ b/installation/setup/make_code @@ -10,7 +10,8 @@ architectures = { }, } -wd = os.path.dirname(sys.argv[0]) +wd = os.path.join(os.path.dirname(sys.argv[0]),'../../code') + for arch in architectures: me = architectures[arch] try: diff --git a/processing/make_public b/installation/setup/make_processing similarity index 70% rename from processing/make_public rename to installation/setup/make_processing index 9ee5d05c8..fc07dc2a1 100755 --- a/processing/make_public +++ b/installation/setup/make_processing @@ -1,9 +1,9 @@ #!/usr/bin/env python -# Makes the postprocessing routines acessible from everywhere. +# renders the postprocessing routines acessible from everywhere. # you need a ~/bin directory in your home folder -# add the bin directory to your path by adding the following lines -# to your .bashrc file: +# if necessary, add the bin directory to your path by +# adding the following lines to your .bashrc file: # PATH="$PATH:~/bin" # export PATH @@ -34,8 +34,16 @@ compile = { \ ], } +execute = { \ + 'pre' : [ + ], + 'post' : [ + 'make_postprocessingMath', + ], + } + homedir = os.getenv('HOME') -basedir = os.path.dirname(sys.argv[0]) +basedir = os.path.join(os.path.dirname(sys.argv[0]),'../../processing') for dir in bin_link: for file in bin_link[dir]: src = os.path.abspath(os.path.join(basedir,dir,file)) @@ -59,3 +67,10 @@ modules = glob.glob(os.path.abspath(os.path.join(basedir,'*.mod'))) for module in modules: print module os.remove(module) + +for dir in execute: + for file in execute[dir]: + cmd = os.path.abspath(os.path.join(basedir,dir,file)) + if os.access(cmd,os.X_OK): + print cmd + os.system('%s %s'%(cmd,os.path.join(basedir,dir))) diff --git a/processing/post/make_postprocessingMath b/processing/post/make_postprocessingMath index 534fc4631..160273338 100755 --- a/processing/post/make_postprocessingMath +++ b/processing/post/make_postprocessingMath @@ -10,6 +10,14 @@ # --f90flags="-heap-arrays 500000000" prevents segmentation fault for large arrays # use ./configure --enable-portable-binary --enable-shared for the compilation of fftw3.2.2 -f2py -c --f90flags="-heap-arrays 500000000" \ -postprocessingMath.pyf postprocessingMath.f90 -L ./libfftw3.a +if [[ $# -eq 0 ]]; then + wd='.' +else + wd=$1 +fi + +f2py -c --f90flags="-heap-arrays 500000000" \ +$wd/postprocessingMath.pyf \ +$wd/postprocessingMath.f90 \ +-L $wd/libfftw3.a