SpatialExperiment icon indicating copy to clipboard operation
SpatialExperiment copied to clipboard

Problem with installing due to the dependency `magick`

Open EliHei2 opened this issue 3 years ago • 5 comments

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?

EliHei2 avatar Nov 01 '21 11:11 EliHei2

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

LTLA avatar Nov 01 '21 15:11 LTLA

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:

  • 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.
  • 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...

drighelli avatar Nov 02 '21 09:11 drighelli

  • 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.

LTLA avatar Nov 05 '21 19:11 LTLA

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.

sciencepeak avatar Nov 22 '22 18:11 sciencepeak

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.

PeteHaitch avatar Nov 08 '23 23:11 PeteHaitch