-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyTrilinos installation problems on Mac #1749
Comments
Are you using a download release of Trilinos or the current github version? Support for Python version 3 starts with the upcoming 12.12 release. If you are using a download release, you can’t yet use Python 3, although I am surprised the cmake build system didn’t catch that fact earlier.
Bill Spotz
Sandia National Laboratories
PO Box 5800 MS 1320
Albuquerque, NM 87185
(505) 845-0170
… On Sep 18, 2017, at 1:32 PM, michael-a-hansen ***@***.***> wrote:
Hello,
I've run into a few compilation issues with PyTrilinos on Mac (Sierra). I'm using cmake 3.9.0 and python 3.6. My simple configuration line is below, in which I've disabled Matio because it complained and I don't need Matlab support. This is on a fresh clone of Trilinos.
cmake -DTrilinos_ENABLE_ALL_PACKAGES=ON -DTPL_ENABLE_Matio=OFF -DBUILD_SHARED_LIBS=ON -DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 ..
See the two problems below. Let me know how I can help or if I haven't specified enough.
Mike
It appears that some byte code is not being generated, which causes a fatal error during installation.
CMake Error at packages/PyTrilinos/src/cmake_install.cmake:284 (file):
file INSTALL cannot find
"/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/Teuchos.pyc".
Call Stack (most recent call first):
packages/PyTrilinos/cmake_install.cmake:61 (include)
cmake_install.cmake:112 (include)
During configuration I see an error (not fatal) in converting doxygen XML to docstrings. See the trace below. This shows up (I think) in the Trilinos/packages/PyTrilinos/src/Tpetra_dox.i file not being generated, which does make a fatal error during compilation. I can get around that for now by simply making an empty file with that name, but I'd imagine I'm missing out on some documentation by doing that.
Converting doxygen XML to SWIG docstring directives for Tpetra ... ERRORS!
Traceback (most recent call last):
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 457, in <module>
main()
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 453, in main
convert(args[0], args[1], not options.func_def)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 437, in convert
p.generate()
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 120, in generate
self.parse(self.xmldoc)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 386, in do_doxygenindex
p.generate()
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 120, in generate
self.parse(self.xmldoc)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 162, in parse_Element
self.generic_parse(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 242, in do_compounddef
self.parse(first[n])
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 272, in do_detaileddescription
self.generic_parse(node, pad=1)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 262, in do_para
self.generic_parse(node, pad=1)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 258, in do_parameterlist
self.generic_parse(node, pad=1)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 162, in parse_Element
self.generic_parse(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 162, in parse_Element
self.generic_parse(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 211, in generic_parse
self.parse(n)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 129, in parse
pm(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 160, in parse_Element
handlerMethod(node)
File "/Users/mike/Trilinos/packages/PyTrilinos/doc/Doxygen/doxy2swig.py", line 266, in do_parametername
self.add_text("%s: "%node.firstChild.data)
AttributeError: Element instance has no attribute 'data'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#1749>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA9Lrdenu3Zw7ZuxIrJJw-AlMiQ9jWnFks5sjsVmgaJpZM4Pbaeb>.
|
I cloned from github this morning. |
Be sure you are using SWIG version 3.0.10. Later versions have bugs when processing PyTrilinos. If the docsting problem persists, set PyTrilinos_DOCSTRINGS to OFF. If you still have issues, use Python 2 (we don't have rigorous testing for Python 3 set up yet). Please let us know what happens. |
I installed SWIG 3.0.10, but that did not fix it. I then used python2 however, and it installed as expected, so it looks like a python3 issue. |
My intention was to "drop in" the sparse direct solvers in Amesos where I was using SciPy's interface to SuperLU/UMFPACK. Unfortunately the application has been developed for python3 so building with python2 does not resolve my issue. |
I have aways tested against Python 3.5, so that is another thing you could test. I will try Python 3.6 and see if I can recreate your issues. |
I received the same error with python3.5. From the end of
|
If I navigate to
|
I am building the latest version of Trilinos using Python 3.5 and I am seeing the doctoring errors you are, although Teuchos docstrings build fine, it is Tpetra that is having problems. Haven't got to installation yet. |
@michael-a-hansen I have pushed a fix to the doxy2swig.py script that appears to work, and I think it clears up the downstream problem with the .pyc files. |
I've pulled and am still seeing the same issue on both 3.5 and 3.6. |
My best bet is that there's something silly with paths on my machine, as it seems is always the case with python dependencies. I've grepped my build directories for "*n2.7" and the path of my default 2.7 python executable the laptop came with, and both found nothing so I'm confident it's not cmake finding the wrong python somewhere and the right python elsewhere. |
It was many years ago, but my attempts with using the Mac OS system Python failed. Apple alters its Python (I forget how), and those altercations can lead to problems with PyTrilinos. But it was long enough ago that I don't remember the details. Using an Anaconda-installed Python 3 on my MacBook Pro (after the script fix) worked for me this morning. |
I'll try Anaconda. I'm not on system python (bad experience there too) but let's see if it works with Anaconda. |
I'm seeing the same problems with Anaconda. The docstrings issue is no longer a problem but it still can't find the bytecode and I get the same error noted above when I try to compile it myself. |
I just pushed to the develop branch fixes for the PyTrilinos generation scripts, upgrading for Python 3. See if it helps. |
It didn't change anything on my 3.6 installation, but now I'm trying with anaconda python (still 3.6). I've done lots of monkeying-around with this python on this computer, so I get the feeling this is my own fault somehow. I'm setting PATH and PYTHONPATH as they should and I've gotten used to the normal issues when a build system tries to be smart about python, but I could be missing something. I can try this on a 'cleaner' machine in a few days, so I will do that and let you know how it goes there. |
Same thing with anaconda. I'll let you know how the other computer goes (it will be a few days). |
@wfspotz The bytecode problem is also happening with me. I didn't report it earlier because I thought it was something with my configuration. I was able to fix it by generating the bytecode manually. However, when trying to do a clean build inside a docker container, it happened again.
|
@wfspotz @michael-a-hansen I believe I figured out the problem. As of PEP 3147 (https://www.python.org/dev/peps/pep-3147/) the cached bytecode files are being written in the
So, all you have to do is navigate to the |
@gpkc this works for me, thank you! One thing: I got rid of the |
Any idea WHY this is happening? Cmake is supposed to byte compile the generated python code. What is happening that this fails (quietly) and a manual workaround is necessary? If you do not know, perhaps you could attach your output for configuration and building, and maybe I could find a clue. I would like to fix this for everyone, without the need for a manual workaround. |
@wfspotz I believe (I have to check but I'm almost sure) that for newer versions of python, instead of generating the bytecode in the same folder that the .py files are, it is generating them inside a |
@gpkc @michael-a-hansen @wfspotz
$ python --version $ swig -version $cd gitclone/packages/PyTrilinos
$cd gitclone/packages/teuchos
$cd gitclone/packages/nox
$gitclone/packages/domi
The error during the installation is
|
@kvmkrao it looks like you may not be running For clarity: I'm running |
@kvmkrao Where are you getting Trilinos? Python 3 support is relatively new, and you have files that have not been updated to work with both Python 2 and 3. |
@michael-a-hansen Start 1: PyTrilinos_testTeuchos_MPI_4 Thank you. |
The Trilions version used for the build is
I am able to install pytrilinos via the configuration options shown in the previous post with Thank you. |
@michael-a-hansen run |
@kvmkrao You will need to pull a more recent commit from the Trilinos repository. There is an Oct 4 fix for packages/PyTrilinos/doc that enables use with Python 3. |
I pulled the most recent git repo and ran the same configuration file. And, got the same installation error Git repo version
Installation error
Tests
Thank you. |
@kvmkrao I believe he has not yet fixed the problem with the bytecode generation. Please do the compileall procedure and run the tests again. |
@wfspotz sorry for the slow reply - I get |
@michael-a-hansen what did you do 2 days ago when you reported the failing tests? |
@michael-a-hansen Ah, I see my mistake. If you want to help, I suspect you have
in your
and that would enable just the PyTrilinos tests. @kvmkrao can you run |
@wfspotz |
@wfspotz Here's the summary of failures from
All but Pliris fail like this, with
And Pliris' failure is unique, seems like the module is never built in the first place.
|
OK, I have pushed a fix to the |
I have pushed another fix to the |
@wfspotz I will try it tomorrow. |
I tested the develop branch. It works well and does not need the manual workout to build. |
"does need"? It should NOT need the manual workaround. |
sorry @wfspotz |
OK. Closing as fixed. |
Hello,
I've run into a few compilation issues with
PyTrilinos
on Mac (Sierra). I'm using cmake 3.9.0 and python 3.6. My simple configuration line is below, in which I've disabledMatio
because it complained and I don't need Matlab support. This is on a fresh clone of Trilinos.cmake -DTrilinos_ENABLE_ALL_PACKAGES=ON -DTPL_ENABLE_Matio=OFF -DBUILD_SHARED_LIBS=ON -DPYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 ..
See the two problems below. Let me know how I can help or if I haven't specified enough.
Mike
Trilinos/packages/PyTrilinos/src/Tpetra_dox.i
file not being generated, which does make a fatal error during compilation. I can get around that for now by simply making an empty file with that name, but I'd imagine I'm missing out on some documentation by doing that.The text was updated successfully, but these errors were encountered: