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

Install soliket on macos M1 #109

Closed
mgerbino opened this issue Feb 28, 2023 · 3 comments · Fixed by #127
Closed

Install soliket on macos M1 #109

mgerbino opened this issue Feb 28, 2023 · 3 comments · Fixed by #127
Assignees
Labels
non cosmo Infrastructure tasks which do not require specific domain knowledge in cosmology repo Related to repo functionality tests Improvements to tests
Milestone

Comments

@mgerbino
Copy link
Collaborator

This is a compilation of instructions I followed to make SOLikeT work (and pass the tox tests) on the new macos M1.

System: Monterey 12.6.3, M1 chip, arm64

The main issue was to have tensorflow correctly installed (see here) and have cosmopower find it.

  1. Download latest miniconda installer (e.g., here: Download Conda environment) and properly rename it (e.g., -> miniconda.sh)
  2. Install miniconda and tensor flow-deps
    bash ~/miniconda.sh -b -p $HOME/miniconda
    source ~/miniconda/bin/activate
    conda install -c apple tensorflow-deps
  3. Create your virtual env
    conda env create -n my_env -f soliket-tests.yml
    conda activate my_env
  4. Install tensorflow-macos and metal with correct versioning (I had them work with 2.9 and 0.5)
    pip install tensorflow-macos==2.9
    pip install tensorflow-metal==0.5.0
  5. Download cosmopower manually
    git clone https://github.com/alessiospuriomancini/cosmopower
    cd cosmopower
  6. Open requirements.txt and change the tensorflow dep as follows:
    tensorflow>2.0 -> tensorflow-macos>2.0
  7. Install cosmopower manually
    pip install .
  8. Go back to soliket folder and install it
    cd path/to/your/soliket
    pip install -e .

The above should let you install SOLikeT.
In order to pass tests (both with pytest and within the tox env), I needed to add camb to soliket-tests.yml in the conda requirements to be installed via conda-forge (might work also via pip, not tried). Simply, add camb before the pip requirements.

@mgerbino mgerbino added repo Related to repo functionality tests Improvements to tests non cosmo Infrastructure tasks which do not require specific domain knowledge in cosmology labels Feb 28, 2023
@mgerbino mgerbino added this to the v0.1 milestone Feb 28, 2023
@mgerbino
Copy link
Collaborator Author

mgerbino commented Mar 1, 2023

Quick update: Alessio is looking into this and will likely update the PyPI to overcome the issue above.

@itrharrison
Copy link
Collaborator

@mgerbino can this be closed now? We should update the installation instructions in general. I think I remember the situation changed due to Alessio's action?

@mgerbino
Copy link
Collaborator Author

@itrharrison , I asked Alessio. Last time we spoke, the issue wasn't solved and we still needed to go through the procedure above to have tensowflow installed on M1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non cosmo Infrastructure tasks which do not require specific domain knowledge in cosmology repo Related to repo functionality tests Improvements to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants