From f4ee6dc8f933e08b25b8e07fd4af4fa68197edd0 Mon Sep 17 00:00:00 2001 From: caremoli Date: Fri, 27 Nov 2009 08:45:54 +0000 Subject: [PATCH] CCAR: update examples and put configuration variables in one common file makefile.inc --- Examples/ast1/README.txt | 9 +++++---- Examples/ast1/components.py | 2 +- Examples/ast1/fcompo/Makefile | 4 ++-- Examples/ast1/myaster/Makefile | 16 ++++++---------- Examples/ast1/myaster/make_cata | 2 +- Examples/ast2/README.txt | 17 ++++++++++------- Examples/ast2/fcompo/Makefile | 4 ++-- Examples/ast2/myaster/Makefile | 5 ++--- Examples/ast2/myaster/make_exec | 4 ++-- Examples/cpp1/README.txt | 4 ++-- Examples/cpp2/Makefile | 2 ++ Examples/cpp2/README.txt | 10 +++++----- Examples/fort1/Makefile | 6 +++--- Examples/fort1/README.txt | 7 ++++--- Examples/fort1/components.py | 5 ++++- Examples/fort2/Makefile | 6 +++--- Examples/fort2/README.txt | 11 ++++++----- Examples/makefile.inc | 5 +++++ Examples/pyth1/README.txt | 6 +++--- Examples/pyth2/README.txt | 6 +++--- 20 files changed, 71 insertions(+), 60 deletions(-) create mode 100644 Examples/makefile.inc diff --git a/Examples/ast1/README.txt b/Examples/ast1/README.txt index 6feb349..e694f3e 100644 --- a/Examples/ast1/README.txt +++ b/Examples/ast1/README.txt @@ -1,14 +1,15 @@ A Code_Aster component dynamically loadable =============================================== -To build this example, modify the files components.py, fcompo/Makefile, myaster/Makefile +To build this example, modify the files ../context.py, ../makefile.inc, fcompo/Makefile, myaster/Makefile to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR 3- your Code_Aster installation +4- your FORTRAN compiler -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here and execute components.py :: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here):: source @@ -26,8 +27,8 @@ process components.py :: python components.py -You should get a SALOME module in source form (pycompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and pycompos. +You should get a SALOME module in source form (astmod_SRC), its installation (install) and +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module astmod. To run a coupling: diff --git a/Examples/ast1/components.py b/Examples/ast1/components.py index 88506b0..beb099e 100644 --- a/Examples/ast1/components.py +++ b/Examples/ast1/components.py @@ -27,7 +27,7 @@ c1=ASTERComponent("caster",services=[ ], aster_dir=aster_root, python_path=[myasterdir], - argv=["-memjeveux","4",'-rep_outils','/local/chris/ASTER/instals/outils'], + argv=["-memjeveux","4",'-rep_outils',os.path.join(aster_home,'outils')], ) c2=F77Component("cfort",services=[ diff --git a/Examples/ast1/fcompo/Makefile b/Examples/ast1/fcompo/Makefile index a04c201..525e299 100644 --- a/Examples/ast1/fcompo/Makefile +++ b/Examples/ast1/fcompo/Makefile @@ -1,6 +1,6 @@ -FC=gfortran +include ../../makefile.inc -KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V5 +FC=gfortran KERNEL_LIBS= -L$(KERNEL_ROOT_DIR)/lib/salome -lCalciumC -lSalomeDSCSuperv -lSalomeDSCContainer -lSalomeDatastream -lSalomeDSCSupervBasic diff --git a/Examples/ast1/myaster/Makefile b/Examples/ast1/myaster/Makefile index 4419fdb..f9c3922 100644 --- a/Examples/ast1/myaster/Makefile +++ b/Examples/ast1/myaster/Makefile @@ -1,24 +1,20 @@ -#ASTER -ASTER_ROOT=/local/chris/ASTER/instals -#SALOME -KERNEL_ROOT_DIR=/local/chris/SALOME2/RELEASES/Install/KERNEL_V5 +include ../../makefile.inc - -ASTER_INSTALL=$(ASTER_ROOT)/NEW9 +ASTER_INSTALL=$(ASTER_ROOT)/$(ASTER_VERSION) ASTER_PUB=$(ASTER_ROOT)/public ASTER_OUTILS=$(ASTER_ROOT)/outils ASTER_LIBS = -L$(ASTER_INSTALL)/lib -laster \ -L$(ASTER_PUB)/scotch_4.0/bin -lscotch -lscotcherr \ - -L/local/chris/pkg/med23/install/lib -lmed \ + -L/local/chris/pkg/med23/install/lib -lmed \ -lferm -llapack -lhdf5 KERNEL_INCLUDES=-I$(KERNEL_ROOT_DIR)/include/salome KERNEL_LIBS= -L$(KERNEL_ROOT_DIR)/lib/salome -lCalciumC -lSalomeDSCSuperv -lSalomeDSCContainer \ -lSalomeDatastream -lSalomeDSCSupervBasic -Wl,--rpath -Wl,$(KERNEL_ROOT_DIR)/lib/salome -FC=g77 -LD=g77 +FC=gfortran +LD=gfortran FFLAGS= CC=gcc SOURCES= src/op0078.f src/op0189.f src/op0181.f @@ -35,7 +31,7 @@ cata: commande/cata.py cp -rf commande/cata.py* bibpyt/Cata commande/cata.py:$(CATAPY) - ./make_cata $(ASTER_ROOT)/ASTK/ASTK_SERV/bin/as_run + ./make_cata $(ASTER_ROOT)/ASTK/ASTK_SERV/bin/as_run $(ASTER_VERSION) astermodule:astermodule.so pyth cp -rf astermodule.so bibpyt diff --git a/Examples/ast1/myaster/make_cata b/Examples/ast1/myaster/make_cata index 37ef2fe..0846dbf 100755 --- a/Examples/ast1/myaster/make_cata +++ b/Examples/ast1/myaster/make_cata @@ -2,7 +2,7 @@ cat >make-cmd << END P debug nodebug P mode interactif -P version NEW9 +P version $2 P ncpus 1 A args A memjeveux 16.0 diff --git a/Examples/ast2/README.txt b/Examples/ast2/README.txt index ae40095..fa648b5 100644 --- a/Examples/ast2/README.txt +++ b/Examples/ast2/README.txt @@ -1,14 +1,15 @@ A Code_Aster standalone component (in executable form) =========================================================== -To build this example, modify the files components.py, fcompo/Makefile, myaster/config.txt, myaster/Makefile +To build this example, modify the files ../context.py, ../makefile.inc, fcompo/Makefile, myaster/config.txt, myaster/Makefile to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR 3- your Code_Aster installation +4- your FORTRAN compiler -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here and execute components.py :: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here):: source @@ -16,19 +17,21 @@ process components.py :: python components.py -You should get a SALOME module in source form (pycompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and astmod_SRC. +You should get a SALOME module in source form (astmod_SRC), its installation (install) and +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module astmod_SRC. -Build the fcompo library :: +Build the fcompo executable, under the SALOME application environment:: cd fcompo - make + ../appli/runSession make -Build the Code_Aster library :: +Build the Code_Aster executable :: cd myaster make +Modify the exeaster script that drives the ASTER execution (change the files path) + To run a coupling: 1. start SALOME in background : ./appli/runAppli -t diff --git a/Examples/ast2/fcompo/Makefile b/Examples/ast2/fcompo/Makefile index bcf2bba..36e79c1 100644 --- a/Examples/ast2/fcompo/Makefile +++ b/Examples/ast2/fcompo/Makefile @@ -1,7 +1,7 @@ -FC=gfortran +include ../../makefile.inc -KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V5 +FC=gfortran all:prog prog:compo.o diff --git a/Examples/ast2/myaster/Makefile b/Examples/ast2/myaster/Makefile index 8fa01d6..dc8cb89 100644 --- a/Examples/ast2/myaster/Makefile +++ b/Examples/ast2/myaster/Makefile @@ -1,9 +1,8 @@ -#ASTER -ASTER_ROOT=/local/cchris/Aster/V10/Install +include ../../makefile.inc aster.exe: - ./make_exec + ./make_exec $(ASTER_ROOT) $(ASTER_VERSION) clean: rm -rf commande aster.exe make-exe diff --git a/Examples/ast2/myaster/make_exec b/Examples/ast2/myaster/make_exec index ae00fde..6dcc041 100755 --- a/Examples/ast2/myaster/make_exec +++ b/Examples/ast2/myaster/make_exec @@ -3,7 +3,7 @@ cat >make-exe << END P actions make_exec P actions make_cmde -P version STA10.0 +P version $2 P nomjob forma01a P ncpus 1 A memjeveux 4.000000 @@ -24,4 +24,4 @@ R capy ${PWD}/catalo D 0 R cmde ${PWD}/commande DR 0 END -/local/cchris/Aster/V10/Install/ASTK/ASTK_SERV/bin/as_run make-exe +$1/ASTK/ASTK_SERV/bin/as_run make-exe diff --git a/Examples/cpp1/README.txt b/Examples/cpp1/README.txt index 424e98e..6703a62 100644 --- a/Examples/cpp1/README.txt +++ b/Examples/cpp1/README.txt @@ -1,7 +1,7 @@ A C++ component dynamically loadable ========================================= -To build this example, modify the components.py file +To build this example, modify the ../context.py file to take into account your configuration. 1- your prerequisite file @@ -13,7 +13,7 @@ Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here and python components.py You should get a SALOME module in source form (cppcompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and cppcompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module cppcompos. To run a coupling: diff --git a/Examples/cpp2/Makefile b/Examples/cpp2/Makefile index 4a97570..9a186ed 100644 --- a/Examples/cpp2/Makefile +++ b/Examples/cpp2/Makefile @@ -2,3 +2,5 @@ prog:prog.cxx g++ -o prog prog.cxx -L./install/lib/salome -lcompo1Exelib +clean: + rm -rf *.o prog install appli cppcompos_SRC cppcompos_SRC.bak compo1_inst_1 traceExec_proc diff --git a/Examples/cpp2/README.txt b/Examples/cpp2/README.txt index 38890cb..d167aa3 100644 --- a/Examples/cpp2/README.txt +++ b/Examples/cpp2/README.txt @@ -1,23 +1,23 @@ A C++ standalone component (executable form) ================================================= -To build this example, modify the components.py and Makefile files +To build this example, modify the ../context.py file to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here and execute components.py :: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here and execute components.py :: source python components.py You should get a SALOME module in source form (cppcompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and cppcompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module cppcompos. -To build the standalone component, run:: +To build the standalone component (executable named prog), execute the Makefile in the SALOME application environment:: - make + ./appli/runSession make To run a coupling: diff --git a/Examples/fort1/Makefile b/Examples/fort1/Makefile index f21349d..9a4c689 100644 --- a/Examples/fort1/Makefile +++ b/Examples/fort1/Makefile @@ -1,7 +1,7 @@ -FC=gfortran +include ../makefile.inc -KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V5 +FC=gfortran all:libcode1.so libcode2.so libcode1.so:code1.o @@ -14,4 +14,4 @@ code2.o:code2.f $(FC) -c code2.f -fPIC -I$(KERNEL_ROOT_DIR)/include/salome -fexceptions clean: - rm -rf *.o *.so + rm -rf *.o *.so fcompos_SRC install fcompos_SRC.bak traceExec_proc appli appli.bak diff --git a/Examples/fort1/README.txt b/Examples/fort1/README.txt index 1d24124..846cd4c 100644 --- a/Examples/fort1/README.txt +++ b/Examples/fort1/README.txt @@ -1,13 +1,14 @@ A Fortran component dynamically loadable ============================================= -To build this example, modify the components.py and Makefile files +To build this example, modify the ../context.py, ../makefile.inc and Makefile files to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR +3- your FORTRAN compiler -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here):: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here):: source @@ -20,7 +21,7 @@ and process components.py :: python components.py You should get a SALOME module in source form (fcompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and fcompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module fcompos. To run a coupling: diff --git a/Examples/fort1/components.py b/Examples/fort1/components.py index 3917c79..5bbd2e8 100644 --- a/Examples/fort1/components.py +++ b/Examples/fort1/components.py @@ -9,7 +9,10 @@ cwd=os.getcwd() c1=F77Component("fcode1", services=[Service("serv1",inport=[("a","double"),("b","double")], outport=[("c","double")], outstream=[("PARAM","CALCIUM_double","I")],), ], - libs="-L%s -lcode1" % cwd) + libs="-L%s -lcode1" % cwd, + rlibs="-Wl,--rpath -Wl,%s" % cwd, + ) + c2=F77Component("fcode2", services=[Service("serv1",inport=[("a","double"),("b","double")], outport=[("c","double")], instream=[("PARAM","CALCIUM_double","I")],), ], diff --git a/Examples/fort2/Makefile b/Examples/fort2/Makefile index 25b4f7c..c4a7dd6 100644 --- a/Examples/fort2/Makefile +++ b/Examples/fort2/Makefile @@ -1,7 +1,7 @@ -FC=gfortran +include ../makefile.inc -KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V5 +FC=gfortran all:prog1 prog2 prog1:code1.o @@ -15,4 +15,4 @@ code2.o:code2.f $(FC) -c code2.f -I$(KERNEL_ROOT_DIR)/include/salome -fexceptions clean: - rm -rf *.o prog1 prog2 + rm -rf *.o prog1 prog2 fcode1_inst_1 fcode2_inst_1 fcompos_SRC install traceExec_proc diff --git a/Examples/fort2/README.txt b/Examples/fort2/README.txt index f2ae712..ded4620 100644 --- a/Examples/fort2/README.txt +++ b/Examples/fort2/README.txt @@ -1,13 +1,14 @@ A Fortran standalone component ================================= -To build this example, modify the components.py and Makefile files +To build this example, modify the ../context.py, ../makefile.inc and Makefile files to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR +3- your FORTRAN compiler -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here):: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here):: source @@ -16,11 +17,11 @@ and process components.py :: python components.py You should get a SALOME module in source form (fcompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and fcompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module fcompos. -Build the code1 et code2 executables :: +Build the code1 et code2 executables under the SALOME application environment:: - make + ./appli/runSession make To run a coupling: diff --git a/Examples/makefile.inc b/Examples/makefile.inc new file mode 100644 index 0000000..a1e9eb1 --- /dev/null +++ b/Examples/makefile.inc @@ -0,0 +1,5 @@ + +KERNEL_ROOT_DIR=/local/cchris/Salome/Install/KERNEL_V5 + +ASTER_ROOT=/local/cchris/Aster/V10/Install +ASTER_VERSION=STA10.0 diff --git a/Examples/pyth1/README.txt b/Examples/pyth1/README.txt index 54d263b..0b89847 100644 --- a/Examples/pyth1/README.txt +++ b/Examples/pyth1/README.txt @@ -1,19 +1,19 @@ A Python component dynamically loadable =============================================== -To build this example, modify the components.py file +To build this example, modify the ../context.py file to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here and execute components.py :: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here and execute components.py :: source python components.py You should get a SALOME module in source form (pycompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and pycompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module pycompos. To run a coupling: diff --git a/Examples/pyth2/README.txt b/Examples/pyth2/README.txt index 706ee53..88498ae 100644 --- a/Examples/pyth2/README.txt +++ b/Examples/pyth2/README.txt @@ -1,19 +1,19 @@ A Python standalone component (in executable form) ======================================================= -To build this example, modify the components.py file +To build this example, modify the ../context.py file to take into account your configuration. 1- your prerequisite file 2- your KERNEL_ROOT_DIR -Then set the environment (including PYTHONPATH for YACGEN, ../.. from here and execute components.py :: +Then set the environment (including PYTHONPATH for YACSGEN, ../.. from here and execute components.py :: source python components.py You should get a SALOME module in source form (pycompos_SRC), its installation (install) and -a SALOME application (appli) composed of modules KERNEL, GUI, YACS and pycompos. +a SALOME application (appli) composed of modules KERNEL, GUI, YACS and the new module pycompos. To run a coupling: -- 2.39.2