Skip to content
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

Closed
michael-a-hansen opened this issue Sep 18, 2017 · 46 comments
Closed

PyTrilinos installation problems on Mac #1749

michael-a-hansen opened this issue Sep 18, 2017 · 46 comments
Labels
impacting: configure or build The issue is primarily related to configuring or building pkg: PyTrilinos system: osx

Comments

@michael-a-hansen
Copy link

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

  1. 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)
  1. 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'
@michael-a-hansen michael-a-hansen changed the title Installation problems on Mac PyTrilinos installation problems on Mac Sep 18, 2017
@aprokop aprokop added impacting: configure or build The issue is primarily related to configuring or building pkg: PyTrilinos labels Sep 18, 2017
@aprokop
Copy link
Contributor

aprokop commented Sep 18, 2017

@wfspotz

@wfspotz
Copy link
Contributor

wfspotz commented Sep 18, 2017 via email

@michael-a-hansen
Copy link
Author

I cloned from github this morning.

@wfspotz
Copy link
Contributor

wfspotz commented Sep 18, 2017

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.

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Sep 18, 2017

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.

@michael-a-hansen
Copy link
Author

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.

@wfspotz
Copy link
Contributor

wfspotz commented Sep 19, 2017

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.

@michael-a-hansen
Copy link
Author

I received the same error with python3.5. From the end of make install:

-- Installing: /usr/local/include/swigpyrun.h
-- Installing: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyTrilinos/Teuchos.py
CMake Error at packages/PyTrilinos/src/cmake_install.cmake:284 (file):
  file INSTALL cannot find
  "/Users/mike/Trilinos/build3.5/packages/PyTrilinos/src/PyTrilinos/Teuchos.pyc".
Call Stack (most recent call first):
  packages/PyTrilinos/cmake_install.cmake:61 (include)
  cmake_install.cmake:112 (include)


make: *** [install] Error 1

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Sep 19, 2017

If I navigate to cd /Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos (back in my python3.6 build) and run python3.6 -m Teuchos.py to compile the bytecode myself, I get the following error:

/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6: Error while finding module specification for 'Teuchos.py' (AttributeError: module 'Teuchos' has no attribute '__path__')

@wfspotz
Copy link
Contributor

wfspotz commented Sep 19, 2017

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.

@wfspotz
Copy link
Contributor

wfspotz commented Sep 19, 2017

@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.

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Sep 19, 2017

I've pulled and am still seeing the same issue on both 3.5 and 3.6.

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Sep 19, 2017

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.

@wfspotz
Copy link
Contributor

wfspotz commented Sep 19, 2017

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.

@michael-a-hansen
Copy link
Author

I'll try Anaconda. I'm not on system python (bad experience there too) but let's see if it works with Anaconda.

@michael-a-hansen
Copy link
Author

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.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 5, 2017

I just pushed to the develop branch fixes for the PyTrilinos generation scripts, upgrading for Python 3. See if it helps.

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Oct 5, 2017

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.

@michael-a-hansen
Copy link
Author

Same thing with anaconda. I'll let you know how the other computer goes (it will be a few days).

@gpkc
Copy link
Contributor

gpkc commented Oct 8, 2017

@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.
@michael-a-hansen I don't know if you found a way, but you can solve this by compiling the python code by hand inside the build directory. You can use the compileall command (https://docs.python.org/3.7/library/compileall.html), for example. I don't think that running the file as a module works all the time.
My cmake command is:

