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

[INSTALLATION ERROR] conda and pip install fails sparse2d build #184

Open
1 of 2 tasks
MTLeist255 opened this issue Jan 5, 2023 · 12 comments
Open
1 of 2 tasks

[INSTALLATION ERROR] conda and pip install fails sparse2d build #184

MTLeist255 opened this issue Jan 5, 2023 · 12 comments
Assignees
Labels
installation installation issues

Comments

@MTLeist255
Copy link

System setup
OS: [e.g] macOS v12.6
Python version: [e.g.] v3.9
Python environment (if any): [e.g.] pyenv 2.3.9

Describe the bug
Hello, I saw there was a similar issues raised by ycp21 on November 17th regarding a failure to build sparse2d using an ubuntu system. I think my issue is different in that my build fails while trying to install pysap using both a conda environment and pip install.

During the build using pip install I receive the following error:
Screen Shot 2023-01-05 at 3 35 08 PM
Screen Shot 2023-01-05 at 3 35 22 PM

and when trying the build using a conda environment, running python setup.py install I receive:

Screen Shot 2023-01-05 at 3 37 21 PM

Screen Shot 2023-01-05 at 3 38 06 PM

To Reproduce
pip install --user python-pysap

git clone https://github.com/CEA-COSMIC/pysap.git
conda env create -f environment.yml
conda activate pysap
python setup.py install

Screenshots
*see above

Are you planning to submit a Pull Request?

  • Yes
  • No
@MTLeist255 MTLeist255 added the installation installation issues label Jan 5, 2023
@sfarrens
Copy link
Contributor

sfarrens commented Jan 6, 2023

Hi @MTLeist255, thanks for opening this issue. I have opened PR #183 to fix this problem. I just need to fix a few details with the unit tests before this can be merged. We will make a release shortly after this is merged. Apologies for the inconvenience.

@MTLeist255
Copy link
Author

Hi @sfarrens ok excellent, thank you so much! Do you think I'll be able to try the install again in a week or so?

@sfarrens
Copy link
Contributor

sfarrens commented Jan 6, 2023

I will do my best to have everything sorted within the next couple of weeks. 😁

@MTLeist255
Copy link
Author

Hello again! Would there happen to be a way to run pysap online or through a virtual machine? I'm interested in running the multiresolution deconvolution script but have not had any success installing this program yet

@sfarrens
Copy link
Contributor

Hi @MTLeist255, apologies for the delay. I am going to try to get this resolved this week.

In the meantime, I have built a Docker image for Sparse2D, a C++ package we use as a backend for PySAP wavelet transforms. I just ran a test, and the PySAP master branch builds on a container run from this image. You can find details on using the GitHub Container Registry here. Once you have pulled the image you can run:

docker run -v ${PWD}:/workdir ghcr.io/cosmostat/sparse2d:master
git clone https://github.com/CEA-COSMIC/pysap.git
cd pysap
conda init bash
conda activate sparse2d
export CC=gcc-9 CXX=g++-9
python setup.py install

Alternatively, you could build your own Docker image or indeed set up a virtual machine looking at the the setup in the Dockerfile.

@sfarrens
Copy link
Contributor

Hi @MTLeist255 quick update, #183 has been merged into the develop branch. This should be fairly stable on macOS (both Intel and Apple Silicon) now. We still have a few details to sort out before making a new release, but you should be able to use this branch for now.

@sfarrens sfarrens self-assigned this Jan 19, 2023
@MTLeist255
Copy link
Author

Hi @sfarrens, thank you very much for this build update! I was able to successfully install pysap using a conda environment. I've successfully executed the 'test_binding.py' and 'test_examples.py' codes. I was also able to download and execute the 'galaxy_deconvolution.py' code from pysap-astro and everything appears in working order!

Out of genuine curiosity, is there a way to call other sparse2d deconvolution methods (i.e., mr_deconv, mw_deconv, etc.) from pysap, and if so, how? I noticed on the Sparse2d issues board (and admittedly this might be a question I should post there) that mr_deconv is callable. I'm currently testing different deconvolution methods on a few model sets (more playing around than anything), and whiel 'sparse_deconv_condatvu' is working great I'm interested in trying other methods as well (i.e., mr_deconv and mw_deconv).

@sfarrens
Copy link
Contributor

Hi @MTLeist255, I am glad to hear that everything is working! 🎉

We do have a binding for mr_deconv in PySAP. You can use it as follows:

from  pysap.extensions.sparse2d import Deconvolve

then run:

help(Deconvolve)

to see the arguments. We are working on improving the documentation for PySAP to make these things more transparent, but it takes time and there are not many of us at the moment.

We don't have support for mw_deconv at the moment, but you can install it with Sparse2D independently.

@MTLeist255
Copy link
Author

Hello again, thank you so much for this! I was able to get the mr_deconv code to work as well. I have more of a conceptual question I was hoping you might be able to help answer (or maybe point me in the right direction of some academic papers). What is the difference between the pysap sparse condat-vu deconvolution, mr_deconv, and mw_deconv?

@Athanaziz
Copy link

Hello, I have precisely the same issue as described in this thread. I tried to install pySap via pip as well as via conda env - the result was the same "sparse2d/src/sparse2d/src/libtools/TempMemory.h:6:10: fatal error: 'omp.h' file not found". I also tried to fix it by installing openmp via homebrew - nope, doesn't help. My system info: macOs v13.2.1, chip M1 pro, python version 3.10.9

@sfarrens
Copy link
Contributor

Hi @Athanaziz have you tried installing the current develop branch via pip?

@MTLeist255
Copy link
Author

Hi again, would there happen to be a publicly available tutorial on how to run mr_deconv after importing the Python binding? After running:

from pysap.extensions.sparse2d import Deconvolve
help(Deconvolve)

I can see the list of available options for this class but I don't know how to actually run this method. Is there an option to run this method from an IDE (i.e., Pycharm- my preference lol) or, after calling this binding function, can mr_deconv be run from the terminal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation installation issues
Projects
None yet
Development

No branches or pull requests

3 participants