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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
|
Author: Alastair McKinstry <mckinstry@debian.org>
Description: Python3 changes
Last-Updated: 2021-01-28
Forwarded: no
Index: adios-1.13.1/wrappers/numpy/setup3.py
===================================================================
--- /dev/null
+++ adios-1.13.1/wrappers/numpy/setup3.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+# Author: Jong Choi
+# Contact: choij@ornl.gov
+
+from distutils.extension import Extension
+import numpy as np
+
+# Use mpi4py dist utils: https://bitbucket.org/mpi4py/mpi4py
+#from mpidistutils import setup
+from distutils.core import setup
+from distutils.spawn import find_executable
+from distutils.core import Command
+
+import subprocess
+import sys
+
+m1 = Extension('adios3',
+ sources=['adios3.cpp'],
+ define_macros=[('_NOMPI', None)],
+ include_dirs = [np.get_include(), '../../src/public'],
+ library_dirs = ['../../debian/tmp/usr/lib'],
+ libraries = [],
+ extra_objects = [],
+ extra_compile_args = ['-Wno-uninitialized',
+ '-Wno-unused-function'])
+
+cmd = find_executable("adios_config")
+if cmd == None:
+ sys.stderr.write(
+ "adios_config is not installed nor found. "
+ "Please install Adios or check PATH.\n")
+ sys.exit(-1)
+
+p = subprocess.Popen(["adios_config", "-c", "-s"], stdout=subprocess.PIPE)
+pp = p.communicate()[0].decode(encoding='UTF-8').strip()
+for path in str(pp).split(" "):
+ if path.startswith('-I'):
+ m1.include_dirs.append(path.replace('-I', '', 1))
+
+p = subprocess.Popen(["adios_config", "-l", "-s"], stdout=subprocess.PIPE)
+pp = p.communicate()[0].decode(encoding='UTF-8').strip()
+for path in str(pp).split(" "):
+ if path.startswith('-L'):
+ m1.library_dirs.append(path.replace('-L', '', 1))
+ if path.startswith('-l'):
+ m1.libraries.append(path.replace('-l', '', 1))
+
+class adios_test(Command):
+ user_options = []
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ ##import subprocess
+ ##import sys
+ ##errno = subprocess.call([sys.executable, 'tests/test_adios.py', 'tests/config.xml'])
+ ##raise SystemExit(errno)
+ import os
+ import sys
+ import unittest
+ setup_file = sys.modules['__main__'].__file__
+ setup_dir = os.path.abspath(os.path.dirname(setup_file))
+ test_loader = unittest.defaultTestLoader
+ test_runner = unittest.TextTestRunner()
+ test_suite = test_loader.discover(os.path.join(setup_dir, 'test'))
+ test_runner.run(test_suite)
+
+setup(name = 'adios',
+ version = '1.9.0',
+ description = 'Python Module for Adios',
+ author = 'Jong Choi',
+ author_email = 'yyalli@gmail.com',
+ url = 'http://www.olcf.ornl.gov/center-projects/adios/',
+ cmdclass={'test': adios_test},
+ ext_modules = [m1])
Index: adios-1.13.1/wrappers/numpy/setup3_mpi.py
===================================================================
--- /dev/null
+++ adios-1.13.1/wrappers/numpy/setup3_mpi.py
@@ -0,0 +1,134 @@
+#!/usr/bin/env python3
+# Author: Jong Choi
+# Contact: choij@ornl.gov
+
+
+import os
+import sys
+import getopt
+import numpy as np
+
+## Credit: http://svn.apache.org/repos/asf/subversion/tags/0.20.1/subversion/bindings/swig/python/setup.py
+def _do_usage():
+ print ("Usage: setup.py [OPTIONS] build")
+ print (" setup.py install [--prefix PREFIX]")
+ print (" setup.py install_lib [--install-dir DIR]")
+ print ("")
+ print ("Options:")
+ print (" -I dir " + \
+ "search DIR for includes (multiple instances allowed)")
+ print (" -L dir " + \
+ "search DIR for libraries (multiple instances allowed)")
+ print (" -C option " + \
+ "pass OPTION to the compiler at compile time (multiple instances " + \
+ "allowed)")
+ print (" -R option " + \
+ "pass OPTION to the compiler at link time (multiple instances " + \
+ "allowed)")
+ sys.exit(0)
+
+# Default option values
+include_dirs = ['../../src/public', np.get_include()]
+library_dirs = ['../../debian/tmp/usr/lib']
+extra_compile_args = []
+extra_link_args = []
+
+# No args? Give usage.
+if len(sys.argv) < 2:
+ _do_usage()
+
+# Parse the command-line arguments, keeping what we want and letting
+# distutils have the rest. Distutils parameters should come after
+# the target as in 'python setup.py build --prefix=/usr/local' and
+# parameters for us should appear before the target as in
+# 'python setup.py -I/usr/include build'.
+options, leftovers = getopt.getopt(sys.argv[1:], "I:L:C:R:h",
+ ["help"])
+for option in options:
+ if option[0] == '-I':
+ include_dirs.append(option[1])
+ if option[0] == '-L':
+ library_dirs.append(option[1])
+ if option[0] == '-C':
+ extra_compile_args.append(option[1])
+ if option[0] == '-R':
+ extra_link_args.append(option[1])
+ if option[0] == '-h':
+ _do_usage()
+
+ if option[0] == '--help':
+ _do_usage()
+
+ # All long options just get passed through
+ if option[0][:2] == '--':
+ leftovers.append(option[0])
+ leftovers.append(option[1])
+sys.argv[1:] = leftovers
+
+from distutils.extension import Extension
+
+# Use mpi4py dist utils: https://bitbucket.org/mpi4py/mpi4py
+from conf.mpidistutils import setup
+#from distutils.core import setup
+from distutils.spawn import find_executable
+from distutils.core import Command
+
+import subprocess
+
+extra_compile_args.insert(0, '-Wno-uninitialized')
+extra_compile_args.insert(0, '-Wno-unused-function')
+
+m1 = Extension('adios3_mpi',
+ sources=['adios3_mpi.cpp'],
+ define_macros=[],
+ include_dirs = include_dirs,
+ library_dirs = library_dirs,
+ libraries = [],
+ extra_objects = [],
+ extra_compile_args = extra_compile_args,
+ extra_link_args = extra_link_args)
+
+cmd = find_executable("adios_config")
+if cmd == None:
+ sys.stderr.write(
+ "adios_config is not installed nor found. "
+ "Please install Adios or check PATH.\n")
+ sys.exit(-1)
+
+p = subprocess.Popen(["adios_config", "-c"], stdout=subprocess.PIPE)
+pp = p.communicate()[0].decode(encoding='UTF-8').strip()
+for path in str(pp).split(" "):
+ if path.startswith('-I'):
+ m1.include_dirs.append(path.replace('-I', '', 1))
+
+p = subprocess.Popen(["adios_config", "-l"], stdout=subprocess.PIPE)
+pp = p.communicate()[0].decode(encoding='UTF-8').strip()
+for path in str(pp).split(" "):
+ if path.startswith('-L'):
+ m1.library_dirs.append(path.replace('-L', '', 1))
+ if path.startswith('-l'):
+ m1.libraries.append(path.replace('-l', '', 1))
+
+class adios_test(Command):
+ user_options = []
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ import subprocess
+ import sys
+ errno = subprocess.call([sys.executable, 'tests/test_adios_mpi.py', 'tests/config_mpi.xml'])
+ raise SystemExit(errno)
+
+setup(name = 'adios3_mpi',
+ version = '1.9.0',
+ description = 'Python Module for Adios MPI',
+ author = 'Jong Choi',
+ author_email = 'yyalli@gmail.com',
+ url = 'http://www.olcf.ornl.gov/center-projects/adios/',
+ cmdclass={'test': adios_test},
+ executables = [],
+ ext_modules = [m1])
Index: adios-1.13.1/wrappers/numpy/setup_mpi.py
===================================================================
--- adios-1.13.1.orig/wrappers/numpy/setup_mpi.py
+++ adios-1.13.1/wrappers/numpy/setup_mpi.py
@@ -6,6 +6,7 @@
import os
import sys
import argparse
+import numpy as np
## Credit: http://svn.apache.org/repos/asf/subversion/tags/0.20.1/subversion/bindings/swig/python/setup.py
# def _do_usage():
@@ -27,7 +28,7 @@ import argparse
# sys.exit(0)
# Default option values
-include_dirs = ['../../src/public']
+include_dirs = ['../../src/public', np.get_include()]
library_dirs = ['../../debian/tmp/usr/lib']
extra_compile_args = []
extra_link_args = []
@@ -66,7 +67,6 @@ extra_link_args = []
# sys.argv[1:] = leftovers
from distutils.extension import Extension
-import numpy as np
# Use mpi4py dist utils: https://bitbucket.org/mpi4py/mpi4py
from conf.mpidistutils import setup
@@ -77,7 +77,6 @@ from distutils.core import Command
import subprocess
from subprocess import check_output
-include_dirs.insert(0, np.get_include())
extra_compile_args.insert(0, '-Wno-uninitialized')
extra_compile_args.insert(0, '-Wno-unused-function')
Index: adios-1.13.1/wrappers/numpy/Makefile
===================================================================
--- adios-1.13.1.orig/wrappers/numpy/Makefile
+++ adios-1.13.1/wrappers/numpy/Makefile
@@ -1,17 +1,24 @@
MPI=n
CYTHON=n
+CYTHON3=n
-OBJ = adios.so
+OBJ = adios.so adios3.so
ifeq ($(CYTHON), y)
OBJ := adios.cpp $(OBJ)
endif
+ifeq ($(CYTHON3), y)
+ OBJ := adios3.cpp $(OBJ)
+endif
ifeq ($(MPI),y)
- OBJ += adios_mpi.so
+ OBJ += adios_mpi.so adios3_mpi.so
ifeq ($(CYTHON), y)
OBJ := adios_mpi.cpp $(OBJ)
endif
+ ifeq ($(CYTHON3), y)
+ OBJ := adios3_mpi.cpp $(OBJ)
+ endif
endif
@@ -24,19 +31,31 @@ default:
@echo "> make MPI=y python"
@echo ""
-python: $(OBJ)
+python3: $(OBJ)
adios.cpp: adios.pyx
- cython --cplus adios.pyx
+ cython3 --cplus adios.pyx
+
+adios3.cpp: adios.pyx
+ cython3 --cplus -3 -o adios3.cpp adios.pyx
-adios.so:
- python setup.py build_ext -lrt
+adios.so: adios.cpp
+ python3 setup.py build_ext -lrt
+
+adios3.so: adios3.cpp
+ python3 setup3.py build_ext -lrt
adios_mpi.cpp: adios_mpi.pyx
- cython --cplus adios_mpi.pyx
+ cython3 --cplus adios_mpi.pyx
+
+adios3_mpi.cpp: adios_mpi.pyx
+ cython3 --cplus -3 -o adios3_mpi.cpp adios_mpi.pyx
+
+adios_mpi.so: adios_mpi.cpp
+ python3 setup_mpi.py build
-adios_mpi.so:
- python setup_mpi.py build
+adios3_mpi.so: adios3_mpi.cpp
+ python3 setup3_mpi.py build
clean:
rm -rf build
Index: adios-1.13.1/utils/gpp/type_mapper.py
===================================================================
--- adios-1.13.1.orig/utils/gpp/type_mapper.py
+++ adios-1.13.1/utils/gpp/type_mapper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
c_types = {
'string' : 'string',
Index: adios-1.13.1/utils/skel/bin/skel
===================================================================
--- adios-1.13.1.orig/utils/skel/bin/skel
+++ adios-1.13.1/utils/skel/bin/skel
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import sys
import os.path
Index: adios-1.13.1/utils/skel/bin/skel_cat.py
===================================================================
--- adios-1.13.1.orig/utils/skel/bin/skel_cat.py
+++ adios-1.13.1/utils/skel/bin/skel_cat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import argparse
import os
Index: adios-1.13.1/utils/skel/bin/skel_extract.py
===================================================================
--- adios-1.13.1.orig/utils/skel/bin/skel_extract.py
+++ adios-1.13.1/utils/skel/bin/skel_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
Index: adios-1.13.1/utils/skel/etc/templates/create_suite.tmpl
===================================================================
--- adios-1.13.1.orig/utils/skel/etc/templates/create_suite.tmpl
+++ adios-1.13.1/utils/skel/etc/templates/create_suite.tmpl
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
#for test in $test_plan.get_tests():
<%= '#####Start Test#####' %>
Index: adios-1.13.1/utils/skel/lib/skel_bpls.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_bpls.py
+++ adios-1.13.1/utils/skel/lib/skel_bpls.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+F#!/usr/bin/python3
import re
Index: adios-1.13.1/utils/skel/lib/skel_bpy.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_bpy.py
+++ adios-1.13.1/utils/skel/lib/skel_bpy.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import yaml
Index: adios-1.13.1/utils/skel/lib/skel_install.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_install.py
+++ adios-1.13.1/utils/skel/lib/skel_install.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import skel_settings
Index: adios-1.13.1/utils/skel/lib/skel_makefile.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_makefile.py
+++ adios-1.13.1/utils/skel/lib/skel_makefile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# from __future__ import absolute_import, division, print_function, unicode_literals
from __future__ import print_function, unicode_literals
Index: adios-1.13.1/utils/skel/lib/skel_params.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_params.py
+++ adios-1.13.1/utils/skel/lib/skel_params.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
Index: adios-1.13.1/utils/skel/lib/skel_replay.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_replay.py
+++ adios-1.13.1/utils/skel/lib/skel_replay.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import argparse
import os
Index: adios-1.13.1/utils/skel/lib/skel_settings.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_settings.py
+++ adios-1.13.1/utils/skel/lib/skel_settings.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function
import sys
import os.path
Index: adios-1.13.1/utils/skel/lib/skel_source.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_source.py
+++ adios-1.13.1/utils/skel/lib/skel_source.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
Index: adios-1.13.1/utils/skel/lib/skel_submit.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_submit.py
+++ adios-1.13.1/utils/skel/lib/skel_submit.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
Index: adios-1.13.1/utils/skel/lib/skel_suite.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_suite.py
+++ adios-1.13.1/utils/skel/lib/skel_suite.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import argparse
import os
Index: adios-1.13.1/utils/skel/lib/skel_template.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_template.py
+++ adios-1.13.1/utils/skel/lib/skel_template.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import argparse
import os
Index: adios-1.13.1/utils/skel/lib/skel_test_plan.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_test_plan.py
+++ adios-1.13.1/utils/skel/lib/skel_test_plan.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
import yaml
Index: adios-1.13.1/utils/skel/lib/skel_xml.py
===================================================================
--- adios-1.13.1.orig/utils/skel/lib/skel_xml.py
+++ adios-1.13.1/utils/skel/lib/skel_xml.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
Index: adios-1.13.1/wrappers/numpy/setup.py
===================================================================
--- adios-1.13.1.orig/wrappers/numpy/setup.py
+++ adios-1.13.1/wrappers/numpy/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# Author: Jong Choi
# Contact: choij@ornl.gov
@@ -16,7 +16,7 @@ import sys
from subprocess import check_output
m1 = Extension('adios.adios',
- sources=['adios.cpp'],
+ sources=['adios3.cpp'],
define_macros=[('_NOMPI', None)],
include_dirs = [np.get_include(), '../../src/public'],
library_dirs = ['../../debian/tmp/usr/lib'],
|