[Trilinos-Users] [EXTERNAL] `import PyTrilinos.ML` fails with Trilinos 12.10.1 and swig 3.0.11
Bill Spotz
wfspotz at me.com
Fri Jan 6 17:47:48 EST 2017
I was able to install swig 3.0.11 and to reproduce this error. Sometimes, swig can get a little confused and interpret a class as virtual even though it should be treated as concrete. In these cases, it defines a python class constructor (__init__) that raises this exception.
It its supposed to be possible to override this behavior with the swig directive
%feature(“notabstract”) ClassName;
There is a little bit of uncertainty here because the class is templated. But I tried every combination I could think of, and I cannot get rid of the “abstract constructor” problem.
I will try to condense this to an example I can submit to the swig developers for debugging. In the mean time, don’t use swig 3.0.11 to build PyTrilinos.
> On Jan 5, 2017, at 3:41 PM, Guyer, Jonathan E. Dr. (Fed) <jonathan.guyer at nist.gov> wrote:
>
> For further info, swig 3.0.10 builds successfully without the faulty constructor
>
>> On Jan 4, 2017, at 1:44 PM, Guyer, Jonathan E. Dr. (Fed) <jonathan.guyer at nist.gov> wrote:
>>
>> The build succeeds, but the python import fails when it runs into an abstract constructor:
>>
>> ```
>> import PyTrilinos.ML
>>
>> Traceback (most recent call last):
>> File "/Users/guyer/anaconda/conda-bld/trilinos_1483368454886/test_tmp/run_test.py", line 33, in <module>
>> import PyTrilinos.ML
>> File "/Users/guyer/anaconda/conda-bld/trilinos_1483368454886/_t_env/lib/python2.7/site-packages/PyTrilinos/ML.py", line 142, in <module>
>> import PyTrilinos.Teuchos
>> File "/Users/guyer/anaconda/conda-bld/trilinos_1483368454886/_t_env/lib/python2.7/site-packages/PyTrilinos/Teuchos.py", line 4268, in <module>
>> class DefaultComm:
>> File "/Users/guyer/anaconda/conda-bld/trilinos_1483368454886/_t_env/lib/python2.7/site-packages/PyTrilinos/Teuchos.py", line 4270, in DefaultComm
>> __defaultComm = MpiComm(mpiCommunicator)
>> File "/Users/guyer/anaconda/conda-bld/trilinos_1483368454886/_t_env/lib/python2.7/site-packages/PyTrilinos/Teuchos.py", line 4184, in __init__
>> raise AttributeError("No constructor defined")
>> AttributeError: No constructor defined
>> ```
>>
>>
>> I rolled back to swig 3.0.2 and this issue goes away. I don't see anything obvious in the build logs, but there's a lot to wade through.
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at trilinos.org
>> https://trilinos.org/mailman/listinfo/trilinos-users
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users
More information about the Trilinos-Users
mailing list