pyclaw
pyclaw copied to clipboard
Add preliminary BoxLib based backend.
This PR adds preliminary support for a state backend based on BoxLib. To use this backend you need to install PyBoxLib:
git clone https://ccse.lbl.gov/pub/Downloads/BoxLib.git
cd BoxLib/Src/Python
python setup.py install --user
Next, create a symlink in clawpack/clawpack to the boxclaw module:
cd clawpack/clawpack
ln -s ../../pyclaw/src/boxclaw boxclaw
Now you should be good to go!
cd clawpack/pyclaw/examples/acoustics_1d_homogeneous
python acoustics_1d.py use_boxlib=True
The structure of this looks good. I think we will need to set up a corresponding PR in clawpack/clawpack to properly incorporate BoxClaw, and I can also set up a hashdist build to verify this.
I'd also like to see at least one or two regression tests before we merge this. Is there any documentation outside of the examples?
Coverage decreased (-0.03%) when pulling df096d2ae10ac5cae4512e30f7198308c0811328 on memmett:boxlib into e646b1afe243b1c0a9c00d127dde8f30bb41db04 on clawpack:master.
I will get some regression tests running... do they need to be MPI enabled at this stage?
No.
On Mon, Jul 14, 2014 at 12:28 PM, Matthew Emmett [email protected] wrote:
I will get some regression tests running... do they need to be MPI enabled at this stage?
— Reply to this email directly or view it on GitHub https://github.com/clawpack/pyclaw/pull/438#issuecomment-48947910.
Yeah, serial is fine for now -- it will be great to have this available.
Coverage decreased (-0.04%) when pulling 309fe7801b927dd5f9327bb4d2f0d9d660fa59e2 on memmett:boxlib into e646b1afe243b1c0a9c00d127dde8f30bb41db04 on clawpack:master.
Coverage decreased (-0.04%) when pulling d13de03c73830899b9165d3aa5f771eb9d6b749a on memmett:boxlib into e646b1afe243b1c0a9c00d127dde8f30bb41db04 on clawpack:master.
I have added two regression tests. The easiest (fewest lines of code) way to do this was by monkey patching the build_variant_arg_dicts routine in pyclaw.utils. A better long term solution should probably be worked out when BoxClaw becomes a first (second?) class citizen of PyClaw.
Coverage decreased (-0.11%) when pulling 2fbf81e63e51a9cb87984cbb302b407928922658 on memmett:boxlib into e646b1afe243b1c0a9c00d127dde8f30bb41db04 on clawpack:master.
There are some hardcode paths that need to be modified in order for BoxLib to compile:
- Line 5 of
Src/Python/GNUmakefile_CXX.makshould point to the directory from which you cloned BoxLib - You must set
MPIHOMEto the location of your MPI installation inTools/F_mk/GMakeMPI.mak b/Tools/F_mk/GMakeMPI.mak
After I did that, I did compile some files, but I got the following error at what I believe is the linking step:
mpif90 -shared -o build/temp.macosx-10.5-x86_64-2.7/_bl1.so o/1d.Darwin.g++.gfortran.MPI.EXE/BoxLib.o o/1d.Darwin.g++.gfortran.MPI.EXE/ParmParse.o o/1d.Darwin.g++.gfortran.MPI.EXE/Utility.o o/1d.Darwin.g++.gfortran.MPI.EXE/UseCount.o o/1d.Darwin.g++.gfortran.MPI.EXE/DistributionMapping.o o/1d.Darwin.g++.gfortran.MPI.EXE/ParallelDescriptor.o o/1d.Darwin.g++.gfortran.MPI.EXE/VisMF.o o/1d.Darwin.g++.gfortran.MPI.EXE/Arena.o o/1d.Darwin.g++.gfortran.MPI.EXE/BArena.o o/1d.Darwin.g++.gfortran.MPI.EXE/CArena.o o/1d.Darwin.g++.gfortran.MPI.EXE/FabConv.o o/1d.Darwin.g++.gfortran.MPI.EXE/FPC.o o/1d.Darwin.g++.gfortran.MPI.EXE/Box.o o/1d.Darwin.g++.gfortran.MPI.EXE/IntVect.o o/1d.Darwin.g++.gfortran.MPI.EXE/IndexType.o o/1d.Darwin.g++.gfortran.MPI.EXE/Orientation.o o/1d.Darwin.g++.gfortran.MPI.EXE/RealBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxList.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxArray.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxDomain.o o/1d.Darwin.g++.gfortran.MPI.EXE/FArrayBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/IArrayBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/BaseFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/MultiFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/iMultiFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/FabArray.o o/1d.Darwin.g++.gfortran.MPI.EXE/CoordSys.o o/1d.Darwin.g++.gfortran.MPI.EXE/Geometry.o o/1d.Darwin.g++.gfortran.MPI.EXE/COORDSYS_1D.o o/1d.Darwin.g++.gfortran.MPI.EXE/SPECIALIZE_1D.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLutil_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLParmParse_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLBoxLib_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/boxlib_wrap_1.o -lstdc++
Undefined symbols for architecture x86_64:
"_PyArg_ParseTuple", referenced from:
__wrap_StartParallel in boxlib_wrap_1.o
__wrap_rank in boxlib_wrap_1.o
__wrap_size in boxlib_wrap_1.o
__wrap_ReduceRealMax in boxlib_wrap_1.o
__wrap_open_ifstream in boxlib_wrap_1.o
__wrap_open_ofstream in boxlib_wrap_1.o
__wrap_close_ofstream in boxlib_wrap_1.o
...
"_PyArg_UnpackTuple", referenced from:
_SwigPyObject_own in boxlib_wrap_1.o
"_PyBool_FromLong", referenced from:
_SwigPyObject_richcompare in boxlib_wrap_1.o
_SwigPyObject_own in boxlib_wrap_1.o
__wrap_Box_ok in boxlib_wrap_1.o
__wrap_Box_contains in boxlib_wrap_1.o
__wrap_Box_intersects in boxlib_wrap_1.o
__wrap_Box_sameSize in boxlib_wrap_1.o
__wrap_Box_sameType in boxlib_wrap_1.o
...
"_PyCObject_AsVoidPtr", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyCObject_Type", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyCallable_Check", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
"_PyCapsule_GetPointer", referenced from:
_SWIG_Python_DestroyModule in boxlib_wrap_1.o
"_PyCapsule_Import", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyCapsule_New", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyClass_Type", referenced from:
_SwigPyClientData_New in boxlib_wrap_1.o
"_PyDict_GetItem", referenced from:
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"_PyDict_New", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
"_PyDict_SetItem", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
"_PyDict_SetItemString", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyErr_Clear", referenced from:
_init_bl1 in boxlib_wrap_1.o
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_IntVect_shift in boxlib_wrap_1.o
__wrap_IntVect___getitem__ in boxlib_wrap_1.o
__wrap_IntVect___setitem__ in boxlib_wrap_1.o
__wrap_Box_shift in boxlib_wrap_1.o
__wrap_Box_shiftHalf in boxlib_wrap_1.o
...
"_PyErr_Format", referenced from:
obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
require_dimensions(tagPyArrayObject_fields*, int) in boxlib_wrap_1.o
require_dimensions_n(tagPyArrayObject_fields*, int*, int) in boxlib_wrap_1.o
require_size(tagPyArrayObject_fields*, long*, int) in boxlib_wrap_1.o
_init_bl1 in boxlib_wrap_1.o
__wrap_new_RealBox in boxlib_wrap_1.o
__wrap_new_Geometry in boxlib_wrap_1.o
...
"_PyErr_Occurred", referenced from:
_init_bl1 in boxlib_wrap_1.o
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_IntVect_shift in boxlib_wrap_1.o
__wrap_IntVect___getitem__ in boxlib_wrap_1.o
__wrap_IntVect___setitem__ in boxlib_wrap_1.o
__wrap_Box_shift in boxlib_wrap_1.o
__wrap_Box_shiftHalf in boxlib_wrap_1.o
...
"_PyErr_Print", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyErr_SetObject", referenced from:
__wrap_SwigPyIterator_value in boxlib_wrap_1.o
__wrap_SwigPyIterator_incr in boxlib_wrap_1.o
__wrap_SwigPyIterator_decr in boxlib_wrap_1.o
__wrap_SwigPyIterator_distance in boxlib_wrap_1.o
__wrap_SwigPyIterator_equal in boxlib_wrap_1.o
__wrap_SwigPyIterator_next in boxlib_wrap_1.o
__wrap_SwigPyIterator___next__ in boxlib_wrap_1.o
...
"_PyErr_SetString", referenced from:
require_contiguous(tagPyArrayObject_fields*) in boxlib_wrap_1.o
require_native(tagPyArrayObject_fields*) in boxlib_wrap_1.o
_init_bl1 in boxlib_wrap_1.o
__wrap_ReduceRealMax in boxlib_wrap_1.o
__wrap_open_ifstream in boxlib_wrap_1.o
__wrap_open_ofstream in boxlib_wrap_1.o
__wrap_close_ofstream in boxlib_wrap_1.o
...
"_PyExc_AttributeError", referenced from:
_init_bl1 in boxlib_wrap_1.o
_tmp71 in boxlib_wrap_1.o
"_PyExc_IOError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_ImportError", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyExc_IndexError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_MemoryError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_NotImplementedError", referenced from:
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_new_Box in boxlib_wrap_1.o
__wrap_Box_contains in boxlib_wrap_1.o
__wrap_Box_grow in boxlib_wrap_1.o
__wrap_Box_growLo in boxlib_wrap_1.o
__wrap_Box_growHi in boxlib_wrap_1.o
__wrap_new_FArrayBox in boxlib_wrap_1.o
...
"_PyExc_OverflowError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_RuntimeError", referenced from:
_init_bl1 in boxlib_wrap_1.o
__wrap_ReduceRealMax in boxlib_wrap_1.o
__wrap_open_ifstream in boxlib_wrap_1.o
__wrap_open_ofstream in boxlib_wrap_1.o
__wrap_close_ofstream in boxlib_wrap_1.o
__wrap_close_ifstream in boxlib_wrap_1.o
__wrap_new_IntVect in boxlib_wrap_1.o
...
"_PyExc_StopIteration", referenced from:
__wrap_SwigPyIterator_value in boxlib_wrap_1.o
__wrap_SwigPyIterator_incr in boxlib_wrap_1.o
__wrap_SwigPyIterator_decr in boxlib_wrap_1.o
__wrap_SwigPyIterator_next in boxlib_wrap_1.o
__wrap_SwigPyIterator___next__ in boxlib_wrap_1.o
__wrap_SwigPyIterator_previous in boxlib_wrap_1.o
__wrap_SwigPyIterator_advance in boxlib_wrap_1.o
...
"_PyExc_SyntaxError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_SystemError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyExc_TypeError", referenced from:
obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
require_contiguous(tagPyArrayObject_fields*) in boxlib_wrap_1.o
require_native(tagPyArrayObject_fields*) in boxlib_wrap_1.o
require_dimensions(tagPyArrayObject_fields*, int) in boxlib_wrap_1.o
require_dimensions_n(tagPyArrayObject_fields*, int*, int) in boxlib_wrap_1.o
require_size(tagPyArrayObject_fields*, long*, int) in boxlib_wrap_1.o
__wrap_SwigPyIterator_advance in boxlib_wrap_1.o
...
"_PyExc_ValueError", referenced from:
__wrap_close_ofstream in boxlib_wrap_1.o
__wrap_close_ifstream in boxlib_wrap_1.o
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_new_Box in boxlib_wrap_1.o
__wrap_Box_contains in boxlib_wrap_1.o
__wrap_Box_intersects in boxlib_wrap_1.o
__wrap_Box_sameSize in boxlib_wrap_1.o
...
"_PyExc_ZeroDivisionError", referenced from:
_tmp71 in boxlib_wrap_1.o
"_PyFile_Type", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
"_PyFloat_AsDouble", referenced from:
SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
"_PyFloat_FromDouble", referenced from:
__wrap_ReduceRealMax in boxlib_wrap_1.o
__wrap_FArrayBox_norm in boxlib_wrap_1.o
__wrap_FArrayBox_min in boxlib_wrap_1.o
__wrap_FArrayBox_max in boxlib_wrap_1.o
__wrap_FArrayBox_sum in boxlib_wrap_1.o
__wrap_FArrayBox_valIV in boxlib_wrap_1.o
__wrap_MultiFab_min in boxlib_wrap_1.o
...
"_PyFloat_Type", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
__wrap_FArrayBox_setVal in boxlib_wrap_1.o
__wrap_FArrayBox_setValIV in boxlib_wrap_1.o
__wrap_FArrayBox___mul__ in boxlib_wrap_1.o
__wrap_MultiFab_setVal in boxlib_wrap_1.o
__wrap_MultiFab_setBndry in boxlib_wrap_1.o
SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
...
"_PyImport_ImportModule", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyInstance_NewRaw", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
"_PyInstance_Type", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"_PyInt_AsLong", referenced from:
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_IntVect_shift in boxlib_wrap_1.o
__wrap_IntVect___getitem__ in boxlib_wrap_1.o
__wrap_IntVect___setitem__ in boxlib_wrap_1.o
__wrap_Box_shift in boxlib_wrap_1.o
__wrap_Box_shiftHalf in boxlib_wrap_1.o
__wrap_Box_surroundingNodes in boxlib_wrap_1.o
...
"_PyInt_FromLong", referenced from:
_init_bl1 in boxlib_wrap_1.o
__wrap_rank in boxlib_wrap_1.o
__wrap_size in boxlib_wrap_1.o
__wrap_IntVect___getitem__ in boxlib_wrap_1.o
__wrap_IntVect___len__ in boxlib_wrap_1.o
__wrap_IntVect___cmp__ in boxlib_wrap_1.o
__wrap_Box___cmp__ in boxlib_wrap_1.o
...
"_PyLong_AsDouble", referenced from:
__wrap_FArrayBox_setVal in boxlib_wrap_1.o
__wrap_FArrayBox_setValIV in boxlib_wrap_1.o
__wrap_FArrayBox___mul__ in boxlib_wrap_1.o
__wrap_MultiFab_setVal in boxlib_wrap_1.o
__wrap_MultiFab_setBndry in boxlib_wrap_1.o
SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
"_PyLong_AsLong", referenced from:
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_IntVect_shift in boxlib_wrap_1.o
__wrap_IntVect___getitem__ in boxlib_wrap_1.o
__wrap_IntVect___setitem__ in boxlib_wrap_1.o
__wrap_Box_shift in boxlib_wrap_1.o
__wrap_Box_shiftHalf in boxlib_wrap_1.o
__wrap_Box_surroundingNodes in boxlib_wrap_1.o
...
"_PyLong_AsUnsignedLong", referenced from:
__wrap_SwigPyIterator_incr in boxlib_wrap_1.o
__wrap_SwigPyIterator_decr in boxlib_wrap_1.o
"_PyLong_FromLong", referenced from:
__wrap_Box_numPts in boxlib_wrap_1.o
__wrap_Box_volume in boxlib_wrap_1.o
__wrap_Box_index in boxlib_wrap_1.o
__wrap_SwigPyIterator_distance in boxlib_wrap_1.o
__wrap_SwigPyIterator___sub__ in boxlib_wrap_1.o
"_PyLong_FromVoidPtr", referenced from:
_SwigPyObject_long in boxlib_wrap_1.o
_SwigPyObject_format in boxlib_wrap_1.o
"_PyModule_AddObject", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyModule_GetDict", referenced from:
_init_bl1 in boxlib_wrap_1.o
"_PyModule_Type", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
"_PyObject_Call", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
"_PyObject_CallFunctionObjArgs", referenced from:
_SwigPyObject_dealloc in boxlib_wrap_1.o
_SWIG_Python_ConvertPtrAndOwn in boxlib_wrap_1.o
"_PyObject_Free", referenced from:
_init_bl1 in boxlib_wrap_1.o
_SwigPyPacked_dealloc in boxlib_wrap_1.o
_SwigPyObject_dealloc in boxlib_wrap_1.o
"_PyObject_GenericGetAttr", referenced from:
_tmp in boxlib_wrap_1.o
_tmp71 in boxlib_wrap_1.o
"_PyObject_GetAttr", referenced from:
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"_PyObject_GetAttrString", referenced from:
_init_bl1 in boxlib_wrap_1.o
_SwigPyClientData_New in boxlib_wrap_1.o
"_PyObject_Init", referenced from:
_init_bl1 in boxlib_wrap_1.o
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SwigPyObject_dealloc in boxlib_wrap_1.o
"_PyObject_IsTrue", referenced from:
_SwigPyObject_own in boxlib_wrap_1.o
__wrap_MultiFab_FillBoundary in boxlib_wrap_1.o
__wrap_Geometry_FillPeriodicBoundary in boxlib_wrap_1.o
"_PyObject_Malloc", referenced from:
_init_bl1 in boxlib_wrap_1.o
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SwigPyObject_dealloc in boxlib_wrap_1.o
"_PyObject_Size", referenced from:
__wrap_new_IntVect in boxlib_wrap_1.o
__wrap_new_Box in boxlib_wrap_1.o
__wrap_Box_contains in boxlib_wrap_1.o
__wrap_Box_grow in boxlib_wrap_1.o
__wrap_Box_growLo in boxlib_wrap_1.o
__wrap_Box_growHi in boxlib_wrap_1.o
__wrap_new_FArrayBox in boxlib_wrap_1.o
...
"_PyString_AsString", referenced from:
_SwigPyObject_print in boxlib_wrap_1.o
SWIG_AsCharPtrAndSize(_object*, char**, unsigned long*, int*) in boxlib_wrap_1.o
"_PyString_AsStringAndSize", referenced from:
SWIG_AsCharPtrAndSize(_object*, char**, unsigned long*, int*) in boxlib_wrap_1.o
"_PyString_ConcatAndDel", referenced from:
_SwigPyObject_repr in boxlib_wrap_1.o
"_PyString_Format", referenced from:
_SwigPyObject_format in boxlib_wrap_1.o
"_PyString_FromFormat", referenced from:
_SwigPyPacked_repr in boxlib_wrap_1.o
_SwigPyPacked_str in boxlib_wrap_1.o
_SwigPyObject_repr in boxlib_wrap_1.o
"_PyString_FromString", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SwigPyPacked_str in boxlib_wrap_1.o
_SwigPyObject_str in boxlib_wrap_1.o
_SwigPyObject_format in boxlib_wrap_1.o
_SWIG_Python_DestroyModule in boxlib_wrap_1.o
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"_PyString_FromStringAndSize", referenced from:
__wrap_IntVect___str__ in boxlib_wrap_1.o
__wrap_Box___str__ in boxlib_wrap_1.o
__wrap_FArrayBox___str__ in boxlib_wrap_1.o
__wrap_BoxArray___str__ in boxlib_wrap_1.o
"_PyTuple_New", referenced from:
_SwigPyObject_format in boxlib_wrap_1.o
_SwigPyClientData_New in boxlib_wrap_1.o
"_PyTuple_SetItem", referenced from:
_SwigPyObject_format in boxlib_wrap_1.o
_SwigPyClientData_New in boxlib_wrap_1.o
"_PyType_IsSubtype", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
obj_to_array_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
obj_to_array_contiguous_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
obj_to_array_fortran_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
__wrap_FArrayBox_setVal in boxlib_wrap_1.o
__wrap_FArrayBox_setValIV in boxlib_wrap_1.o
...
"_PyType_Ready", referenced from:
_init_bl1 in boxlib_wrap_1.o
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SwigPyPacked_dealloc in boxlib_wrap_1.o
_SwigPyObject_dealloc in boxlib_wrap_1.o
_SwigPyObject_append in boxlib_wrap_1.o
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"_Py_InitModule4_64", referenced from:
_init_bl1 in boxlib_wrap_1.o
"__PyInstance_Lookup", referenced from:
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"__PyObject_GetDictPtr", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"__PyObject_New", referenced from:
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
"__PyWeakref_CallableProxyType", referenced from:
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"__PyWeakref_ProxyType", referenced from:
_SWIG_Python_GetSwigThis in boxlib_wrap_1.o
"__Py_NoneStruct", referenced from:
pytype_string(_object*) in boxlib_wrap_1.o
_init_bl1 in boxlib_wrap_1.o
_SWIG_Python_NewPointerObj in boxlib_wrap_1.o
_SwigPyObject_disown in boxlib_wrap_1.o
_SwigPyObject_acquire in boxlib_wrap_1.o
_SwigPyObject_own in boxlib_wrap_1.o
_SwigPyObject_append in boxlib_wrap_1.o
...
"__Py_NotImplementedStruct", referenced from:
_SwigPyObject_richcompare in boxlib_wrap_1.o
__wrap_FArrayBox___mul__ in boxlib_wrap_1.o
__wrap_SwigPyIterator___sub__ in boxlib_wrap_1.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [build/temp.macosx-10.5-x86_64-2.7/_bl1.so] Error 1
make: *** [all] Error 2
********************************************************************************
error: can't copy 'build/temp.macosx-10.5-x86_64-2.7/_bl1.so': doesn't exist or not a regular file
Oops, didn't notice that hardcoded path -- I will make it relative. Unfortunately I don't have access to an OSX machine, so wasn't able to test the build step on a Mac. Looking at the comments in GMakeMPI.mak, it looks like you need to set your MPIHOME environment variable before building. Finally, are you using GNU compilers? It looks as though the -shared flag isn't doing what I'd expect it to do...
Yes, I'm using GNU compilers.
I got through using some of @ketch's modifications but ran into the following errors when compiling BoxLib:
python setup.py install --prefix="~/src/envs/claw/"
running install
running build
running build_py
running build_boxlib
creating build/temp.macosx-10.6-intel-2.7
compiling boxlib
********************************************************************************
make -f GNUmakefile_CXX.mak DIM=1 OUT=build/temp.macosx-10.6-intel-2.7
Compiling MultiFab.cpp ...
mpic++ -Wno-deprecated -ftemplate-depth-64 -g -O3 -DMPICH_IGNORE_CXX_SEEK -fPIC -D__USE_XOPEN2K8 -DNDEBUG -DBL_USE_MPI -DMPICH_SKIP_MPICXX -DBL_GCC_VERSION='4.8.2' -DBL_GCC_MAJOR_VERSION=4 -DBL_GCC_MINOR_VERSION=8 -DBL_SPACEDIM=1 -DBL_FORT_USE_UNDERSCORE -DBL_Darwin -I/usr/local/Cellar/mpich2/3.1.1/include -I/usr/local/Cellar/mpich2/3.1.1/include -I. -Isrc -I/Users/mandli/src/BoxLib/Src/C_BaseLib -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Users/mandli/src/envs/claw/lib/python2.7/site-packages/numpy/core/include -c /Users/mandli/src/BoxLib/Src/C_BaseLib/MultiFab.cpp -o o/1d.Darwin.g++.gfortran.MPI.EXE/MultiFab.o
In file included from /Users/mandli/src/BoxLib/Src/C_BaseLib/MultiFab.cpp:3:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: fatal error:
recursive template instantiation exceeded maximum depth of 64
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
in instantiation of template class 'std::__1::__log2_imp<4294967296, 4>' requested here
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
in instantiation of template class 'std::__1::__log2_imp<4294967296, 5>' requested here
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
in instantiation of template class 'std::__1::__log2_imp<4294967296, 6>' requested here
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
in instantiation of template class 'std::__1::__log2_imp<4294967296, 7>' requested here
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
in instantiation of template class 'std::__1::__log2_imp<4294967296, 8>' requested here
: __log2_imp<_Xp, _Rp - 1>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
(skipping 55 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2796:49: note:
in instantiation of template class 'std::__1::__log2<unsigned long long, 4294967296>' requested
here
static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2965:41: note:
in instantiation of template class 'std::__1::__independent_bits_engine<std::__1::__rs_default,
unsigned long long>' requested here
return static_cast<result_type>(_Eng(__g, _Dt)());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:3020:40: note:
in instantiation of function template specialization
'std::__1::uniform_int_distribution<long>::operator()<std::__1::__rs_default>' requested here
difference_type __i = __uid(__g, _Pp(0, __d));
^
/Users/mandli/src/BoxLib/Src/C_BaseLib/FabArray.H:2350:14: note: in instantiation of function
template specialization 'std::__1::random_shuffle<std::__1::__wrap_iter<int *> >' requested
here
std::random_shuffle(indices.begin(), indices.end());
^
/Users/mandli/src/BoxLib/Src/C_BaseLib/MultiFab.cpp:1096:30: note: in instantiation of member
function 'FabArray<FArrayBox>::FillBoundary' requested here
FabArray<FArrayBox>::FillBoundary(scomp,ncomp,cross);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:2741:46: note:
use -ftemplate-depth=N to increase recursive template instantiation depth
: __log2_imp<_Xp, _Rp - 1>::value;
^
1 error generated.
make[1]: *** [o/1d.Darwin.g++.gfortran.MPI.EXE/MultiFab.o] Error 1
make: *** [all] Error 2
********************************************************************************
I thought BoxLib was Fortran primarily so I am a little confused by these errors. Is this wrapper code or the C++ implementation of BoxLib rearing it's head?
Wow, I've never seen that error message before.
There are two versions of BoxLib: a pure F90 version, and a C++/F90
version. PyBoxLib wraps the C++ version using SWIG. Looks like the error
message you are getting is triggered by C++ BoxLib code (ie, not the
wrapper code), but the error is deep within your C++
We do have users that run BoxLib on OSX machines. My guess is they're all
using GNU compilers (maybe this has implications for the
I'll try getting my hands on an OSX virtual machine, or something, to fix these issues.
I default to Clang since it seems to play more nicely with Python on OS X. Honestly this is really an issue on how my system is setup although I am surprised that Clang has an issue with the C++ by itself.
@mandli @ketch What versions of OS X are you guys running? Can you give some details on how you installed your compilers? I will try to recreate your environments and get the build working properly.
10.9.4 with
$ clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
and
$ gfortran --version
GNU Fortran (GCC) 4.8.2
I'm running OS X 10.8.5.
g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
~ » gfortran --version
GNU Fortran (GCC) 4.8.1
Can't remember now where I got that. Probably homebrew.
@ketch I just pushed a change to BoxLib in an attempt to get it to link properly. Can you try it out?
Hmmm, I'm getting errors in the compile phase now:
» python setup.py install --user
running install
running build
running build_py
running build_boxlib
compiling boxlib
********************************************************************************
make -f GNUmakefile_CXX.mak DIM=1 OUT=build/temp.macosx-10.5-x86_64-2.7
Depending /Users/ketch/BoxLib/Src/C_BaseLib/iMultiFab.cpp ...
Depending /Users/ketch/BoxLib/Src/C_BaseLib/MultiFab.cpp ...
Depending /Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp ...
Compiling FArrayBox.cpp ...
mpic++ -Wno-deprecated -ftemplate-depth-64 -g -O3 -DMPICH_IGNORE_CXX_SEEK -fPIC -D__USE_XOPEN2K8 -DNDEBUG -DBL_USE_MPI -DMPICH_SKIP_MPICXX -DBL_GCC_VERSION='4.2.1' -DBL_GCC_MAJOR_VERSION=4 -DBL_GCC_MINOR_VERSION=2 -DBL_SPACEDIM=1 -DBL_FORT_USE_UNDERSCORE -DBL_Darwin -I/Users/ketch/Research/Software/petsc-3.3-p7/pyclaw64/include -I/Users/ketch/Research/Software/petsc-3.3-p7/pyclaw64/include -I. -Isrc -I/Users/ketch/BoxLib/Src/C_BaseLib -I/Users/ketch/anaconda/include/python2.7 -I/Users/ketch/anaconda/lib/python2.7/site-packages/numpy/core/include -c /Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp -o o/1d.Darwin.g++.gfortran.MPI.EXE/FArrayBox.o
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:171:13: error: use of undeclared identifier 'isnan';
did you mean 'std::isnan'?
if (isnan(*dp++))
^~~~~
std::isnan
/usr/include/c++/4.2.1/cmath:550:5: note: 'std::isnan' declared here
isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); }
^
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:191:17: error: use of undeclared identifier 'isnan';
did you mean 'std::isnan'?
if (isnan(this->operator()(p,scomp+i)))
^~~~~
std::isnan
/usr/include/c++/4.2.1/cmath:550:5: note: 'std::isnan' declared here
isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); }
^
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:219:17: error: use of undeclared identifier 'isnan';
did you mean 'std::isnan'?
if (isnan(this->operator()(p,scomp+i)))
^~~~~
std::isnan
/usr/include/c++/4.2.1/cmath:550:5: note: 'std::isnan' declared here
isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); }
^
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:236:13: error: use of undeclared identifier 'isinf'
if (isinf(*dp++))
^
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:254:17: error: use of undeclared identifier 'isinf'
if (isinf(this->operator()(p,scomp+i)))
^
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:280:17: error: use of undeclared identifier 'isinf'
if (isinf(this->operator()(p,scomp+i)))
^
6 errors generated.
make[1]: *** [o/1d.Darwin.g++.gfortran.MPI.EXE/FArrayBox.o] Error 1
make: *** [all] Error 2
********************************************************************************
error: can't copy 'build/temp.macosx-10.5-x86_64-2.7/_bl1.so': doesn't exist or not a regular file
@ketch It looks like the version of g++ you are (currently) using is 4.2.1, but your gfortran is 4.8.1. Is that intentional? Did something in your environment change recently? I don't think we support g++ 4.2 anymore.
My guess is that it's a problem with something in the chain using the apple approved GCC tool-chain rather than what he installed. That's also somewhat of the problem I am having as well although I thought I had fixed it before.
Yes, it's intentional. The g++ is the one that comes with the mac; since it was already there, I didn't need to install one. But gfortran does not come with the mac, so I had to install one.
I'm willing to install a different set of compilers if that's what you suggest. But this setup hasn't caused problems for me before, as far as I know.
Could you try with g++ 4.8? The offending code in FArrayBox.cpp was changed recently to support the latest Cray compilers. Perhaps the calls to isnan and isinf were not being seen by your g++ before the recent change. Regardless, we build against gcc 4.4 regularly and I use gcc 4.9 locally.
Okay, I installed g++ 4.8 and now it compiles a bunch of stuff but eventually still fails with the error about isnan. Note that I have
~ » mpic++ --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
Is that a problem? And how can I get a newer version? That's the version that brew gives me.
Just realised that the Makefile is setting flags appropriate for GCC, but your mpic++ is picking up the LLVM compilers. Are you using MPICH? Can you set MPICH_CXX=/path/to/g++?
Honestly, I don't know how to do what you're asking. You literally want me to
export MPICH_CXX=/usr/local/bin/g++-4.8
? That doesn't fix the problem.
Ok, let me install LLVM locally and see how it goes.
Just to follow up on your last attempt, what is the output of:
export MPICH_CXX=/usr/local/bin/g++-4.8
mpic++ --version
Src/Python - [master●] » export MPICH_CXX=/usr/local/bin/g++-4.8
Src/Python - [master●] » mpic++ --version
g++-4.8 (Homebrew gcc 4.8.3_1) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and here's a bit of the error message I currently get:
make -f GNUmakefile_CXX.mak DIM=1 OUT=build/temp.macosx-10.5-x86_64-2.7
Compiling FArrayBox.cpp ...
mpic++ -Wno-deprecated -ftemplate-depth-64 -g -O3 -DMPICH_IGNORE_CXX_SEEK -fPIC -D__USE_XOPEN2K8 -DNDEBUG -DBL_USE_MPI -DMPICH_SKIP_MPICXX -DBL_GCC_VERSION='4.2.1' -DBL_GCC_MAJOR_VERSION=4 -DBL_GCC_MINOR_VERSION=2 -DBL_SPACEDIM=1 -DBL_FORT_USE_UNDERSCORE -DBL_Darwin -I/usr/local/bin/include -I/usr/local/bin/include -I. -Isrc -I/Users/ketch/BoxLib/Src/C_BaseLib -I/Users/ketch/anaconda/include/python2.7 -I/Users/ketch/anaconda/lib/python2.7/site-packages/numpy/core/include -c /Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp -o o/1d.Darwin.g++-4.8.gfortran.MPI.EXE/FArrayBox.o
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp: In member function 'bool FArrayBox::contains_nan() const':
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:171:24: error: 'isnan' was not declared in this scope
if (isnan(*dp++))