summaryrefslogtreecommitdiff
path: root/sci-libs/cantera/files/cantera-2.5.1_env.patch
blob: 77004803b1270581649715c68a6b661c7e3d9f6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
diff -Naur old/SConstruct new/SConstruct
--- old/SConstruct	2021-03-21 01:18:43.000000000 +0300
+++ new/SConstruct	2021-03-21 01:27:06.000000000 +0300
@@ -193,7 +193,7 @@
     toolchain = ['default']
 
 env = Environment(tools=toolchain+['textfile', 'subst', 'recursiveInstall', 'wix', 'gch'],
-                  ENV={'PATH': os.environ['PATH']},
+                  ENV={'PATH': os.environ['PATH'], 'CCACHE_DIR': os.environ.get('CCACHE_DIR','')},
                   toolchain=toolchain,
                   **extraEnvArgs)
 
@@ -239,6 +239,9 @@
     sys.exit(1)
 
 compiler_options = [
+     ('AR',
+     """The archiver to use.""",
+     env['AR']),
     ('CXX',
      """The C++ compiler to use.""",
      env['CXX']),
@@ -734,10 +734,7 @@
 env['cantera_pure_version'] = re.match(r'(\d+\.\d+\.\d+)', env['cantera_version']).group(0)
 env['cantera_short_version'] = re.match(r'(\d+\.\d+)', env['cantera_version']).group(0)
 
-try:
-    env['git_commit'] = getCommandOutput('git', 'rev-parse', '--short', 'HEAD')
-except Exception:
-    env['git_commit'] = 'unknown'
+env['git_commit'] = 'unknown'
 
 # Print values of all build options:
 print("Configuration variables read from 'cantera.conf' and command line:")
@@ -1149,10 +1149,24 @@
         if retcode == 0:
             config_error("Failed to determine Sundials BLAS/LAPACK.")
         env['has_sundials_lapack'] = int(has_sundials_lapack.strip())
-    else:
-        # In Sundials 2.6, SUNDIALS_BLAS_LAPACK is either defined or undefined
+    elif sundials_ver < parse_version('5.5'):
+        # In Sundials 2.6-5.5, SUNDIALS_BLAS_LAPACK is either defined or undefined
         env['has_sundials_lapack'] = conf.CheckDeclaration('SUNDIALS_BLAS_LAPACK',
                 '#include "sundials/sundials_config.h"', 'C++')
+    else:
+        # In Sundials 5.5 and higher, two defines are included specific to the
+        # SUNLINSOL packages indicating whether SUNDIALS has been built with LAPACK
+        lapackband = conf.CheckDeclaration(
+            "SUNDIALS_SUNLINSOL_LAPACKBAND",
+            '#include "sundials/sundials_config.h"',
+            "C++",
+        )
+        lapackdense = conf.CheckDeclaration(
+            "SUNDIALS_SUNLINSOL_LAPACKDENSE",
+            '#include "sundials/sundials_config.h"',
+            "C++",
+        )
+        env["has_sundials_lapack"] = lapackband and lapackdense
 
     # In the case where a user is trying to link Cantera to an external BLAS/LAPACK
     # library, but Sundials was configured without this support, print a Warning.
diff -Naur old/interfaces/cython/SConscript new/interfaces/cython/SConscript
--- old/interfaces/cython/SConscript	2021-03-21 01:18:43.000000000 +0300
+++ new/interfaces/cython/SConscript	2021-03-21 01:59:29.000000000 +0300
@@ -108,8 +108,7 @@
     elif localenv['libdirname'] != 'lib':
         # 64-bit RHEL / Fedora etc. or e.g. x32 Gentoo profile
         extra = localenv.subst(
-            ' --prefix=${{python_prefix}}'
-            ' --install-lib=${{python_prefix}}/${{libdirname}}/python{}/site-packages'.format(py_version))
+            ' --prefix=${stage_dir}${prefix} --install-lib=${python_prefix}')
     else:
         extra = '--user'
         localenv.AppendENVPath(
diff -Naur old/interfaces/python_minimal/SConscript new/interfaces/python_minimal/SConscript
--- old/interfaces/python_minimal/SConscript	2021-02-13 00:57:15.000000000 +0300
+++ new/interfaces/python_minimal/SConscript	2021-04-09 23:26:28.000000000 +0300
@@ -8,7 +8,7 @@
 make_setup = build(localenv.SubstFile('setup.py', 'setup.py.in'))
 
 # copy scripts from the full Cython module
-for script in ['ctml_writer', 'ck2cti']:
+for script in ['ctml_writer', 'ck2cti', 'ck2yaml', 'cti2yaml', 'ctml2yaml']:
     # The actual script
     s = build(env.Command('cantera/{}.py'.format(script),
                           '#interfaces/cython/cantera/{}.py'.format(script),
@@ -38,8 +38,7 @@
         elif localenv['libdirname'] != 'lib':
             # 64-bit RHEL / Fedora etc. or e.g. x32 Gentoo profile
             extra = localenv.subst(
-                ' --prefix=${{python_prefix}}'
-                ' --install-lib=${{python_prefix}}/${{libdirname}}/python{}/site-packages'.format(py_version))
+                ' --prefix=${stage_dir}${prefix} --install-lib=${python_prefix}')
         else:
             extra = '--user'
             localenv.AppendENVPath(
diff -Naur old/interfaces/python_minimal/cantera/__init__.py new/interfaces/python_minimal/cantera/__init__.py
--- old/interfaces/python_minimal/cantera/__init__.py	2021-02-13 00:57:15.000000000 +0300
+++ new/interfaces/python_minimal/cantera/__init__.py	2021-04-10 00:07:38.000000000 +0300
@@ -1,2 +1,5 @@
 from . import ck2cti
 from . import ctml_writer
+from . import ck2yaml
+from . import cti2yaml
+from . import ctml2yaml
diff -Naur old/interfaces/python_minimal/setup.py.in new/interfaces/python_minimal/setup.py.in
--- old/interfaces/python_minimal/setup.py.in	2021-02-13 00:57:15.000000000 +0300
+++ new/interfaces/python_minimal/setup.py.in	2021-04-09 23:32:09.000000000 +0300
@@ -12,6 +12,9 @@
         'console_scripts': [
             'ck2cti=cantera.ck2cti:script_entry_point',
             'ctml_writer=cantera.ctml_writer:main',
+            'ck2yaml=cantera.ck2yaml:script_entry_point',
+            'cti2yaml=cantera.cti2yaml:main',
+            'ctml2yaml=cantera.ctml2yaml:main',
         ],
       },
 )
diff -Naur old/test_problems/SConscript new/test_problems/SConscript
--- old/test_problems/SConscript	2021-03-21 01:18:43.000000000 +0300
+++ new/test_problems/SConscript	2021-03-21 01:42:19.000000000 +0300
@@ -222,7 +222,7 @@
 CompileAndTest('VPsilane_test')
 
 CompileAndTest('clib', 'clib_test', 'clib_test',
-               extensions=['^clib_test.c'], libs=['cantera_shared'])
+               extensions=['^clib_test.c'])
 
 # C++ Samples
 Test('cxx-bvp', 'cxx_samples', '#build/samples/cxx/bvp/blasius', None,