/usr/local/cmake/bin/cmake -D CMAKE_INSTALL_PREFIX:PATH=/usr \
          \
          -D MPI_BASE_DIR:PATH=/usr \
          \
          -D CMAKE_BUILD_TYPE:STRING=Release \
          -D CMAKE_Fortran_COMPILER:FILEPATH=/usr/bin/mpif90 \
          -D BUILD_SHARED_LIBS:BOOL=ON \
          -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
          \
          -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
          -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
          -D Trilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=OFF \
          -D Trilinos_ENABLE_Teuchos:BOOL=ON \
          -D Trilinos_ENABLE_Epetra:BOOL=ON \
          -D Trilinos_ENABLE_AztecOO:BOOL=ON \
          -D Trilinos_ENABLE_Amesos:BOOL=ON \
          -D Trilinos_ENABLE_PyTrilinos:BOOL=ON \
          \
          -D PyTrilinos_DISABLE_STRONG_WARN:BOOL=OFF\
          -D PyTrilinos_DOCSTRINGS:BOOL=OFF \
          -D PyTrilinos_ENABLE_EXAMPLES:BOOL=OFF \
          -D PyTrilinos_ENABLE_TESTS:BOOL=OFF\
          \
          -D Trilinos_ENABLE_EXAMPLES:BOOL=OFF \
          -D Trilinos_ENABLE_TESTS:BOOL=OFF \
          \
          -D TPL_ENABLE_MATLAB:BOOL=OFF \
          -D TPL_ENABLE_Matio:BOOL=OFF \
          -D TPL_ENABLE_MPI:BOOL=ON \
          -D TPL_ENABLE_BLAS:BOOL=ON \
          -D TPL_ENABLE_LAPACK:BOOL=ON \
          -D TPL_ENABLE_QT:BOOL=OFF \
          -D TPL_ENABLE_X11:BOOL=OFF \
          -D TPL_ENABLE_MPI4PY:BOOL=ON \
          \
          -D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
          -D Trilinos_VERBOSE_CONFIGURE:BOOL=OFF

@gpkc
Copy link
Contributor

gpkc commented Oct 8, 2017

@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 __pycache__ subdirectory.
Python3 compileall introduced the -b option:

Write the byte-code files to their legacy locations and names, which may overwrite byte-code files created by another version of Python

So, all you have to do is navigate to the build/packages/PyTrilinos/src/PyTrilinos folder and run:
python -m compileall -b -l -f .

@michael-a-hansen
Copy link
Author

@gpkc this works for me, thank you!

One thing: I got rid of the -l flag so that compileall is recursive. There's a couple of sub-directories like LOCA, NOX, and Isorropia that need to be compiled.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 9, 2017

@michael-a-hansen, @gpkc:

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.

@gpkc
Copy link
Contributor

gpkc commented Oct 9, 2017

@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 __pycache__ folder, created inside the same folder that contains the .py files. So, the build system can't find them because it is looking for .pyc files with the same path as the .py files.

@kvmkrao
Copy link

kvmkrao commented Oct 9, 2017

@gpkc @michael-a-hansen
python -m compileall -b -f . command does not solve my problem. Do you have any suggestion.
It could be because of errors of the listed in this comment.

@wfspotz
My configuration file is

cmake
-D Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON
-D CMAKE_INSTALL_PREFIX:PATH=/home/vkotteda/Software/pytrilinos/install
-D CMAKE_BUILD_TYPE:STRING=DEBUG
-D BUILD_SHARED_LIBS:BOOL=ON
-D TPL_ENABLE_MPI:BOOL=ON
-D MPI_BASE_DIR=$MPIDIR/bin
-D Trilinos_ENABLE_Fortran:BOOL=ON
-D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=""
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON

-D Trilinos_ENABLE_TESTS:BOOL=OFF
-D Trilinos_ENABLE_EXAMPLES:BOOL=OFF
-D Trilinos_ENABLE_Epetra:BOOL=ON
-D Trilinos_ENABLE_AztecOO:BOOL=ON
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON

-D TPL_ENABLE_Boost:BOOL=ON
-D TPL_ENABLE_Netcdf:BOOL=ON
-D TPL_ENABLE_BLAS:BOOL=ON

-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON
-D TPL_ENABLE_BLAS:BOOL=ON
-D TPL_ENABLE_LAPACK:BOOL=ON
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON
-D PyTrilinos_DOCSTRINGS:BOOL=OFF
-D PyTrilinos_ENABLE_TESTS:BOOL=ON
-D PyTrilinos_INSTALL_PREFIX:PATH=/home/vkotteda/Software/pytrilinos/pyinstall
/home/vkotteda/Software/Trilinos/gitclone

$ python --version
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)

$ swig -version
SWIG Version 3.0.12
Compiled with g++ [x86_64-pc-linux-gnu]
Configured options: +pcre

$cd gitclone/packages/PyTrilinos
$ python -m compileall -b -f .

Listing '.'...
Listing './cmake'...
Listing './doc'...
Listing './doc/DevelopersGuide'...
Listing './doc/Doxygen'...
Listing './doc/Doxygen/.deps'...
Compiling './doc/Doxygen/docstrings.py'...
*** File "./doc/Doxygen/docstrings.py", line 29
print "Running doxygen on package", package, "...",
^
SyntaxError: Missing parentheses in call to 'print'

