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

Problems generating help in system with multiple Python installations #678

Closed
heplesser opened this Issue Mar 14, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@heplesser
Contributor

heplesser commented Mar 14, 2017

André Sevenius reported the following problem on NEST User 14 March 2017:

I get the following error:

Extracting help information; this may take a litte while.
Traceback (most recent call last):
  File "/opt/rh/anaconda/lib/python3.6/site-packages/site.py", line 73, in <module>
    __boot()
  File "/opt/rh/anaconda/lib/python3.6/site-packages/site.py", line 3, in __boot
    import os
  File "/opt/rh/anaconda/lib/python3.6/os.py", line 409
    yield from walk(new_path, topdown, onerror, followlinks)
             ^
SyntaxError: invalid syntax
make[2]: *** [generate_help] Error 1
make[1]: *** [doc/CMakeFiles/generate_help.dir/all] Error 2
make: *** [all] Error 2
NEST Configuration Summary
--------------------------------------------------------------------------------
Build type          : 
Target System       : Linux
Cross Compiling     : FALSE
C compiler          : /bin/cc
C compiler flags    :  -O2 -Wall -fopenmp 
C++ compiler        : /bin/c++
C++ compiler flags  :  -O2 -Wall -fopenmp 
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : Yes (Python 3.6: /opt/rh/anaconda/bin/python3.6m)
       Includes     : /opt/rh/anaconda/include/python3.6m
       Libraries    : /opt/rh/anaconda/lib/libpython3.6m.so

Cython bindings     : Yes (Cython 0.25.2: /opt/rh/anaconda/bin/cython)
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 1.15)
    Includes        : /usr/include
    Libraries       : /usr/lib64/libgsl.so;/usr/lib64/libgslcblas.so

Use Readline        : Yes (GNU Readline 6.2)
    Includes        : /usr/include
    Libraries       : /lib64/libreadline.so;/lib64/libncurses.so

Use libltdl         : Yes (LTDL 2.4.2)
    Includes        : /usr/include
    Libraries       : /lib64/libltdl.so

Use doxygen         : Yes (/bin/doxygen)
                    : target `doc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

So as you can see, python should be setup correctly and it finds the right inerpreter. But this is a classical error where python3.x is interpreted by 2.7, but I've checked paths and everything, even changing aliases to make sure no reference to python2 exist.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Mar 14, 2017

Contributor

@jougs Assigning to you as this is a follow-up to #647.

Suggested work-around (not tested): In file doc/CMakeLists.txt delete lines 20-44

if ( NOT CMAKE_CROSSCOMPILING ) 
  ... 
endif()

Online help will not be available in this case.

I suspect this problem is due to the fact that we have hardcoded python on lines 26-27

  COMMAND python -B generate_help.py "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
  COMMAND python -B generate_helpindex.py "${PROJECT_BINARY_DIR}/doc"

and line 40

  COMMAND python -B generate_helpindex.py \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}\"

Should we get python from the CMake-Variable containing the Python excutable CMake has discovered?

Contributor

heplesser commented Mar 14, 2017

@jougs Assigning to you as this is a follow-up to #647.

Suggested work-around (not tested): In file doc/CMakeLists.txt delete lines 20-44

if ( NOT CMAKE_CROSSCOMPILING ) 
  ... 
endif()

Online help will not be available in this case.

I suspect this problem is due to the fact that we have hardcoded python on lines 26-27

  COMMAND python -B generate_help.py "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
  COMMAND python -B generate_helpindex.py "${PROJECT_BINARY_DIR}/doc"

and line 40

  COMMAND python -B generate_helpindex.py \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}\"

Should we get python from the CMake-Variable containing the Python excutable CMake has discovered?

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Apr 18, 2017

Contributor

See also #712 on what happens if no Python is available at all.

Contributor

heplesser commented Apr 18, 2017

See also #712 on what happens if no Python is available at all.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Apr 20, 2017

Contributor

@steffengraber Together with #712, I think the situation is as follows:

  • If no Python is available at all, or if Python is older than 2.7.8 (re-bug), we skip help generation completely.
  • Otherwise, we need to use the Python that CMake has discovered instead of hard-coding python as is the case at present.
Contributor

heplesser commented Apr 20, 2017

@steffengraber Together with #712, I think the situation is as follows:

  • If no Python is available at all, or if Python is older than 2.7.8 (re-bug), we skip help generation completely.
  • Otherwise, we need to use the Python that CMake has discovered instead of hard-coding python as is the case at present.

@heplesser heplesser added P: PR Created and removed P: Pending labels May 9, 2017

heplesser added a commit that referenced this issue Jun 9, 2017

Merge pull request #715 from steffengraber/fix-issue-678
Fix issue #678  - Skip help generation without python or python older than 2.7.8
@steffengraber

This comment has been minimized.

Show comment
Hide comment
@steffengraber

steffengraber Jun 13, 2017

Contributor

@heplesser Can we close this issue?

Contributor

steffengraber commented Jun 13, 2017

@heplesser Can we close this issue?

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Jun 13, 2017

Contributor

Fixed by #715.

Contributor

heplesser commented Jun 13, 2017

Fixed by #715.

@heplesser heplesser closed this Jun 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment