1 # Copyright (C) 2009-2012 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 Example with one Code_Aster component and one fortran component
25 #import context from ..
26 execfile("../context.py")
27 from module_generator import Generator,Module,ASTERComponent,Service,F77Component
29 aster_root=os.path.join(aster_home,aster_version)
31 libfcompodir=os.path.join(os.getcwd(),"fcompo")
32 myasterdir=os.path.join(os.getcwd(),"myaster","bibpyt")
33 install_prefix="./install"
36 c1=ASTERComponent("caster",services=[
37 Service("s1",inport=[("argv","string"),("a","double"),("b","long"),("c","string")],
38 outport=[("d","double")],
39 instream=[("aa","CALCIUM_double","T"),("ab","CALCIUM_double","I"),
40 ("ac","CALCIUM_integer","I"),("ad","CALCIUM_real","I"),
41 ("ae","CALCIUM_string","I"),("af","CALCIUM_complex","I"),
42 ("ag","CALCIUM_logical","I"),
44 outstream=[("ba","CALCIUM_double","T"),("bb","CALCIUM_double","I")],
48 python_path=[myasterdir],
49 argv=["-memjeveux","4",'-rep_outils',os.path.join(aster_home,'outils')],
52 c2=F77Component("cfort",services=[
53 Service("s1",inport=[("a","double"),("b","long"),("c","string")],
54 outport=[("d","double"),("e","long"),("f","string")],
55 instream=[("a","CALCIUM_double","T"),("b","CALCIUM_double","I")],
56 outstream=[("ba","CALCIUM_double","T"),("bb","CALCIUM_double","I"),
57 ("bc","CALCIUM_integer","I"),("bd","CALCIUM_real","I"),
58 ("be","CALCIUM_string","I"),("bf","CALCIUM_complex","I"),
59 ("bg","CALCIUM_logical","I"),
63 ],libs="-L%s -lfcompo" % libfcompodir,
64 rlibs="-Wl,--rpath -Wl,%s" % libfcompodir)
66 g=Generator(Module("astmod",components=[c1,c2],prefix=install_prefix),context)
72 g.make_appli("appli", restrict=["KERNEL"], altmodules={"GUI":GUI_ROOT_DIR, "YACS":YACS_ROOT_DIR})