File: setup.py.in

package info (click to toggle)
eccodes 2.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 480,184 kB
  • sloc: ansic: 163,815; makefile: 21,266; sh: 8,507; python: 6,026; f90: 5,762; perl: 2,891; yacc: 818; lex: 356; cpp: 305; fortran: 116; awk: 66
file content (77 lines) | stat: -rw-r--r-- 2,842 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
#!/usr/bin/env python

from distutils.core import setup, Extension
import os
import sys

import numpy
# Obtain the numpy include directory.  This logic works across numpy versions.
try:
    numpy_include = numpy.get_include()
except AttributeError:
    numpy_include = numpy.get_numpy_include()

# See ECC-644
extra_compile_args = []
cmake_c_compiler_id='@CMAKE_C_COMPILER_ID@'
if cmake_c_compiler_id == 'PGI':
    extra_compile_args.append('-noswitcherror')

attdict = dict(sources=['@CMAKE_CURRENT_SOURCE_DIR@/swig_wrap_numpy.c',
                        '@CMAKE_CURRENT_SOURCE_DIR@/grib_interface.c'],
               swig_opts=[],
               include_dirs=['.', '@CMAKE_CURRENT_BINARY_DIR@/../src',
                             '@CMAKE_CURRENT_SOURCE_DIR@/../src',
                             numpy_include],
               library_dirs=['@CMAKE_BINARY_DIR@/lib'],
               runtime_library_dirs=[],
               libraries=['eccodes'],
               extra_compile_args=extra_compile_args,
               extra_objects=[])

shared_libs='@BUILD_SHARED_LIBS@'
if shared_libs == 'OFF':

    add_attribute = lambda **args: [list.append(attdict[key], value)
                                    for key, value in args.items()]

    if @HAVE_LIBJASPER@:
        jasper_dir = '@JASPER_DIR@'
        if jasper_dir and jasper_dir != 'system':
            add_attribute(library_dirs=os.path.join(jasper_dir, 'lib'),
                          runtime_library_dirs=os.path.join(jasper_dir, 'lib'))
        add_attribute(libraries='jasper')

    if @HAVE_LIBOPENJPEG@:
        openjpeg_lib_dir = '@OPENJPEG_LIB_DIR@'
        openjpeg_libname = '@OJ_WITHOUT_LIB@'
        if openjpeg_lib_dir:
            add_attribute(library_dirs=openjpeg_lib_dir,
                          runtime_library_dirs=openjpeg_lib_dir)
        add_attribute(libraries=openjpeg_libname)

    # assumes png is supplied by system paths -- may not be true
    if @HAVE_LIBPNG@:
        add_attribute(libraries='png')

    if @HAVE_MEMFS@:
        add_attribute(libraries='eccodes_memfs')

    if @HAVE_AEC@:
        aec_dir = '@AEC_DIR@'
        if aec_dir and aec_dir != 'system':
            add_attribute(library_dirs=os.path.join(aec_dir, 'lib'),
                          runtime_library_dirs=os.path.join(aec_dir, 'lib'))
        add_attribute(libraries='aec')


setup(name='eccodes',
      version='@ECCODES_VERSION_STR@',
      author='ECMWF',
      author_email='Software.Support@ecmwf.int',
      description="""Python 3 interface for ecCodes""",
      license='Apache License, Version 2.0',
      url='https://confluence.ecmwf.int/display/ECC/ecCodes+Home',
      download_url='https://confluence.ecmwf.int/display/ECC/Releases',
      ext_modules=[Extension('gribapi._gribapi_swig', **attdict)],
      packages=['eccodes', 'eccodes.high_level', 'gribapi'])