drighelli / SpatialExperiment

55 stars 19 forks source link

Problem with installing due to the dependency `magick` #88

Open EliHei2 opened 3 years ago

EliHei2 commented 3 years ago

Hi! apparently there is a new dependency magick added. I can not install it on my machine. the usual error:

1: In .inet_warning(msg) :installation of package ‘magick’ had non-zero exit status

any tricks?

LTLA commented 3 years ago

My two cents: magick seems like one of those difficult system dependencies that should be shifted to the Suggests, given that it is not technically required for the definition of the SpatialExperiment class itself.

While it is required for the wrapper read10xVisium function, we could probably write a wrapper switch between magick, PNG and jpeg depending on what libraries are available on the user's machine.

See also comments at MarioniLab/MouseGastrulationData#16

drighelli commented 3 years ago

Thanks @EliHei2 for highlighting this at the moment the package depends on this library, so it's not possible to bypass this without installing the library on your machine.

Thanks @LTLA for the cross-reference and to highlight a possible solution:

LTLA commented 3 years ago
  • about the Suggests: we can surely do this, but when the user invokes any function depending on magick, if there are no libraries, the problem will be always there.

Yes, but at least you don't block users who just want to use the SpatialExperiment data structure. For example, if they already have LoadedSpatialImage objects, then the use of magick to handle loading is unnecessary.

  • I'd surely prefer to avoid any dependencies if there is a simpler possible solution, do you think that we can easily use PNG and jpeg instead of magick? I'd go for it on any machine at that point...

All of these have system dependences of some kind. PNG depends on libpng while jpeg depends on libjpeg. These may or may not be more likely to be installed. If you want to have maximum robustness, add all of them to Suggests and then switch between them at run time depending on what is installed.

sciencepeak commented 1 year ago

As per the error message prompt, I successfully installed the magick stuff to my linux system. Here is the command: sudo apt-get install -y libmagick++-dev

On my windows system, I never encounter the magick-related issue.

PeteHaitch commented 12 months ago

I'd like to add my voice that making magick a suggested dependency would be a very welcome improvement for the reasons outlined above by Aaron.