main.cpp.rst files are not handled by generate script

Issue #755 resolved
Chaffra Affouda created an issue

Hi, How do I convert the main.cpp.rst files to main.cpp now? Is this feature still being worked on? I can't build the latest trunk.

Comments (16)

  1. Martin Sandve Alnæs

    There's a script ./cmake/scripts/generate-demo-files, it should be executed when you run cmake.

    To convert just one .rst file you're editing you can run python <dolfin>/utils/pylit/pylit.py on the file.

  2. Chaffra Affouda reporter

    Yes that script is missing a line to convert .cpp.rst files.

    rstfiles += [f for f in files if len(f) > 8 and f[-8:] == ".cpp.rst"]

  3. Martin Sandve Alnæs

    Also, the GLOBRECURSE mechanism in CMakeLists.txt converts more files than it should, including e.g. other build directories.

  4. Martin Sandve Alnæs

    When running cmake, do you see this?

    -- Generating demo source files
    -- --------------------------------------------------
    extract written to /home/martinal/dev/fenics-dev/dolfin/demo/documented/eigenvalue/python/demo_eigenvalue.py
    ...
    extract written to /home/martinal/dev/fenics-dev/dolfin/demo/documented/built-in-meshes/cpp/main.cpp
    
  5. Chaffra Affouda reporter

    I am seeing this

    --
    -- Generating demo source files from reStructuredText
    -- --------------------------------------------------
    --
    -- Generating demo source files
    -- --------------------------------------------------
    -- Performing Test HAVE_NO_MULTLINE
    -- Performing Test HAVE_NO_MULTLINE - Success
    
  6. Chaffra Affouda reporter

    yes on windows you should problaby specify the python exe like this

    execute_process(COMMAND ${PYTHON_EXECUTABLE} ./utils/pylit/pylit.py ${rst_file}

    in the `CMakeLists.txt'. It works from cmake now.

  7. Prof Garth Wells

    I would like to run pylit via the Python interpreter, but we need to check that it works with py3.

  8. Martin Sandve Alnæs

    I had to fix pylit when trying to build dolfin with py3, because I was using a virtualenv where python=python3. It's good to keep this in mind: don't trust that python=python2.

  9. Prof Garth Wells

    I've started avoiding python and pip in favour of python2, python3, etc, because of inconsistencies across platforms.

  10. Log in to comment