Compiling './doc/Doxygen/doxy2swig.py'...
*** File "./doc/Doxygen/doxy2swig.py", line 56
except UnicodeEncodeError, e:
^
SyntaxError: invalid syntax

Compiling './doc/Doxygen/makedeps.py'...
*** File "./doc/Doxygen/makedeps.py", line 213
print doc
^
SyntaxError: Missing parentheses in call to 'print'

Listing './doc/UsersGuide'...
Listing './doc/UsersGuide/figures'...
Listing './example'...
Listing './example/cg_example'...
Compiling './example/cg_example/CG.py'...
*** Sorry: TabError: inconsistent use of tabs and spaces in indentation (CG.py, line 41)
Compiling './example/hello.py'...
Listing './src'...
Listing './src/.deps'...
Listing './src/Epetra_NumPy'...
Listing './src/PyTrilinos'...
Listing './src/PyTrilinos/Isorropia'...
Listing './src/PyTrilinos/Isorropia/Epetra'...
Listing './src/PyTrilinos/LOCA'...
Listing './src/PyTrilinos/LOCA/Epetra'...
Listing './src/PyTrilinos/LOCA/Hopf'...
Listing './src/PyTrilinos/LOCA/Pitchfork'...
Listing './src/PyTrilinos/LOCA/TurningPoint'...
Listing './src/PyTrilinos/NOX'...
Listing './src/PyTrilinos/NOX/Epetra'...
Listing './src/PyTrilinos/NOX/LAPACK'...
Listing './src/PyTrilinos/NOX/PETSc'...
Listing './src/scripts'...
Listing './test'...
Listing './util'...

$cd gitclone/packages/teuchos
$ python -m compileall -b -f .

Listing '.'...
Listing './all'...
Listing './all/doc'...
Listing './browser'...
Listing './browser/doc'...
Listing './cmake'...
Listing './cmake/tpls'...
Listing './comm'...
Listing './comm/cmake'...
Listing './comm/example'...
Listing './comm/example/TimeMonitor'...
Listing './comm/src'...
Listing './comm/test'...
Listing './comm/test/Comm'...
Listing './comm/test/MpiTypeTraits'...
Listing './comm/test/ParameterList'...
Listing './comm/test/Time'...
Listing './comm/test/TimeMonitor'...
Listing './comm/test/UnitTesting'...
Listing './core'...
Listing './core/cmake'...
Listing './core/example'...
Listing './core/example/CommandLineProcessor'...
Listing './core/example/ExplicitInstantiation'...
Listing './core/example/ExplicitInstantiation/four_files'...
Listing './core/example/RefCountPtr'...
Listing './core/example/show_stack'...
Listing './core/src'...
Listing './core/test'...
Listing './core/test/Allocator'...
Listing './core/test/CWrapperSupport'...
Listing './core/test/CommandLineProcessor'...
Listing './core/test/Containers'...
Listing './core/test/FilteredIterator'...
Listing './core/test/MemoryManagement'...
Listing './core/test/ScalarTraits'...
Listing './core/test/TabularOutputter'...
Listing './core/test/TwoDArray'...
Listing './core/test/TypeConversions'...
Listing './core/test/UnitTest'...
Listing './core/test/Workspace'...
Listing './core/test/dyn_cast'...
Listing './doc'...
Listing './doc/images'...
Listing './doc/includes'...
Listing './kokkoscomm'...
Listing './kokkoscomm/cmake'...
Listing './kokkoscomm/src'...
Listing './kokkoscompat'...
Listing './kokkoscompat/cmake'...
Listing './kokkoscompat/src'...
Listing './kokkoscompat/test'...
Listing './numerics'...
Listing './numerics/cmake'...
Listing './numerics/example'...
Listing './numerics/example/BLAS'...
Listing './numerics/example/DenseMatrix'...
Listing './numerics/example/LAPACK'...
Listing './numerics/example/hilbert'...
Listing './numerics/src'...
Listing './numerics/test'...
Listing './numerics/test/BLAS'...
Listing './numerics/test/DenseMatrix'...
Listing './numerics/test/LAPACK'...
Listing './numerics/test/MatrixMarket'...
Listing './numerics/test/Polynomial'...
Listing './parameterlist'...
Listing './parameterlist/cmake'...
Listing './parameterlist/example'...
Listing './parameterlist/example/ParameterList'...
Listing './parameterlist/example/XML'...
Listing './parameterlist/src'...
Listing './parameterlist/test'...
Listing './parameterlist/test/Conditions'...
Listing './parameterlist/test/Dependencies'...
Listing './parameterlist/test/FancyOutputting'...
Listing './parameterlist/test/FunctionObjects'...
Listing './parameterlist/test/ObjectBuilder'...
Listing './parameterlist/test/ParameterList'...
Listing './parameterlist/test/Validators'...
Listing './parameterlist/test/XML'...
Listing './parameterlist/test/XMLParser'...
Listing './parameterlist/test/yaml'...
Listing './parser'...
Listing './parser/cmake'...
Listing './parser/example'...
Listing './parser/gen'...
Listing './parser/src'...
Listing './parser/test'...
Listing './refactoring'...
Compiling './refactoring/show_missing_distributed_files.py'...
*** File "./refactoring/show_missing_distributed_files.py", line 35
except Exception, e:
^
SyntaxError: invalid syntax

Listing './remainder'...
Listing './remainder/cmake'...
Listing './remainder/example'...
Listing './remainder/example/SolverFactory'...
Listing './remainder/src'...
Listing './remainder/test'...
Listing './remainder/test/SolverFactory'...

$cd gitclone/packages/nox
$ python -m compileall -b -f .

Listing '.'...
Listing './build_scripts'...
Listing './cmake'...
Listing './doc'...
Listing './doc/images'...
Listing './examples'...
Listing './examples/epetra'...
Listing './examples/epetra/LOCA_Brusselator_xyzt'...
Listing './examples/epetra/LOCA_ContinuationManager'...
Listing './examples/epetra/LOCA_ContinuationManager_xyzt'...
Listing './examples/epetra/LOCA_Tcubed'...
Listing './examples/epetra/NOX_1DFEMNonlinear'...
Listing './examples/lapack'...
Listing './examples/lapack/LOCA_1DFDPitchfork'...
Listing './examples/lapack/LOCA_Brusselator'...
Listing './examples/lapack/LOCA_Chan'...
Listing './examples/lapack/NOX_ExportMakefile'...
Listing './examples/lapack/NOX_SimpleExamples'...
Listing './examples/petsc'...
Listing './examples/petsc/1DFiniteDifference'...
Listing './examples/petsc/DS6.5.1'...
Listing './maintenance'...
Listing './src'...
Listing './src-belos'...
Listing './src-epetra'...
Listing './src-lapack'...
Listing './src-loca'...
Listing './src-loca/doc'...
Listing './src-loca/src'...
Listing './src-loca/src-epetra'...
Listing './src-loca/src-epetra/continuation-manager'...
Listing './src-loca/src-lapack'...
Listing './src-loca/src-mf'...
Listing './src-loca/src-thyra'...
Listing './src-petsc'...
Listing './src-thyra'...
Listing './test'...
Listing './test/basic'...
Listing './test/epetra'...
Listing './test/epetra/1Dfem'...
Listing './test/epetra/Brusselator'...
Listing './test/epetra/DS6.5.1'...
Listing './test/epetra/FiniteDifferenceColoring'...
Listing './test/epetra/LOCA_Brusselator'...
Listing './test/epetra/LOCA_Brusselator_xyzt'...
Listing './test/epetra/LOCA_MultiPoint_Tcubed'...
Listing './test/epetra/LOCA_Pitchfork'...
Listing './test/epetra/LOCA_Tcubed'...
Listing './test/epetra/LOCA_TestProblems'...
Listing './test/epetra/LOCA_UnitTests'...
Listing './test/epetra/MultiPhysics'...
Listing './test/epetra/MultiPhysics/gold_brusselator'...
Listing './test/epetra/MultiPhysics/gold_hmx'...
Listing './test/epetra/NOX_Group'...
Listing './test/epetra/NOX_NewTest'...
Listing './test/epetra/NOX_Operators'...
Listing './test/epetra/NOX_Vector'...
Listing './test/epetra/PelletTransport'...
Listing './test/epetra/Thyra'...
Listing './test/lapack'...
Listing './test/lapack/LOCA_ChanProblem'...
Listing './test/lapack/LOCA_TestProblems'...
Listing './test/lapack/LOCA_UnitTests'...
Listing './test/lapack/LOCA_python'...
Compiling './test/lapack/LOCA_python/testLOCA.py'...
*** File "./test/lapack/LOCA_python/testLOCA.py", line 11
print "usage:", sys.argv[0], "[-v]"
^
SyntaxError: Missing parentheses in call to 'print'

