1 # Copyright (C) 2009-2021 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, or (at your option) any later version.
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 exec(compile(open("../context.py").read(), "../context.py", 'exec'))
27 from module_generator import Generator,Module,ASTERComponent,Service,F77Component
29 aster_root=os.path.join(aster_home,aster_version)
31 fcompodir=os.path.join(os.getcwd(),"fcompo")
33 install_prefix="./install"
36 c1=ASTERComponent("caster",services=[
37 Service("s1",inport=[("jdc","file"),("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")],
46 Service("s2",inport=[("a","double"),],
47 outport=[("d","double")],
52 exe_path=os.path.join(os.getcwd(),"exeaster"),
55 c2=F77Component("cfort",services=[
56 Service("s1",inport=[("a","double"),("b","long"),("c","string")],
57 outport=[("d","double"),("e","long"),("f","string")],
58 instream=[("a","CALCIUM_double","T"),("b","CALCIUM_double","I")],
59 outstream=[("ba","CALCIUM_double","T"),("bb","CALCIUM_double","I"),
60 ("bc","CALCIUM_integer","I"),("bd","CALCIUM_real","I"),
61 ("be","CALCIUM_string","I"),("bf","CALCIUM_complex","I"),
62 ("bg","CALCIUM_logical","I"),
68 exe_path=os.path.join(fcompodir,"prog"),
71 g=Generator(Module("astmod",components=[c1,c2],prefix=install_prefix),context)
77 g.make_appli("appli", restrict=["KERNEL"], altmodules={"GUI":GUI_ROOT_DIR, "YACS":YACS_ROOT_DIR}, sys_modules=SYS_MODULES)