Mouse-Imaging-Centre / RMINC

Statistics for MINC volumes: A library to integrate voxel-based statistics for MINC volumes into the R environment. Supports getting and writing of MINC volumes, running voxel-wise linear models, correlations, etc.; correcting for multiple comparisons using the False Discovery Rate, and more. With contributions from Jason Lerch, Chris Hammill, Jim Nikelski and Matthijs van Eede. Some additional information can be found here:
https://mouse-imaging-centre.github.io/RMINC
Other
23 stars 17 forks source link

Installation error on Mac #297

Closed Marina-Blmz closed 2 years ago

Marina-Blmz commented 2 years ago

Hello!

i would very much appreciate your help with the following installation error:

`> install_github("Mouse-Imaging-Centre/RMINC@develop", args = "--configure-args='--with-build-path=/opt/minc/1.9.16'", upgrade_dependencies = FALSE) Downloading GitHub repo Mouse-Imaging-Centre/RMINC@develop ✓ checking for file ‘/private/var/folders/qb/2f1xv8y5063f2l3jgmydcw640000gq/T/RtmpdX6W5u/remotes6a17b27a21b/Mouse-Imaging-Centre-RMINC-2d4f07d/DESCRIPTION’ (350ms) ─ preparing ‘RMINC’: (2.3s) ✓ checking DESCRIPTION meta-information ... ─ cleaning src ─ running ‘cleanup’ ─ checking for LF line-endings in source and make files and shell scripts (771ms) ─ checking for empty or unneeded directories Removed empty directory ‘RMINC/etc’ ─ looking to see if a ‘data/datalist’ file should be added ─ building ‘RMINC_1.5.2.3.tar.gz’

Installing package into ‘/usr/local/lib/R/4.1/site-library’ (as ‘lib’ is unspecified)

what is this minc2? did i miss something when preparing my environment for the installation? I followed your suggestion here: https://github.com/Mouse-Imaging-Centre/RMINC/blob/master/INSTALL, and i have installed minc, minc-toolkit-v2, hdf5, gfortran, and added paths to home/.R/Makevars..., but with no success.

I would appreciate a lot any advice! Thank you!

bcdarwin commented 2 years ago

One thing is that RMINC doesn't yet work with R 4.x, although that isn't the cause of the issue you're seeing.

Did the minc-toolkit installation finish successfully and install the toolkit at /opt/minc/1.9.16 ? (Note this is a rather old version, probably best to install 1.9.18.1 if possible). If so, does setting MINC_PATH to that directory help?

yohanyee commented 2 years ago

If setting MINC_PATH doesn't help, could you try running install_github(..., build_opts = ...) instead of install_github(..., args = ...) ?

jasonlerch commented 2 years ago

I’ve been running RMINC on R 4.0.4 quite happily for a while, so I’m confused by the statement that it doesn’t work on R 4.x?

On Dec 2, 2021, at 7:01 PM, Ben Darwin @.**@.>> wrote:

One thing is that RMINC doesn't yet work with R 4.x, although that isn't the cause of the issue you're seeing.


This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.

bcdarwin commented 2 years ago

I seem to recall there is at least one test that fails due to the stringsAsFactors default change, but haven't investigated further.

jasonlerch commented 2 years ago

Ah, ok – I don’t think I ran the testbed, but in practice I’ve experienced no issues.


This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.

bcdarwin commented 2 years ago

I've described the 4.x issues at #296 for now.

Marina-Blmz commented 2 years ago

Thank you all for your comments and replies!

-I've tried with install_github(..., build_opts = ...), got the same error: configure: error: minc2 not found. -i've updated my minc version to 1.9.18.1, as far as i can test it, it works fine. while installing RMINC, the error is configure: error: minc2 not found. -so i've tried building minc-2.1.12 source, the configure goes without a problem (HDF5, and NetCDF are ok). but make is terminating with the following error:

libsrc2/hyper.c:427:52: warning: passing 'hsize_t [100]' to parameter of type 'hssize_t *' (aka 'long long *') converts between pointers to integer types with different sign [-Wpointer-sign] hdf_start, libsrc2/hyper.c:284:39: note: passing argument to parameter 'hdf_start' here hssize_t hdf_start[], libsrc2/hyper.c:773:4: error: non-void function 'miget_real_value_hyperslab' should return a value [-Wreturn-type] return; ^ 1 warning and 1 error generated. make[2]: *** [libsrc2/hyper.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2

Again, any suggestions will be highly apprecaited!

bcdarwin commented 2 years ago

Having installed minc-toolkit 1.9.18.1 should be fine -- building libminc separately isn't going to be helpful. Are you running the minc-toolkit-config.sh script before launching R? If so does LD_LIBRARY_PATH point to a lib directory containing libminc2.so? Have you tried setting MINC_PATH?

Marina-Blmz commented 2 years ago

Thank you for your reply, Ben! my bash profile contains the following: export MINC_TOOLKIT=/opt/minc/1.9.18 export MINC_TOOLKIT_VERSION="1.9.18-20200813" export PATH=${MINC_TOOLKIT}/bin:${MINC_TOOLKIT}/pipeline:${PATH} export PERL5LIB=${MINC_TOOLKIT}/perl:${MINC_TOOLKIT}/pipeline${PERL5LIB:+:$PERL5LIB} export DYLD_LIBRARY_PATH=${MINC_TOOLKIT}/lib:${MINC_TOOLKIT}/lib/InsightToolkit${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} export MNI_DATAPATH=${MINC_TOOLKIT}/../share:${MINC_TOOLKIT}/share export MINC_FORCE_V2=1 export MINC_COMPRESS=4 export VOLUME_CACHE_THRESHOLD=-1 export MANPATH=${MINC_TOOLKIT}/man${MANPATH:+:$MANPATH} export MINC_PATH=/opt/minc/1.9.18 export LD_LIBRARY_PATH=${MINC_PATH}/lib:${LD_LIBRARY_PATH}

although, it seems my LD_LIBRARY_PATH folder doesn't have the libminc2.so. shouldn't it be in /opt/minc/1.9.18/bin?

vfonov commented 2 years ago

LD_LIBRARY_PATH doesn't work on Mac, that's why there is DYLD_LIBRARY_PATH instead. However, with recent versions of MacOS, DYLD_LIBRARY_PATH is being ignored by OS to protect from the evil hackers, so the only valid way for dynamically linking to a shared library is via RPATH.

P.S. I am not able to help with MacOS issues any further, because currently I don't own a mac.

Marina-Blmz commented 2 years ago

All installation errors were always produced when i was using Rstudio, i retried today when running R from terminal - and it did install RMINC without any error...

gdevenyi commented 2 years ago

For future, the rstudio environment will not inherit the terminal setting properly, so installation needs to happen in an R session in the terminal. Once it is installed, rstudio last I checked will properly work with the library.

Marina-Blmz commented 2 years ago

Indeed, now it all runs properly also in rstudio. Thank you all for your valuable comments and suggestions!