Compiling './test/lapack/LOCA_python/testLOCA_Chan.py'...
*** File "./test/lapack/LOCA_python/testLOCA_Chan.py", line 159
print "\n***** Running Tests *****\n"
^
SyntaxError: Missing parentheses in call to 'print'

Listing './test/lapack/NOX'...
Listing './test/lapack/NOX/exampleParams'...
Listing './test/lapack/NOX_Group'...
Listing './test/lapack/NOX_NewTest'...
Listing './test/lapack/StatusTests'...
Listing './test/lapack/UserDefinedObjects'...
Listing './test/petsc'...
Listing './test/tpetra'...
Listing './test/utils'...
Compiling './test/utils/NOX_Test.py'...

$gitclone/packages/domi
$ python -m compileall -b -f .

Listing '.'...
Listing './cmake'...
Listing './doc'...
Compiling './doc/copy_xml_to_src_html.py'...
*** File "./doc/copy_xml_to_src_html.py", line 20
if verbose: print cmd
^
SyntaxError: Missing parentheses in call to 'print'

Listing './doc/parameterList'...
Listing './example'...
Listing './example/DrivenCavity'...
Compiling './example/DrivenCavity/plot.py'...
*** File "./example/DrivenCavity/plot.py", line 22
print "Time step", n
^
SyntaxError: Missing parentheses in call to 'print'

Listing './scripts'...
Listing './src'...
Listing './test'...
Listing './test/MDArray'...
Listing './test/MDComm'...
Listing './test/MDMap'...
Listing './test/MDVector'...

The error during the installation is

-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_NumPy_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_DAP.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_Teuchos_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_Epetra_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_LinearProblem.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_Tpetra_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_Domi_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_EpetraExt_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/PyTrilinos_ML_Util.hpp
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/include/swigpyrun.h
-- Up-to-date: /home/vkotteda/Software/pytrilinos/install/lib/python3.6/site-packages/PyTrilinos/Teuchos.py
CMake Error at packages/PyTrilinos/src/cmake_install.cmake:101 (file):
file INSTALL cannot find
"/home/vkotteda/Software/pytrilinos/packages/PyTrilinos/src/PyTrilinos/Teuchos.pyc".
Call Stack (most recent call first):
packages/PyTrilinos/cmake_install.cmake:66 (include)
cmake_install.cmake:102 (include)

Makefile:85: recipe for target 'install' failed
make: *** [install] Error 1

@michael-a-hansen
Copy link
Author

@kvmkrao it looks like you may not be running compileall in the right directory. For example, the the test or examples subdirectories of nox are in the source but I don't see them in my build directory.

For clarity: I'm running compileall from /Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos, where /Users/mike/Trilinos is the git repo and build is my cmake build directory.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 9, 2017

@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.

@kvmkrao
Copy link

kvmkrao commented Oct 9, 2017

@michael-a-hansen
I ran the command in the build/packages directory and installation is successful. However, the following Teuchos tests are failed. I think, those are due to the errors in compiling some of the files.

Start 1: PyTrilinos_testTeuchos_MPI_4
1/44 Test #1: PyTrilinos_testTeuchos_MPI_4 .................***Failed Error regular expression found in output. Regex=[The following Teuchos::RCPNode objects were created] 1.16 sec
Start 2: PyTrilinos_testTeuchos_Comm_MPI_4
2/44 Test #2: PyTrilinos_testTeuchos_Comm_MPI_4 ............***Failed Error regular expression found in output. Regex=[The following Teuchos::RCPNode objects were created] 0.57 sec
Start 3: PyTrilinos_testTeuchos_ParameterList_MPI_4
3/44 Test #3: PyTrilinos_testTeuchos_ParameterList_MPI_4 ...***Failed Error regular expression found in output. Regex=[The following Teuchos::RCPNode objects were created] 0.53 sec
Start 4: PyTrilinos_testTeuchos_ScalarTraits_MPI_4
4/44 Test #4: PyTrilinos_testTeuchos_ScalarTraits_MPI_4 ....***Failed Error regular expression found in output. Regex=[The following Teuchos::RCPNode objects were created] 0.50 sec
Start 5: PyTrilinos_testEpetra_BlockMap_MPI_4
5/44 Test #5: PyTrilinos_testEpetra_BlockMap_MPI_4 ......... Passed 0.49 sec
Start 6: PyTrilinos_testEpetra_Comm_MPI_4
6/44 Test #6: PyTrilinos_testEpetra_Comm_MPI_4 ............. Passed 0.49 sec
Start 7: PyTrilinos_testEpetra_CompObject_MPI_4
7/44 Test #7: PyTrilinos_testEpetra_CompObject_MPI_4 ....... Passed 0.49 sec

