JDBetteridge
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Notes on new Firedrake Spack installer ###### tags: `spack` ## Instructions: ### [Spack](https://spack.readthedocs.io/en/latest/index.html): 1. Follow [getting started](https://spack.readthedocs.io/en/latest/getting_started.html) guide - Ensure develop branch is installed - Ensure desired [compilers](https://spack.readthedocs.io/en/latest/getting_started.html#compiler-configuration) are known to spack, should be picked up by `spack compiler find` - Ensure [system packages](https://spack.readthedocs.io/en/latest/getting_started.html#system-packages) (that you don't want spack to install) are known to spack, some may be picked up by `spack external find`, others may require manual intervention. 2. You may want to specify the system MPI as the correct MPI for spack to use. This appears to be quite difficult, a starting template for the `~/.spack/packages.yaml`might be: ```yaml packages: mpich: externals: - spec: mpich@4.0 prefix: /opt/mpich buildable: False ``` If Spack's PETSc package doesn't think this spec line is suitable it _will_ try to build its own MPICH. Make sure the spack `setup-env.sh` file has been sourced and you can run spack commands before moving to the next section. ### [Firedrake-repo](https://github.com/firedrakeproject/firedrake-spack) 1. Clone the above repo 1. Add the repository to spack `spack repo add <repo directory> ` 1. Create an spack environment `spack env create -d ./firedrake` 1. Activate that environment `spack env activate -p ./firedrake` * To avoid a bunch of errors add a whole bunch of packages to the development package list: ``` spack develop py-firedrake@develop spack develop libsupermesh@develop spack develop petsc@develop spack develop chaco@petsc spack develop py-fiat@develop spack develop py-finat@develop spack develop py-islpy@develop spack develop py-petsc4py@develop spack develop py-pyadjoint@develop spack develop py-pyop2@develop spack develop py-coffee@develop spack develop py-loopy@develop spack develop py-cgen@develop spack develop py-codepy@develop spack develop py-genpy@develop spack develop py-tsfc@develop spack develop py-ufl@develop ``` * 1. Install firedrake using `spack add py-firedrake@develop %gcc ^mpich ^openblas` * `%gcc` specifies the compiler, you may wish to specify a version (eg: `%gcc@11.2.0`), ommiting this will use the default compiler * `^mpich` specifies which MPI to use. If you set an MPI system package be sure to use this (eg: `^openmpi@3.1`) * `^openblas` specifies which BLAS/LAPACK library to use. If you set an BLAS/LAPACK system package be sure to use this (eg: `^intel-mkl@2019.1`) * You can further specify the Python version by adding `^python@3.10` for Python 3.10 or setting the system python if it's set up in system packages 1. `spack install` Will install everything - Add `--fail-fast` to stop at the first package with an install error - Adding `2>&1 | tee spack-firedrake-install.log` to the end of the command will save all output to a log file that you can send if you need someone else to look over the output. - ```spack install --fail-fast 2>&1 | tee spack-firedrake-install.log ``` 1. Test you can import Firedrake by running `python -c "from firedrake import *"` - If this fails, before trying anything else, deactivate the environment with `spack env deactivate` and reactivate with `spack env activate -p ./firedrake` (as above) and try running `python -c "from firedrake import *"` again. This appears to be a shortcoming of spack (related to[#10801](https://github.com/spack/spack/issues/10801)?). 1. Run the basic functionality tests: ```bash cd $SPACK_ENV/py-firedrake pytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection" ``` 1. Run the full test suite: ```bash cd $SPACK_ENV/src/firedrake pytest tests ``` ## Will's Notes: ## Yohance's Notes: ## Connor's Notes: **26/04** It works! Great job. > - I didn't manage to use the system MPICH. Some information on how to configure that would be excellent. > - > Turns out this is quite hard to do, not in general, but for our use case. PETSc seems to have a fairly strict spec for how it installs MPICH, if the system spec isn't specified the same way spack will go ahead and install its own. You need in depth knowledge of how your MPI was built to specify itg as an external package, apparently. I have added something above to start from at least. > - This isn't quite working for me at the moment. I run the installer and everything appears to work fine but then I run `python -c "import firedrake"` and I get > ```bash > $ python -c "import firedrake" > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "/home/connor/Code/firedrake-spack/firedrake/py-firedrake/firedrake/__init__.py", line 69, in <module> > from pyop2 import op2 # noqa: F401 > ModuleNotFoundError: No module named 'pyop2' > ``` > Importing `petsc4py`, `ufl`, `tsfc` all work perfectly well. > > I have tried going to `py-pyop2`, running `git pull` and then `spack install --verbose`. The relevant part of the output is: > ```bash > ==> Installing py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo > ==> No binary for py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo found: installing from source > ==> No patches needed for py-pyop2 > ==> py-pyop2: Executing phase: 'install' > ==> [2022-04-04-15:51:07.079513] '/home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/python-3.9.10-m2mnygxubd43ebkhdp5kgbjp3q5fkax5/bin/python' 'setup.py' 'develop' '--prefix=/home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo' > /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/python-3.9.10-m2mnygxubd43ebkhdp5kgbjp3q5fkax5/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'test_requires' > warnings.warn(msg) > running develop > /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-setuptools-59.4.0-zze3l2hthtttpbdcafr3s4qthvcjfmnl/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. > warnings.warn( > /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-setuptools-59.4.0-zze3l2hthtttpbdcafr3s4qthvcjfmnl/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. > warnings.warn( > running egg_info > writing PyOP2.egg-info/PKG-INFO > writing dependency_links to PyOP2.egg-info/dependency_links.txt > writing requirements to PyOP2.egg-info/requires.txt > writing top-level names to PyOP2.egg-info/top_level.txt > reading manifest file 'PyOP2.egg-info/SOURCES.txt' > reading manifest template 'MANIFEST.in' > adding license file 'LICENSE' > adding license file 'AUTHORS' > writing manifest file 'PyOP2.egg-info/SOURCES.txt' > running build_ext > skipping 'pyop2/sparsity.c' Cython extension (up-to-date) > Creating /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/lib/python3.9/site-packages/PyOP2.egg-link (link to .) > Adding PyOP2 0.13.0+637.g5f4c036b to easy-install.pth file > Installing spydump script to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/bin > Installing pyop2-clean script to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/bin > > Installed /home/connor/Code/firedrake-spack/firedrake/py-pyop2 > /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-setuptools-59.4.0-zze3l2hthtttpbdcafr3s4qthvcjfmnl/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: dev is an invalid version and will not be supported in a future release > warnings.warn( > /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-setuptools-59.4.0-zze3l2hthtttpbdcafr3s4qthvcjfmnl/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release > warnings.warn( > Processing dependencies for PyOP2==0.13.0+637.g5f4c036b > Searching for networkx > Reading https://pypi.org/simple/networkx/ > Downloading https://files.pythonhosted.org/packages/f6/34/4913f651b8e178dde5abcf8d62495e4dcd0757a9a6840f1b1f7a290afaea/networkx-2.7.1-py3-none-any.whl#sha256=011e85d277c89681e8fa661cf5ff0743443445049b0b68789ad55ef09340c6e0 > Best match: networkx 2.7.1 > Processing networkx-2.7.1-py3-none-any.whl > Installing networkx-2.7.1-py3-none-any.whl to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/lib/python3.9/site-packages > Adding networkx 2.7.1 to easy-install.pth file > > Installed /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/lib/python3.9/site-packages/networkx-2.7.1-py3.9.egg > Searching for COFFEE==0.1.0 > Best match: COFFEE 0.1.0 > Adding COFFEE 0.1.0 to easy-install.pth file > > Using /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-coffee-develop-3xt7ez35lt4h7pjlmjtokdzc5x6rylvs/lib/python3.9/site-packages > Searching for numpy==1.22.3 > Best match: numpy 1.22.3 > Adding numpy 1.22.3 to easy-install.pth file > Installing f2py script to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/bin > Installing f2py3 script to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/bin > Installing f2py3.9 script to /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo/bin > > Using /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-numpy-1.22.3-ibokt6dedipcsv7xen66opjozhnte5el/lib/python3.9/site-packages > Searching for mpi4py==3.1.2 > Best match: mpi4py 3.1.2 > Adding mpi4py 3.1.2 to easy-install.pth file > > Using /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-mpi4py-3.1.2-wswdc4g42s2ptl2i46adw3wxobtctt2h/lib/python3.9/site-packages > Searching for decorator==4.4.2 > Best match: decorator 4.4.2 > Adding decorator 4.4.2 to easy-install.pth file > > Using /home/connor/.local/opt/spack/opt/spack/linux-arch-haswell/gcc-11.1.0/py-decorator-4.4.2-pk6eey7riaoevbowzmm5ojlk3dtlqd33/lib/python3.9/site-packages > Finished processing dependencies for PyOP2==0.13.0+637.g5f4c036b > ==> py-pyop2: Successfully installed py-pyop2-develop-sgqienmyqamtxbnrucc4mcy3mg2xecyo > Fetch: 0.00s. Build: 1.63s. Total: 1.63s. > ``` > This still fails to resolve the import problem even though everything seems to have gone through fine. > > I think I now have a fix for this

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully