~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to bin/cs_package.py.in

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Package information, generated from cs_package.py.in by make.
 
3
#============================================================================
 
4
#
 
5
#     This file is part of the Code_Saturne Kernel, element of the
 
6
#     Code_Saturne CFD tool.
 
7
#
 
8
#     Copyright (C) 2010-2011 EDF S.A., France
 
9
#
 
10
#     contact: saturne-support@edf.fr
 
11
#
 
12
#     The Code_Saturne Kernel is free software; you can redistribute it
 
13
#     and/or modify it under the terms of the GNU General Public License
 
14
#     as published by the Free Software Foundation; either version 2 of
 
15
#     the License, or (at your option) any later version.
 
16
#
 
17
#     The Code_Saturne Kernel is distributed in the hope that it will be
 
18
#     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
#     GNU General Public License for more details.
 
20
#
 
21
#     You should have received a copy of the GNU General Public License
 
22
#     along with the Code_Saturne Kernel; if not, write to the
 
23
#     Free Software Foundation, Inc.,
 
24
#     51 Franklin St, Fifth Floor,
 
25
#     Boston, MA  02110-1301  USA
 
26
#
 
27
#============================================================================
 
28
 
 
29
#-------------------------------------------------------------------------------
 
30
 
 
31
import os.path
 
32
 
 
33
# Package information
 
34
#--------------------
 
35
 
 
36
class package:
 
37
 
 
38
    def __init__(self):
 
39
 
 
40
        self.name = "@PACKAGE_NAME@"
 
41
        self.tarname = "@PACKAGE_TARNAME@"
 
42
        self.version = "@PACKAGE_VERSION@"
 
43
        self.string = "@PACKAGE_STRING@"
 
44
        self.bugreport = "@PACKAGE_BUGREPORT@"
 
45
        self.url = "@PACKAGE_URL@"
 
46
 
 
47
        self.code_name = "Code_Saturne"
 
48
 
 
49
        self.preprocessor = "cs_preprocess"
 
50
        self.partitioner = "cs_partition"
 
51
        self.solver = "cs_solver"
 
52
        self.check_syntax = "cs_check_syntax"
 
53
        self.io_dump = "cs_io_dump"
 
54
        self.guiname = "SaturneGUI"
 
55
        self.configfile = "code_saturne.cfg"
 
56
        self.scratchdir = 'tmp_Saturne'
 
57
        self.srcdir = 'src_saturne'
 
58
 
 
59
        self.cc="@CC@"
 
60
        self.cxx="@CXX@"
 
61
        self.fc="@FC@"
 
62
        self.ld = "@CS_LD@"
 
63
 
 
64
        self.cppflags = "-DHAVE_CONFIG_H @CS_CPPFLAGS@"
 
65
        self.cflags="@CS_CFLAGS@"
 
66
        self.cxxflags="@CS_CXXFLAGS@"
 
67
        self.fcflags="@CS_FCFLAGS@"
 
68
        self.fcmodinclude="@FCMODINCLUDE@"
 
69
        self.ldflags = "@CS_LDFLAGS@"
 
70
        self.libs = "-lsaturne -lmei -lfvm_filters -lfvm -lbft @CS_LIBS@"
 
71
        self.deplibs = "@LDFLAGS@ @LIBINTL@ @LIBS@ @FCLIBS@"
 
72
        self.rpath="@LDRPATH@"
 
73
 
 
74
        # PLE library can be an internal or external library
 
75
        # Its flags are included in other build flags,
 
76
        # but are made available here for "code_saturne config".
 
77
        self.ple_cppflags = "@PLE_CPPFLAGS@"
 
78
        self.ple_ldflags = "@PLE_LDFLAGS@"
 
79
        self.ple_libs = "@PLE_LIBS@"
 
80
 
 
81
        self.prefix = "@prefix@"
 
82
        self.exec_prefix = "@exec_prefix@"
 
83
        self.bindir = "@bindir@"
 
84
        self.includedir = "@includedir@"
 
85
        self.pkgincludedir = "@pkgincludedir@"
 
86
        self.libdir = "@libdir@"
 
87
        self.libexecdir = "@libexecdir@"
 
88
        self.pkglibexecdir = "@pkglibexecdir@"
 
89
        self.pythondir = "@pythondir@"
 
90
        self.pkgpythondir = "@pkgpythondir@"
 
91
        self.datarootdir = "@datarootdir@"
 
92
        self.datadir = "@datadir@"
 
93
        self.pkgdatadir = "@pkgdatadir@"
 
94
        self.docdir = "@docdir@"
 
95
        self.pdfdir = "@pdfdir@"
 
96
        self.sysconfdir = "@sysconfdir@"
 
97
        self.syrthes_prefix = "@syrthes_prefix@"
 
98
 
 
99
        self.mpi_type = "@mpi_type@"
 
100
        self.mpi_bindir = "@mpi_bindir@"
 
101
        self.mpi_libdir = "@mpi_libdir@"
 
102
 
 
103
        self.env_modules = "@cs_env_modules@"
 
104
        self.env_modulecmd = "@MODULECMD@"
 
105
 
 
106
    def get_preprocessor(self):
 
107
 
 
108
        preprocessordir = "@pkglibexecdir@"
 
109
        return os.path.join(preprocessordir, self.preprocessor)
 
110
 
 
111
    def get_partitioner(self):
 
112
 
 
113
        partitionerdir = "@pkglibexecdir@"
 
114
        return os.path.join(partitionerdir, self.partitioner)
 
115
 
 
116
    def get_solver(self):
 
117
 
 
118
        solverdir = "@pkglibexecdir@"
 
119
        return os.path.join(solverdir, self.solver)
 
120
 
 
121
    def get_check_syntax(self):
 
122
 
 
123
        checksyntaxdir = "@pkglibexecdir@"
 
124
        return os.path.join(checksyntaxdir, self.check_syntax)
 
125
 
 
126
    def get_io_dump(self):
 
127
 
 
128
        iodumpdir = "@pkglibexecdir@"
 
129
        return os.path.join(iodumpdir, self.io_dump)
 
130
 
 
131
    def get_configfile(self):
 
132
 
 
133
        configfiledir = "@sysconfdir@"
 
134
        return os.path.join(configfiledir, self.configfile)
 
135
 
 
136
    def get_batchdir(self):
 
137
 
 
138
        batchdir = "@pkgdatadir@"
 
139
        return os.path.join(batchdir, 'batch')
 
140
 
 
141
    def get_runcase_script(self, script):
 
142
 
 
143
        runcasedir = "@pkgdatadir@"
 
144
        return os.path.join(runcasedir, script)
 
145
 
 
146
    def get_alternate_version(self, version):
 
147
        """
 
148
        Return alternate version package object
 
149
        """
 
150
 
 
151
        pkg = None
 
152
 
 
153
        # Determine path (by absolute or local name)
 
154
        pythondir = os.path.normpath(version)
 
155
        prefix = os.path.normpath(self.exec_prefix)
 
156
        if not os.path.isabs(pythondir):
 
157
            if self.pkgpythondir.find(prefix) > -1:
 
158
                postfix = self.pkgpythondir[len(prefix)+1:]
 
159
                prefix = os.path.split(prefix)[0]
 
160
                pythondir = os.path.normpath(os.path.join(prefix,
 
161
                                                          version,
 
162
                                                          postfix))
 
163
 
 
164
        # load alternate package
 
165
        if os.path.isdir(pythondir):
 
166
            import sys
 
167
            sys.path.insert(0, pythondir)
 
168
            import cs_package
 
169
            reload(cs_package)
 
170
            pkg = cs_package.package()
 
171
            sys.path.pop(0)
 
172
        else:
 
173
            raise ImportError("Alternative version '" + pythondir + "' not found.")
 
174
 
 
175
        return pkg
 
176
 
 
177
#-------------------------------------------------------------------------------