Thank you.

@kvmkrao
Copy link

kvmkrao commented Oct 9, 2017

@wfspotz

The Trilions version used for the build is

Base Git Repo: Trilinos
d6eed5d [Thu Sep 28 13:47:58 2017 -0600] bmpersc@sandia.gov
Update release notes for 12.12.

I am able to install pytrilinos via the configuration options shown in the previous post with
(i) anaconda2/python2.7.13 and swig 3.0.12
(ii) anaconda3/python3.6.1 and swig 3.0.12

Thank you.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 9, 2017

@michael-a-hansen run ctest --output-on-failure and send me the results

@wfspotz
Copy link
Contributor

wfspotz commented Oct 9, 2017

@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.

@kvmkrao
Copy link

kvmkrao commented Oct 9, 2017

@wfspotz

I pulled the most recent git repo and ran the same configuration file. And, got the same installation error

Git repo version

*** Base Git Repo: Trilinos
2317d27 [Mon Oct 9 15:54:43 2017 -0600] daibane@sandia.gov
Merge branch 'develop' of github.com:trilinos/Trilinos into develop

Installation error

-- Installing: /home/vkotteda/Software/pytrilinos/build/install/lib/python3.6/site-packages/PyTrilinos/Teuchos.py
CMake Error at packages/PyTrilinos/src/cmake_install.cmake:101 (file):
file INSTALL cannot find
"/home/vkotteda/Software/pytrilinos/build/packages/PyTrilinos/src/PyTrilinos/Teuchos.pyc".
Call Stack (most recent call first):
packages/PyTrilinos/cmake_install.cmake:66 (include)
cmake_install.cmake:102 (include)

Tests

The following tests FAILED:
1 - PyTrilinos_testTeuchos_MPI_4 (Failed)
2 - PyTrilinos_testTeuchos_Comm_MPI_4 (Failed)
3 - PyTrilinos_testTeuchos_ParameterList_MPI_4 (Failed)
4 - PyTrilinos_testTeuchos_ScalarTraits_MPI_4 (Failed)
44 - PyTrilinos_testNOX_StatusTest_MPI_4 (Failed)
46 - PyTrilinos_exTeuchos_MPI_4 (Failed)
71 - PyTrilinos_exNOX_1Dfdm_MPI_4 (Failed)
72 - PyTrilinos_exLOCA_Chan_MPI_1 (Failed)

Thank you.

@gpkc
Copy link
Contributor

gpkc commented Oct 9, 2017

@kvmkrao I believe he has not yet fixed the problem with the bytecode generation. Please do the compileall procedure and run the tests again.

@michael-a-hansen
Copy link
Author

@wfspotz sorry for the slow reply - I get no tests were found when I run ctest. What haven't I done?

@wfspotz
Copy link
Contributor

wfspotz commented Oct 11, 2017

@michael-a-hansen what did you do 2 days ago when you reported the failing tests?

@michael-a-hansen
Copy link
Author

That was @kvmkrao, I thought you wanted me to run the tests to compare with @kvmkrao's test failures.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 11, 2017

@michael-a-hansen Ah, I see my mistake. If you want to help, I suspect you have

-D Trilinos_ENABLE_TESTS:BOOL=OFF
-D Trilinos_ENABLE_EXAMPLES:BOOL=OFF

in your cmake invocation. You could add

-D PyTrilinos_ENABLE_TESTS:BOOL=ON
-D PyTrilinos_ENABLE_EXAMPLES:BOOL=ON

