From 584a32c8dec1647fa194b5c2db79ef5f61f176c6 Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Thu, 9 Mar 2017 14:24:51 -0800 Subject: Converted python interface to AMReX Also added python level time step and incomplete wrap to access the fields. --- Python/setup.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'Python/setup.py') diff --git a/Python/setup.py b/Python/setup.py index a9d32134d..3c33a6b3a 100644 --- a/Python/setup.py +++ b/Python/setup.py @@ -14,30 +14,33 @@ try: except AttributeError: numpy_include = numpy.get_numpy_include() -boxlib_home = os.environ.get('BOXLIB_HOME', '../../BoxLib') -boxlib_includes = ['Src/C_BaseLib', - 'Src/C_ParticleLib', - 'Src/C_BoundaryLib', - 'Src/C_AmrCoreLib', - 'Tools/C_scripts'] -boxlib_includes = [os.path.join(boxlib_home, ii) for ii in boxlib_includes] - -include_dirs = [numpy_include, '../Source'] + boxlib_includes - -cpp11_flags = ['-std=c++11'] -if platform.system() == "Darwin": - macosx_deployment_target = platform.mac_ver()[0] - os.environ['MACOSX_DEPLOYMENT_TARGET'] = macosx_deployment_target - cpp11_flags.append("-stdlib=libc++") +amrex_home = os.environ.get('AMREX_HOME', '../../amrex') +amrex_includes = ['Src/Base', + 'Src/Particle', + 'Src/Boundary', + 'Src/AmrCore', + 'Tools/scripts'] +amrex_includes = [os.path.join(amrex_home, ii) for ii in amrex_includes] + +include_dirs = [numpy_include, '../Source'] + amrex_includes + +definesstring = os.environ.get('DEFINES','') +defines = definesstring.split(' ') + +#cpp11_flags = [] #['-std=c++11'] +#if platform.system() == "Darwin": +# macosx_deployment_target = platform.mac_ver()[0] +# os.environ['MACOSX_DEPLOYMENT_TARGET'] = macosx_deployment_target +# cpp11_flags.append("-stdlib=libc++") example_module = Extension('pywarpx._warpxC', - swig_opts=['-c++', '-outdir', 'pywarpx'], + swig_opts=['-c++', '-outdir', 'pywarpx'] + defines, sources=['warpxC.i'], library_dirs=['.'], libraries=['warpx'], include_dirs = include_dirs, - define_macros = [('BL_USE_MPI','1'), ('BL_SPACEDIM','3'), ('BL_FORT_USE_UNDERSCORE','1'), ('USE_PARTICLES', None)], - extra_compile_args = cpp11_flags, + #define_macros = [('BL_USE_MPI','1'), ('BL_SPACEDIM','3'), ('BL_FORT_USE_UNDERSCORE','1'), ('USE_PARTICLES', None)], + #extra_compile_args = cpp11_flags, ) setup (name = 'pywarpx', -- cgit v1.2.3