File: sid_options.py

package info (click to toggle)
python-escript 5.6-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144,304 kB
  • sloc: python: 592,074; cpp: 136,909; ansic: 18,675; javascript: 9,411; xml: 3,384; sh: 738; makefile: 207
file content (101 lines) | stat: -rw-r--r-- 3,197 bytes parent folder | download
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

##############################################################################
#
# Copyright (c) 2003-2020 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development until 2012 by Earth Systems Science Computational Center (ESSCC)
# Development 2012-2013 by School of Earth Sciences
# Development from 2014 by Centre for Geoscience Computing (GeoComp)
# Development from 2019 by School of Earth and Environmental Sciences
#
##############################################################################

# This is a template configuration file for escript on Debian/GNU Linux.
# Refer to README_FIRST for usage instructions.

escript_opts_version = 203
cxx_extra = ''          #To allow string addition later
#cxx_extra = '-Wno-literal-suffix'
openmp = True

import os

from subprocess import check_output
arch = check_output(['dpkg-architecture','-qDEB_HOST_MULTIARCH']).strip()

#mpi = 'OPENMPI'
mpi='UNKNOWN'
with open('/usr/share/mpi-default-dev/debian_defaults') as f:
  for line in f.readlines():
    bits = line.split('=')
    if bits[0] == "ARCH_DEFAULT_MPI_IMPL":
      mpi = bits[1].strip()

d_mpi_path = '/usr/lib/' + arch.decode('UTF-8') + '/' + mpi
mpi_prefix = os.path.split(os.path.realpath(d_mpi_path))[0]
mpi_prefix = d_mpi_path
mpi_libs = ['mpi_cxx', 'mpi']
netcdf = 4
#umfpack = True
umfpack_prefix = ['/usr/include/suitesparse', '/usr/lib']
umfpack_libs = ['umfpack', 'blas', 'amd']
lapack_prefix = ['/usr/include/atlas', '/usr/lib/atlas-base']
silo = True
silo_libs = ['siloh5']
dudley_assemble_flags = '-funroll-loops'


import subprocess
import os
p = subprocess.Popen(["ld","--verbose"], stdout=subprocess.PIPE)
out,err = p.communicate()
spath = [x[13:-3] for x in out.split() if 'SEARCH_DIR' in x]
p2name = ''
p3name = ''
for name in spath:
  try:
    l=os.listdir(name)
    p2res=[x for x in l if (x.startswith('libboost_python-py2') or \
            x.startswith('libboost_python2')) and x.endswith('.so')]
    p3res=[x for x in l if (x.startswith('libboost_python-py3') or \
            x.startswith('libboost_python3')) and x.endswith('.so')]
    if len(p2name)==0 and len(p2res)>0:
      p2name=p2res[-1]
    if len(p3name)==0 and len(p3res)>0:
      p3name=p3res[-1]
  except OSError:
    pass

# boost-python library/libraries to link against
boost_libs = [p2name[3:-3]]

# this can be used by options files importing us
boost_py2_libs = [p2name[3:-3]]
boost_py3_libs = [p3name[3:-3]]

from site_init import getdebbuildflags
# Now we add the debian build flags
debstuff = getdebbuildflags()
if len(debstuff) > 0:
  print("Building with the following additional flags from debian: "+str(debstuff))
for i in debstuff:
  k=i[0]
  v=i[1]
  try:
    exec(k+"+=' "+v+"'")
  except NameError:   
    exec(k+"='"+v+"'")

import platform
if platform.architecture()[0] == '32bit':
    cxx_extra += ' -Wno-maybe-uninitialized '

if platform.machine() in ('ppc', 'ppc64', 'ppc64le', 's390x'):
    cxx_extra += ' -Wno-strict-overflow -Wno-error=strict-overflow '

mathjax_path='file:///usr/share/javascript/mathjax/MathJax.js'