and that would enable just the PyTrilinos tests.

@kvmkrao can you run ctest --output-on-failure and send me the results?

@kvmkrao
Copy link

kvmkrao commented Oct 11, 2017

@wfspotz
The output of ctest --output-on-failure is
kvmkrao_errors.txt

@michael-a-hansen
Copy link
Author

michael-a-hansen commented Oct 11, 2017

@wfspotz Here's the summary of failures from ctest --output-on-failure on my build:

The following tests FAILED:
	 38 - PyTrilinos_testPliris (Failed)
	 45 - PyTrilinos_testNOX_StatusTest (Failed)
	 76 - PyTrilinos_exNOX_2DSim (Failed)
	 77 - PyTrilinos_exNOXEpetraExt_2DSim (Failed)
	 78 - PyTrilinos_exNOX_1Dfdm (Failed)
	 79 - PyTrilinos_exLOCA_Chan (Failed)

All but Pliris fail like this, with ImportError: attempted relative import with no known parent package:

79/79 Test #79: PyTrilinos_exLOCA_Chan ....................***Failed  Required regular expression not found.Regex=[End Result: TEST PASSED
]  0.31 sec
Traceback (most recent call last):
  File "exLOCA_Chan.py", line 45, in <module>
    NOX       = fromPyTrilinosImport('NOX'      , options.testharness)
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/example/testutil.py", line 100, in fromPyTrilinosImport
    PyTrilinosPkg = __import__(fullname, globals, locals)
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/NOX/__init__.py", line 437, in <module>
    from . import Epetra
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/__init__.py", line 207, in <module>
    import Interface
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/NOX/Epetra/Interface.py", line 197, in <module>
    from .. import Abstract
ImportError: attempted relative import with no known parent package

And Pliris' failure is unique, seems like the module is never built in the first place.

38/79 Test #38: PyTrilinos_testPliris .....................***Failed  Required regular expression not found.Regex=[End Result: TEST PASSED
]  0.26 sec
Traceback (most recent call last):
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/Pliris.py", line 34, in swig_import_helper
    return importlib.import_module(mname)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: dlopen(/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/_Pliris.so, 258): Symbol not found: __ZN6Pliris11FactorSolveEP13Epetra_VectoriiPiS2_S2_Pd
  Referenced from: /Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/_Pliris.so
  Expected in: flat namespace
 in /Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/_Pliris.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "testPliris.py", line 69, in <module>
    Pliris = fromPyTrilinosImport('Pliris', options.testharness)
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/test/testutil.py", line 100, in fromPyTrilinosImport
    PyTrilinosPkg = __import__(fullname, globals, locals)
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/Pliris.py", line 37, in <module>
    _Pliris = swig_import_helper()
  File "/Users/mike/Trilinos/build/packages/PyTrilinos/src/PyTrilinos/Pliris.py", line 36, in swig_import_helper
    return importlib.import_module('_Pliris')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_Pliris'

@wfspotz
Copy link
Contributor

wfspotz commented Oct 11, 2017

OK, I have pushed a fix to the develop branch that should address the byte-compiled files issue. With it, you should not need to do the manual workaround. It does not address the import problems under Python 3.6.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 11, 2017

I have pushed another fix to the develop branch that addresses the import problem. All my tests pass on Mac OS X. I would like to see if this works for those of you on Linux.

@gpkc
Copy link
Contributor

gpkc commented Oct 11, 2017

@wfspotz I will try it tomorrow.

@kvmkrao
Copy link

kvmkrao commented Oct 16, 2017

@wfspotz

OK, I have pushed a fix to the develop branch that should address the byte-compiled files issue. With it, you should not need to do the manual workaround. It does not address the import problems under Python 3.6.

I tested the develop branch. It works well and does not need the manual workout to build.
Thank you.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 16, 2017

I tested the develop branch. It works well and does need the manual workout to build.

"does need"? It should NOT need the manual workaround.

@kvmkrao
Copy link

kvmkrao commented Oct 16, 2017

sorry @wfspotz
does not need. Edited my previous comment. Thank you.

@wfspotz
Copy link
Contributor

wfspotz commented Oct 16, 2017

OK. Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impacting: configure or build The issue is primarily related to configuring or building pkg: PyTrilinos system: osx
Projects
None yet
Development

No branches or pull requests

5 participants