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

issue to open SPM8 standalone and SPM12 standalone with the latest singularity image #268

Closed
manuegrx opened this issue Jul 8, 2021 · 57 comments
Labels
bug Something isn't working

Comments

@manuegrx
Copy link

manuegrx commented Jul 8, 2021

Hi,

I use the last singularity image (casa-dev-5.0-4.sif ) and I cannot open SPM8Standalone or SPM12Standalone.

For SPM12 standalone I had the following error:

------------------------------------------------------------------------
       Segmentation violation detected at Thu Jul  8 15:24:38 2021
------------------------------------------------------------------------
Configuration:
  MATLAB Version:   7.10.0.499 (R2010a)
  MATLAB License:   [unknown]([url](url))
  Operating System: Linux 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64
  GNU C Library:    2.27 stable
  Window System:    The X.Org Foundation (11804000), display :0
  Current Visual:   0x21 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 13 Stepping 7, GenuineIntel
  Virtual Machine:  Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
  Default Encoding:  UTF-8
Fault Count: 1
Register State:
  rax = 0000000000000000   rbx = 00007fe6a0022230
  rcx = 0000000000000000   rdx = 00007fe6a0000080
  rbp = 0000000000000000   rsi = 000000003e07c725
  rdi = 0000000000000000   rsp = 00007fe6a5216da8
   r8 = 0000000000000064    r9 = 0000000000000060
  r10 = 00007fe6a0000080   r11 = 00007fe6a0000080
  r12 = 0000000000000000   r13 = 0000000000000000
  r14 = 00007fe6a52170c8   r15 = 0000000000000000
  rip = 00007fe6b437e426   flg = 0000000000010293
Stack Trace:
If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/ts/help_request_1.html
A technical support engineer might contact you with further information.
Thank you for your help.
Warning: 1 invisible figure(s) exist at MCR termination.

For SPM8 standalone it is also a " Segmentation violation" error but it is quite long .

I do not have theses issue when opening the same SPM standalone in my computer without casa.
It seems that I can open SPM12 via matlab without issue.

Is there any change in the latest image that can explain this issue ?
Am I the only one to have trouble ?

Emmanuelle

@Hboni
Copy link
Contributor

Hboni commented Jul 12, 2021

I just tried to open my SPM12 standalone from casa-distro with the casa-dev-5.0.4 image, and I get the same error.

But I also tried with another version of an SPM12 standalone which contains CAT12, and it opens well. Both versions do not use the same Matlab Runtime (MCR).

@ylep ylep transferred this issue from brainvisa/brainvisa.github.io Jul 15, 2021
@ylep ylep added the bug Something isn't working label Jul 15, 2021
@denisri
Copy link
Contributor

denisri commented Jul 15, 2021

Have you checked that the problem does not happen using the casa-dev-5.0-3.sif image ? I'm not sure to understand everything: if the matlab MCR has changed, it means that you are using a different installation of SPM ?

@denisri
Copy link
Contributor

denisri commented Jul 15, 2021

I am only using SPM standalone for the normalization processes of Morphologist in brainvisa, and I still could run it without error on my laptop (using a rather old release of SPM12 standalone).

@Hboni
Copy link
Contributor

Hboni commented Jul 15, 2021

I made more tests with SPM12 and SPM8 standalone with different images version. I tried to use a brainvisa coregister process with both versions. I also tried to open the interface of SPM inside a bv bash :

5.0-4 5.0-3 5.0-1
SPM8 Coreg error error OK
SPM12 Coreg OK OK OK
SPM8 GUI error error OK
SPM12 GUI error error OK

Both SPM8 and SPM12 standalone use an mcr dedicated, but with the exact same version (v713). I tried to use the mcr located in SPM12 folder to launch SPM8 (and the SPM8 mcr for SPM12). And I get the exact same results as in the table.
Furthermore I get a more verbose error with SPM8:

/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM8 - http://www.fil.ion.ucl.ac.uk/spm/


------------------------------------------------------------------------
       Segmentation violation detected at Thu Jul 15 14:46:17 2021
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.10.0.499 (R2010a)
  MATLAB License:   unknown
  Operating System: Linux 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64
  GNU C Library:    2.27 stable
  Window System:    The X.Org Foundation (11804000), display :0
  Current Visual:   0x21 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 14 Stepping 9, GenuineIntel
  Virtual Machine:  Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
  Default Encoding:  UTF-8

Fault Count: 1

Register State:
  rax = 0000000000000000   rbx = 00007f632404aa40
  rcx = 0000000000000000   rdx = 0000000000000000
  rbp = 0000000000000000   rsi = 000000003e07c725
  rdi = 0000000000000000   rsp = 00007f6329adabc8
   r8 = 0000000000000001    r9 = 0000000000000000
  r10 = 00007f63240008d0   r11 = 00007f6338d48514
  r12 = 0000000000000000   r13 = 0000000000000000
  r14 = 00007f6329adaee8   r15 = 0000000000000000
  rip = 00007f6338d274e1   flg = 0000000000010283

Stack Trace:

If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/ts/help_request_1.html

A technical support engineer might contact you with further information.

Thank you for your help.


------------------------------------------------------------------------
       Segmentation violation detected at Thu Jul 15 14:46:17 2021
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.10.0.499 (R2010a)
  MATLAB License:   unknown
  Operating System: Linux 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64
  GNU C Library:    2.27 stable
  Window System:    The X.Org Foundation (11804000), display :0
  Current Visual:   0x21 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 14 Stepping 9, GenuineIntel
  Virtual Machine:  Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
  Default Encoding:  UTF-8

Fault Count: 2

Register State:
  rax = 00007f63399c2700   rbx = 0000000000000000
  rcx = 0000000000000001   rdx = 00007f6329add430
  rbp = 00007f6329add110   rsi = 00007f6327724a70
  rdi = 0000000000000001   rsp = 00007f6329add0d0
   r8 = 00007f6325d30d30    r9 = 0000000000000001
  r10 = 0000000000000000   r11 = 0000000000000001
  r12 = 00007f6329add2b0   r13 = 0000000000000001
  r14 = 0000000000000002   r15 = 0000000000000001
  rip = 00007f6333051954   flg = 0000000000010206

Stack Trace:
  [0] libmwm_interpreter.so:inAssignInputArgsToFormals(int, mxArray_tag**, Mfh_mp*, int)(133, 0x7f6329add370, 0, 0x7f6327724a70) + 84 bytes
  [1] libmwm_interpreter.so:inRunMfile(int, mxArray_tag**, int, mxArray_tag**, Mfh_mp*, inWorkSpace_tag*)(0x7f6327724a70, 0x13869f298, 0x7f6327548a50, 0x7f63399c2700) + 1404 bytes
  [2] libmwm_dispatcher.so:Mfh_file::dispatch_fh(int, mxArray_tag**, int, mxArray_tag**)(0x7f6329add500, 0x7f6329add6f0, 0x7f6329add870, 0x7f6327548e10) + 330 bytes
  [3] libmwmcos.so:mcos::MScopedMethodInfo::invoke(mcos::COSClient const*, int&, mcos::COSValue*, int, mcos::COSValue const*) const(0x7f63399c2170, 0x7f6329add6e0, 0x7f6329add6b0, 0x7f6329add6c0) + 349 bytes
  [4] libmwmcos.so:mcos::MDestructorMI::invoke(mcos::COSClient const*, int&, mcos::COSValue*, int, mcos::COSValue const*) const(0x7f6329add890, 0x7f6329add8b0, 0x7f6329add920, 0x7f632755e690) + 506 bytes
  [5] libmwmcos.so:mcos::COSClassI::callDestructor(mcos::COSInterfacePtr)(0x7f6329addaf0, 0x7f6327547750, 0x7f632754f080, 0x7f6329adda00) + 483 bytes
  [6] libmwmcos.so:mcos::COSClassI::destroyInstance(mcos::COSInterfacePtr)(0x7f6329add990, 0x7f632f7b9e44, 0x7f6329adda40, 0x7f632f7a912c) + 110 bytes
  [7] libmwmcos.so:mcos::COSInterfaceI::destroyUnconditional()(0x7f6329addb90, 0x7f6329addbc8, 0x7f632754f220, 0x7f62c3098280) + 1826 bytes
  [8] libmwmcos.so:mcos::COSInterfaceI::destroyRef()(0x7f62c3096a20, 0, 0x7f6329addbd0, 0x7f632f83e075) + 134 bytes
  [9] libmwmcos.so:mcos::COSInterfacePtr::release()(0x7f62c3098280, 0x7f632754f080, 0x7f6329addc10, 0x7f63381b4317) + 37 bytes
  [10] libmwmcos.so:omDestroyElementListener(void*, mxArray_tag const*)(2, 0x7f62c3098280, 17, 0x7f6327220b60) + 69 bytes
  [11] libmx.so:0x00007f63381b4317(0x7f62c3098280, 0x7f63274ab020, 0x7f6329addc60, 0x7f63381b4c4a)
  [12] libmx.so:0x00007f63381b38c0(0x7f6329addc60, 0x7f6327220bb8, 0x7f63274ab020, 0x7f6327220b60)
  [13] libmx.so:mxDestroyArray~(0x7f6329addca0, 0, 0, 0x7f63274ab020) + 74 bytes
  [14] libmwm_interpreter.so:inResetWS(inWorkSpace_tag*, int)(0xffffffff0000003f, 0x7f6329addd00, 0x274b1900, 0x7f63274ab020) + 242 bytes
  [15] libmwm_interpreter.so:inMfileEpilogFinalizer(opcodes, void*, opcodes*, int*)(0x7f6329addd90, 0x7f632778b690, 0x7f6329addf30, 0x7f632745c2d0) + 766 bytes
  [16] libmwm_interpreter.so:inRunFinalizers(opcodes, opcodes*, int*)(0x7f6329adddd0, 0x7f6329addff0, 0, 0x7f6329ade240) + 55 bytes
  [17] libmwm_interpreter.so:inRunMfile(int, mxArray_tag**, int, mxArray_tag**, Mfh_mp*, inWorkSpace_tag*)(0x7f6329ade240, 0x200000563, 0x7f632745c2d0, 0x7f6329adefc0) + 2720 bytes
  [18] libmwm_dispatcher.so:Mfh_file::dispatch_fh(int, mxArray_tag**, int, mxArray_tag**)(0x200000002, 0x7f63273f31c8 "hgload", 0x7f6329ad0000, 0x7f6327404580) + 330 bytes
  [19] libmwm_interpreter.so:inDispatchFromStack(int, char const*, int, int)(0x7f6329ade5ec, 2, 0x7f63273f31c8 "hgload", 0) + 1066 bytes

@denisri
Copy link
Contributor

denisri commented Jul 15, 2021

So,

  • SPM12 standalone coreg (and probably normalise) do work with all images, that's probably why we didn't run into this problem earlier.
  • the problem did not appear in casa-dev-5.0-4 but in 5.0-3 or 5.0-2.

Now after testing a bit, I will add even more confusion: I have 2 machines (a desktop and a laptop), both running Ubuntu 18.04 (with updates done), with SPM12-standalone-7771 installed (same release on both machines). Casa-distro updated to image 5.0-4.

  • on my desktop machine, SPM12 GUI starts without error in casa-distro.
  • Same when run natively on the host system.
  • on my laptop, I get the same crash as you get in casa-distro.
  • But... I also get the crash outside of casa-distro container on the host system...

So would it be linked to a user config somewhere (path...) ?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Sep 1, 2021

@DimitriPapadopoulos
Copy link
Contributor

Perhaps ReproNim/neurodocker#358 will help.

@DimitriPapadopoulos
Copy link
Contributor

But then, do I need to update the MCR used by the standalone SPM outside of Singularity? Why hasn't this ever been reported outside Singularity here at NS?

@gllmflndn
Copy link

Hello 😀

I couldn't follow all your tests and I don't know what casa-distro is but there is a good chance all of the issues will disappear when using a more recent version of the MCR. R2010a was used consistently to prevent having to install a new MCR from time to time (or having to keep several versions in parallel) but it is just very dated now. I use R2019b in this Singularity definition file with no known issue.
Standalone SPM12 with R2019b is not an official release but I could try to make that happen (at least for Linux) soon if that was helpful here.

@DimitriPapadopoulos
Copy link
Contributor

Hi Guillaume! So to be clear, you recommend we deploy the SPM8 and SPM12 standalone versions with the MCR v97 from Matlab R2019b? Although this ticket is about a Singularity deployment, I am personally interested in the deployment of SPM directly on Ubuntu 18.04 and 20.04 workstations, without Singularity.

If you envision a new SPM12 standalone release, why not switch directly to R2021a?

@gllmflndn
Copy link

Yes, the idea would be to release a new SPM12 standalone version (r7771) relying on the most recently available version of the MATLAB Runtime (probably waiting a few weeks for R2021b, even if ideally I was waiting for R2022a). From then on, would you prefer if new releases of SPM standalone were using the same version of the MATLAB Runtime or if they were using the most recently available one at each given time (or both)?
Also make sure to set an SPM_HTML_BROWSER environment variable to 0 before starting SPM as it is known otherwise to be the cause of a crash.
This plan does not concern SPM8 though - is this still of any use to you?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Sep 3, 2021

If a new MCR is required to fix bugs or crashes, then by all means please do upgrade the MCR - that's more important than saving a few GB of disk space. On the other hand, I suggest using the same MCR as long as it works and has no security issues - every sub-system upgrade comes with its own (minimal) risks of problems.

Good to learn about this SPM_HTML_BROWSER trick for r7771.

I tried to erase SPM5, but a couple users still need it in some scripts! As you can imagine, we have even more users still in need of SPM8 here and there. One last update of SPM8 based on the latest version of Matlab would be useful. It should buy us enough time (years) to phase out SPM8 completely...

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 5, 2021

Has this issue been fixed in the Singularity image? How?

@denisri
Copy link
Contributor

denisri commented Oct 5, 2021

Not that I know, but I haven't really understood if we could do anything, and what. The MCR is not in our (casa-distro) singularity image. We're running programs (brainvisa, anatomist, aims...) from a container, and SPM may get called from the container, but it's not actually installed in the container: it's up to the user to install it and set its path in brainvisa; or use the version installed on the network in noeuropspin. So unless a precise library in the casa-distro brainvisa container is incompatible with the MCR in use in neurospin, and could be changed with another one, it's not really related to casa-distro and containers ?

@DimitriPapadopoulos
Copy link
Contributor

In my case, I am in the process of changing the MCR which can typically be found under /i2bm/local/spm8-standalone-5236/mcr.

@denisri
Copy link
Contributor

denisri commented Oct 5, 2021

So we'll see if it fixes the problems for users...

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 12, 2021

@gllmflndn Should I / can I use Standalone SPM8 with the R2019b MCR (v97) instead of the default R2010a MCR (v713)? I am asking because when installing Standalone SPM8 (r5236) using the R2019b MCR (v97) on an Ubuntu 18.04 workstation:

#
# Install MCR 2019b (v97)
#
cd /tmp
unzip /source/matlab/MATLAB_Runtime_R2019b_Update_9_glnxa64.zip
/tmp/install -destinationFolder /destination/matlab/MATLAB_Runtime -agreeToLicense yes -mode silent

#
# Install Standalone SPM8 (r5236)
#
mkdir /destination/spm8-standalone-5236
cd /destination/spm8-standalone-5236
unzip /source/spm/standalone/spm8/spm8_r5236.zip
mv spm8/* .
rmdir spm8

#
# Initialize Standalone SPM8
#
./run_spm8.sh /destination/matlab/MATLAB_Runtime/v97 quit

The last command run_spm8.sh crashes with:

--------------------------------------------------------------------------------
      Segmentation violation detected at mar. oct. 12 16:44:34 2021 +0200
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : UTF-8
  GNU C Library            : 2.27 stable
  MATLAB Architecture      : glnxa64
  MATLAB Root              : /destination/matlab/MATLAB_Runtime/v97
  MATLAB Version           : 9.7.0.1737446 (R2019b) Update 9
  Operating System         : Ubuntu 18.04.6 LTS
  Process ID               : 28684
  Processor ID             : x86 Family 6 Model 45 Stepping 7, GenuineIntel
  Static TLS mitigation    : Enabled: Full

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007ffe3c2ed530
  RCX = 0000000000000000  RDX = 00000000006020a0
  RSP = 00007ffe3c2ed280  RBP = 00007ffe3c2ed490
  RSI = 0000000000000001  RDI = 00007ffe3c2ed530

   R8 = 0000000000000000   R9 = 0000000000400aff
  R10 = 00000000000000cd  R11 = 00007f38572f35a0
  R12 = 00007ffe3c2ed530  R13 = 0000000000000001
  R14 = 0000000000000000  R15 = 00000000022dda90

  RIP = 00007f3842ce0c83  EFL = 0000000000010202

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f3842ce0c83 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02686083
[  1] 0x00007f3842cd79fd /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02648573 mclInitializeComponentInstanceNonEmbeddedStandalone+00000061
[  2] 0x00007f38572f35e2 /destination/matlab/MATLAB_Runtime/v97/runtime/glnxa64/libmwmclmcrrt.so+00103906 mclInitializeComponentInstanceNonEmbeddedStandalone_proxy+00000066
[  3] 0x0000000000400bcf                                     ./spm8_glnxa64+00003023
[  4] 0x0000000000400bf6                                     ./spm8_glnxa64+00003062
[  5] 0x0000000000400c51                                     ./spm8_glnxa64+00003153
[  6] 0x00007f38502af220 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00352800
[  7] 0x00007f3842424587 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00570759 _ZN7mwboost6detail8function21function_obj_invoker0INS_3_bi6bind_tINS3_11unspecifiedENS_9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISD_EEEENS3_5list1INS3_5valueISF_EEEEEEiE6invokeERNS1_15function_bufferE+00000039
[  8] 0x00007f385019b487 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00865415
[  9] 0x00007f385019b9c8 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00866760
[ 10] 0x00007f385019bc74 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00867444 _Z12mcr_run_mainRKN7mwboost9function0IiEEbb+00000196
[ 11] 0x00007f38424192e4 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00525028
[ 12] 0x00007f384ffeb1d7 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmvm.so+02986455 _ZN3mvm6detail11SessionImpl7runMainERKN7mwboost9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISA_EEEESE_+00000087
[ 13] 0x00007f38502af71a /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00354074 mclRunMain+00001194
[ 14] 0x0000000000400d0c                                     ./spm8_glnxa64+00003340
[ 15] 0x00007f3856776bf7                    /lib/x86_64-linux-gnu/libc.so.6+00138231 __libc_start_main+00000231
[ 16] 0x0000000000400a19                                     ./spm8_glnxa64+00002585

** This crash report has been saved to disk as /home/username/matlab_crash_dump.28684-1 **



MATLAB is exiting because of fatal error
Killed

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 12, 2021

I get the same crash when attempting to initialize SPM12 (r7771) using the R2019b MCR (v97) on the same Ubuntu 18.04 workstation:

export FORCE_SPMMCR=1
export SPM_HTML_BROWSER=0
./run_spm12.sh /destination/matlab/MATLAB_Runtime/v97 quit

Again run_spm12 crashes with:


--------------------------------------------------------------------------------
      Segmentation violation detected at mar. oct. 12 16:53:49 2021 +0200
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : UTF-8
  GNU C Library            : 2.27 stable
  MATLAB Architecture      : glnxa64
  MATLAB Root              : /destination/matlab/MATLAB_Runtime/v97
  MATLAB Version           : 9.7.0.1737446 (R2019b) Update 9
  Operating System         : Ubuntu 18.04.6 LTS
  Process ID               : 29253
  Processor ID             : x86 Family 6 Model 45 Stepping 7, GenuineIntel
  Static TLS mitigation    : Enabled: Full

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007ffd127b0120
  RCX = 0000000000000000  RDX = 00000000006030a0
  RSP = 00007ffd127afe70  RBP = 00007ffd127b0080
  RSI = 0000000000000001  RDI = 00007ffd127b0120

   R8 = 0000000000000000   R9 = 0000000000400a95
  R10 = 00000000000000cd  R11 = 00007f0a11a3b5a0
  R12 = 00007ffd127b0120  R13 = 0000000000000001
  R14 = 0000000000000000  R15 = 0000000000e7c080

  RIP = 00007f09fd428c83  EFL = 0000000000010202

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f09fd428c83 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02686083
[  1] 0x00007f09fd41f9fd /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02648573 mclInitializeComponentInstanceNonEmbeddedStandalone+00000061
[  2] 0x00007f0a11a3b5e2 /destination/matlab/MATLAB_Runtime/v97/runtime/glnxa64/libmwmclmcrrt.so+00103906 mclInitializeComponentInstanceNonEmbeddedStandalone_proxy+00000066
[  3] 0x0000000000400b46 /destination/spm12-standalone-7771/spm12_glnxa64+00002886
[  4] 0x0000000000400b64 /destination/spm12-standalone-7771/spm12_glnxa64+00002916
[  5] 0x0000000000400bb2 /destination/spm12-standalone-7771/spm12_glnxa64+00002994
[  6] 0x00007f0a0a9f7220 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00352800
[  7] 0x00007f09fcb6c587 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00570759 _ZN7mwboost6detail8function21function_obj_invoker0INS_3_bi6bind_tINS3_11unspecifiedENS_9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISD_EEEENS3_5list1INS3_5valueISF_EEEEEEiE6invokeERNS1_15function_bufferE+00000039
[  8] 0x00007f0a0a8e3487 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00865415
[  9] 0x00007f0a0a8e39c8 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00866760
[ 10] 0x00007f0a0a8e3c74 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00867444 _Z12mcr_run_mainRKN7mwboost9function0IiEEbb+00000196
[ 11] 0x00007f09fcb612e4 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00525028
[ 12] 0x00007f0a0a7331d7 /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmvm.so+02986455 _ZN3mvm6detail11SessionImpl7runMainERKN7mwboost9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISA_EEEESE_+00000087
[ 13] 0x00007f0a0a9f771a /destination/matlab/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00354074 mclRunMain+00001194
[ 14] 0x0000000000400c59 /destination/spm12-standalone-7771/spm12_glnxa64+00003161
[ 15] 0x00007f0a10ebebf7                    /lib/x86_64-linux-gnu/libc.so.6+00138231 __libc_start_main+00000231
[ 16] 0x00000000004009ba /destination/spm12-standalone-7771/spm12_glnxa64+00002490
[ 17] 0x0000000000000000                                   <unknown-module>+00000000

** This crash report has been saved to disk as /home/username/matlab_crash_dump.29253-1 **



MATLAB is exiting because of fatal error
Killed

Any clue?

@gllmflndn
Copy link

Sorry, I don't know. Any chance you can try with 20.04?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 26, 2021

I'm trying to install from scratch, trying to compare the R2010a MCR (v97) and the R2019b MCR (v713).

Installing Standalone SPM12 – MCR v713 on Ubuntu 18.04

On an up-to-date Ubuntu 18.04 workstation, following the SPM/Standalone instructions, I am unable to execute MCRInstaller.bin. Without -silent, I see additional messages.

Sample MCR v713 installation attempt on Ubuntu 18.04
$ chmod 755 MCRInstaller.bin
$ ./MCRInstaller.bin -P bean421.installLocation="MCR" -silent





					 No Java Runtime Environment(JRE) was found on this system.







$ 
Additional messages
          Initializing InstallShield Wizard........
          Extracting Bundled JRE.          
          Verifying JVM.        .          
It used to work with Ubuntu 16.04, or perhaps earlier versions of Ubuntu 18.04.

Installing Standalone SPM12 – MCR v97 on Ubuntu 18.04

Installation of the MATLAB Runtime

On an up-to-date Ubuntu 18.04 LTS workstation, I am able to install the R2019b MCR using MATLAB_Runtime_R2019b_Update_9_glnxa64.zip, following the instructions under Install and Configure MATLAB Runtime:

Sample MCR v97 installation on Ubuntu 18.04
$ mkdir /tmp/M
$ cd /tmp/M
$ unzip /path/to/MATLAB_Runtime_R2019b_Update_9_glnxa64.zip 
$ 
$ ./install
Installing ...
Finished
$ 

Folder_Selection
Confirmation
Installation_Complete

Installation of the SPM Standalone

I am unable to run a fresh installation of Standalone SPM12, it crashes on the first run:

Sample SPM12 run with MCR v97 on Ubuntu 18.04
$ cd /tmp/
$ 
$ unzip /i2bm/src/spm/standalone/spm12_r7771.zip 
Archive:  /i2bm/src/spm/standalone/spm12_r7771.zip
   creating: spm12/
 extracting: spm12/spm12_maci64.zip  
  inflating: spm12/spm12_glnxa64     
  inflating: spm12/run_spm12.sh      
  inflating: spm12/spm12_maci64      
  inflating: spm12/spm12.ctf         
  inflating: spm12/spm12_win64.exe   
  inflating: spm12/spm12_win32.exe   
$ 
$ cd spm12
$ 
$ ./run_spm12.sh /tmp/MATLAB_Runtime/v97/ quit

--------------------------------------------------------------------------------
      Segmentation violation detected at mar. oct. 26 17:13:20 2021 +0200
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : UTF-8
  Desktop Environment      : ubuntu:GNOME
  GNU C Library            : 2.27 stable
  MATLAB Architecture      : glnxa64
  MATLAB Root              : /tmp/MATLAB_Runtime/v97
  MATLAB Version           : 9.7.0.1737446 (R2019b) Update 9
  Operating System         : Ubuntu 18.04.6 LTS
  Process ID               : 12654
  Processor ID             : x86 Family 6 Model 45 Stepping 7, GenuineIntel
  Static TLS mitigation    : Enabled: Full

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007ffce1f5fb90
  RCX = 0000000000000000  RDX = 00000000006030a0
  RSP = 00007ffce1f5f8e0  RBP = 00007ffce1f5faf0
  RSI = 0000000000000001  RDI = 00007ffce1f5fb90

   R8 = 0000000000000000   R9 = 0000000000400a95
  R10 = 00000000000000cd  R11 = 00007f3ee3e505a0
  R12 = 00007ffce1f5fb90  R13 = 0000000000000001
  R14 = 0000000000000000  R15 = 0000000001ec49d0

  RIP = 00007f3ecf83fc83  EFL = 0000000000010202

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f3ecf83fc83 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02686083
[  1] 0x00007f3ecf8369fd /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02648573 mclInitializeComponentInstanceNonEmbeddedStandalone+00000061
[  2] 0x00007f3ee3e505e2 /tmp/MATLAB_Runtime/v97//runtime/glnxa64/libmwmclmcrrt.so+00103906 mclInitializeComponentInstanceNonEmbeddedStandalone_proxy+00000066
[  3] 0x0000000000400b46                      /tmp/spm12/spm12_glnxa64+00002886
[  4] 0x0000000000400b64                      /tmp/spm12/spm12_glnxa64+00002916
[  5] 0x0000000000400bb2                      /tmp/spm12/spm12_glnxa64+00002994
[  6] 0x00007f3edce0b220 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00352800
[  7] 0x00007f3ecef83587 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00570759 _ZN7mwboost6detail8function21function_obj_invoker0INS_3_bi6bind_tINS3_11unspecifiedENS_9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISD_EEEENS3_5list1INS3_5valueISF_EEEEEEiE6invokeERNS1_15function_bufferE+00000039
[  8] 0x00007f3edccf7487 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00865415
[  9] 0x00007f3edccf79c8 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00866760
[ 10] 0x00007f3edccf7c74 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00867444 _Z12mcr_run_mainRKN7mwboost9function0IiEEbb+00000196
[ 11] 0x00007f3ecef782e4 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00525028
[ 12] 0x00007f3edcb471d7 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmvm.so+02986455 _ZN3mvm6detail11SessionImpl7runMainERKN7mwboost9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISA_EEEESE_+00000087
[ 13] 0x00007f3edce0b71a /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00354074 mclRunMain+00001194
[ 14] 0x0000000000400c59                      /tmp/spm12/spm12_glnxa64+00003161
[ 15] 0x00007f3ee32d3bf7                    /lib/x86_64-linux-gnu/libc.so.6+00138231 __libc_start_main+00000231
[ 16] 0x00000000004009ba                      /tmp/spm12/spm12_glnxa64+00002490
[ 17] 0x0000000000000000                                   <unknown-module>+00000000

** This crash report has been saved to disk as /home/xxxxxxxx/matlab_crash_dump.12654-1 **



MATLAB is exiting because of fatal error
Killed
$ 
Appears to be a fairly common problem: * [MATLAB Central – MATLAB Answers – MATLAB Runtime crushes when trying to install SPM Standalone 12 in ubuntu 18.04](https://mathworks.com/matlabcentral/answers/574378-matlab-runtime-crushes-when-trying-to-install-spm-standalone-12-in-ubuntu-18-04)

Note that MATLAB R2019b is compatible with Ubuntu 16.04, 18.04 and 19.04 according to System Requirements - Release 2019b - Linux.

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 26, 2021

Running existing versions of Standalone SPM12 – Ubuntu 16.04 → Ubuntu 18.04

Trying different versions of SPM12 installed using Ubuntu 16.04, sometimes years ago, but now running on Ubuntu 18.04. I don't see crashes, at least on very simple tasks. I'll double check with my colleagues.

Sample SPM12 runs with MCR v713 on Ubuntu 18.04
$ SPM12_STANDALONE_HOME=/path/to/spm12-standalone-6472
$ 
$ "${SPM12_STANDALONE_HOME}/run_spm12.sh" "${SPM12_STANDALONE_HOME}/mcr/v713"
SPM12 (6472): /i2bm/local/spm12-standalone-6472/spm12_mcr/spm12
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - http://www.fil.ion.ucl.ac.uk/spm/


SPM12: v6472                                       18:00:00 - 26/10/2021
========================================================================
Initialising SPM                        :                   ........done

SPM present working directory:
	/home/xxxxxxxx
Bye for now...

$ 
$ SPM12_STANDALONE_HOME=/i2bm/local/spm12-standalone-7219
$ 
$ "${SPM12_STANDALONE_HOME}/run_spm12.sh" "${SPM12_STANDALONE_HOME}/mcr/v713"
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - http://www.fil.ion.ucl.ac.uk/spm/


SPM12: v7219                                       18:01:00 - 26/10/2021
========================================================================
Initialising SPM                        :                   ........done

SPM present working directory:
	/home/xxxxxxxx
Bye for now...

$ 
$ SPM12_STANDALONE_HOME=/path/to/spm12-standalone-7771
$ 
$ "${SPM12_STANDALONE_HOME}/run_spm12.sh" "${SPM12_STANDALONE_HOME}/mcr/v713"
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - https://www.fil.ion.ucl.ac.uk/spm/


SPM12: v7771                                       18:02:00 - 26/10/2021
========================================================================
Initialising SPM                        :                   ........done

SPM present working directory:
	/home/xxxxxxxx
Bye for now...

$ 

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 26, 2021

I'm trying to install from scratch again, now on Ubuntu 20.04:

Installing Standalone SPM12 – MCR v713 on Ubuntu 20.04

On an up-to-date Ubuntu 20.04 workstation, following the SPM/Standalone instructions, I am unable to execute MCRInstaller.bin.

Sample MCR v713 installation attempt on Ubuntu 20.04
$ chmod 755 MCRInstaller.bin
$ ./MCRInstaller.bin -P bean421.installLocation="MCR" -silent





					 No Java Runtime Environment(JRE) was found on this system.







$ 

Installing Standalone SPM12 – MCR v97 on Ubuntu 20.04

Installation of the MATLAB Runtime

On an up-to-date Ubuntu 20.04 LTS workstation, I am able to install the R2019b MCR using MATLAB_Runtime_R2019b_Update_9_glnxa64.zip, following the instructions under Install and Configure MATLAB Runtime.

Sample MCR v97 installation on Ubuntu 20.04
$ mkdir /tmp/M
$ cd /tmp/M
$ unzip /path/to/MATLAB_Runtime_R2019b_Update_9_glnxa64.zip 
$ 
$ ./install
Installing ...
Finished
$ 

Installation of the SPM Standalone

I am unable to run a fresh installation of Standalone SPM12, it crashes on the first run, on Ubuntu 20.04 as well as on Ubuntu 18.04:

Sample SPM12 run with MCR v97 on Ubuntu 20.04
$ cd /tmp/
$ 
$ unzip /i2bm/src/spm/standalone/spm12_r7771.zip 
Archive:  /i2bm/src/spm/standalone/spm12_r7771.zip
   creating: spm12/
 extracting: spm12/spm12_maci64.zip  
  inflating: spm12/spm12_glnxa64     
  inflating: spm12/run_spm12.sh      
  inflating: spm12/spm12_maci64      
  inflating: spm12/spm12.ctf         
  inflating: spm12/spm12_win64.exe   
  inflating: spm12/spm12_win32.exe   
$ 
$ cd spm12
$ 
$ ./run_spm12.sh /tmp/MATLAB_Runtime/v97/ quit
libGL error: MESA-LOADER: failed to open nouveau: /usr/lib/dri/nouveau_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: nouveau
libGL error: MESA-LOADER: failed to open nouveau: /usr/lib/dri/nouveau_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: nouveau
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast

--------------------------------------------------------------------------------
      Segmentation violation detected at mar. oct. 26 22:00:00 2021 +0200
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : UTF-8
  Desktop Environment      : ubuntu:GNOME
  GNU C Library            : 2.31 stable
  MATLAB Architecture      : glnxa64
  MATLAB Root              : /tmp/MATLAB_Runtime/v97
  MATLAB Version           : 9.7.0.1737446 (R2019b) Update 9
  Operating System         : Ubuntu 20.04.3 LTS
  Process ID               : 9713
  Processor ID             : x86 Family 6 Model 94 Stepping 3, GenuineIntel
  Static TLS mitigation    : Enabled: Full

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007ffd807880d0
  RCX = 0000000000000000  RDX = 00000000006030a0
  RSP = 00007ffd80787e20  RBP = 00007ffd80788030
  RSI = 0000000000000001  RDI = 00007ffd807880d0

   R8 = 0000000000000000   R9 = 0000000000400a95
  R10 = 000000000040063a  R11 = 00007f11b92fd5a0
  R12 = 00007ffd807880d0  R13 = 0000000000000001
  R14 = 0000000000000000  R15 = 0000000000e9c240

  RIP = 00007f11a614fc83  EFL = 0000000000010202

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f11a614fc83 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02686083
[  1] 0x00007f11a61469fd /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclmcr.so+02648573 mclInitializeComponentInstanceNonEmbeddedStandalone+00000061
[  2] 0x00007f11b92fd5e2 /tmp/MATLAB_Runtime/v97//runtime/glnxa64/libmwmclmcrrt.so+00103906 mclInitializeComponentInstanceNonEmbeddedStandalone_proxy+00000066
[  3] 0x0000000000400b46                           /tmp/spm12/spm12_glnxa64+00002886
[  4] 0x0000000000400b64                           /tmp/spm12/spm12_glnxa64+00002916
[  5] 0x0000000000400bb2                           /tmp/spm12/spm12_glnxa64+00002994
[  6] 0x00007f11b3749220 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00352800
[  7] 0x00007f11a5469587 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00570759 _ZN7mwboost6detail8function21function_obj_invoker0INS_3_bi6bind_tINS3_11unspecifiedENS_9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISD_EEEENS3_5list1INS3_5valueISF_EEEEEEiE6invokeERNS1_15function_bufferE+00000039
[  8] 0x00007f11b3635487    /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00865415
[  9] 0x00007f11b36359c8    /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00866760
[ 10] 0x00007f11b3635c74    /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmcr.so+00867444 _Z12mcr_run_mainRKN7mwboost9function0IiEEbb+00000196
[ 11] 0x00007f11a545e2e4 /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwMVMLocal.so+00525028
[ 12] 0x00007f11b34851d7    /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmvm.so+02986455 _ZN3mvm6detail11SessionImpl7runMainERKN7mwboost9function1IiRKSt6vectorINSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEESaISA_EEEESE_+00000087
[ 13] 0x00007f11b374971a /tmp/MATLAB_Runtime/v97/bin/glnxa64/libmwmclbase.so+00354074 mclRunMain+00001194
[ 14] 0x0000000000400c59                           /tmp/spm12/spm12_glnxa64+00003161
[ 15] 0x00007f11b8f8b0b3                    /lib/x86_64-linux-gnu/libc.so.6+00159923 __libc_start_main+00000243
[ 16] 0x00000000004009ba                           /tmp/spm12/spm12_glnxa64+00002490
[ 17] 0x0000000000000000                                   <unknown-module>+00000000

** This crash report has been saved to disk as /home/xxxxxxxx/matlab_crash_dump.9713-1 **



MATLAB is exiting because of fatal error
Killed
$ 

@DimitriPapadopoulos
Copy link
Contributor

So we have two issues:

  • The one reported by @manuegrx, where Standalone SPM8 and SPM12 crash when running. For some reason, I cannot reproduce that crash, for now. I'm using SPM outside any container, on vanilla Ubuntu 18.04 and 20.04 machines.
  • The one reported by myself, where Standalone SPM12 crashes while installing, both on Ubuntu 18.04 and 20.04: either the v713 MCR crashes during installation, or SPM12 crashes on startup with the v97 MCR.

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 28, 2021

Actually we have more issues:

  1. For at least two persons in our department, SPM12 crashes early on start up. We have identified the crash is related to specific displays: it does not depend on the user account, and when displaying remotely it does not depend on the machine running SPM12 (usually Ubuntu 18.04 or Ubuntu 20.04), but on the displaying machine (the one with the X server).
    I have little hope this can be fixed. I haven't been able to identify what exactly on the displaying machine triggers the crash: all displaying machines here run Ubuntu 18.04 with proprietary Nvidia drivers (usually 390 or 470). My main hope is a new release of SPM12 compiled with a more recent version of Matlab.
Typical error message
------------------------------------------------------------------------
       Segmentation violation detected at Thu Oct 28 15:02:07 2021
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.10.0.499 (R2010a)
  MATLAB License:   unknown
  Operating System: Linux 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64
  GNU C Library:    2.27 stable
  Window System:    The X.Org Foundation (12008000), display :1
  Current Visual:   0x21 (class 4, depth 24)
  Processor ID:     x86 Family 6 Model 5 Stepping 4, GenuineIntel
  Virtual Machine:  Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
  Default Encoding:  UTF-8

Fault Count: 1

Register State:
  rax = 0000000000000000   rbx = 00007fe628025860
  rcx = 0000000000000000   rdx = 0000000000000000
  rbp = 0000000000000000   rsi = 000000003e07c725
  rdi = 0000000000000000   rsp = 00007fe6304cfda8
   r8 = 0000000000000001    r9 = 00007fe6304cfc30
  r10 = 0000000000000000   r11 = 00007fe63fc48514
  r12 = 0000000000000000   r13 = 0000000000000000
  r14 = 00007fe6304d00c8   r15 = 0000000000000000
  rip = 00007fe63fc274e1   flg = 0000000000010283

Stack Trace:

If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/ts/help_request_1.html

A technical support engineer might contact you with further information.

Thank you for your help.


Warning: 1 invisible figure(s) exist at MCR termination.
 
If your application has terminated unexpectedly, please note that
 applications generated by the MATLAB Compiler terminate when there are no
 visible figure windows. See the documentation for WaitForFiguresToDie and
 WAITFORCALLBACKS for more information.
  1. For other persons in our department, SPM12 starts without problems, but crashes during specific tasks. As I said I cannot reproduce this - yet. Again, a new release of SPM12 compiled with a more recent version of Matlab might help.

  2. Current Standalone SPM12 and Standalone SPM8 cannot be installed on Ubuntu 18.04 and 20.04, because the MCR installer MCRInstaller.bin cannot run on these platforms. We currently have to install from Ubuntu 16.04. The solution is to release new Standalone SPM12 (and perhaps Standalone SPM8) executables, compiled with a recent Matlab.

  3. @gllmflndn It is not possible to run existing Standalone SPM12 executables, compiled with R2010b, using a newer MCR such as v97. In retrospect this makes absolute sense, because of binary compatibility problems. Again, we need new Standalone SPM12 executables, compiled with a newer Matlab such as R2020b. Can we expect new Standalone SPM12 (and perhaps Standalone SPM8) releases, compiled with a recent Matlab, soon?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Oct 28, 2021

Just for reference...

Installing Standalone SPM12 – MCR v713 on Ubuntu 16.04

On an Ubuntu 16.04 workstation, following the SPM/Standalone instructions, I am able to execute MCRInstaller.bin, unlike on Ubuntu 18.04 and 20.04. Note that bc is a requirement.

Sample MCR v713 installation on Ubuntu 16.04
$ ./MCRInstaller.bin -console -P installLocation=/tmp









          Initializing InstallShield Wizard........
          Launching InstallShield Wizard........


-------------------------------------------------------------------------------
MATLAB(R) Compiler Runtime 7.13 - InstallShield Wizard

Welcome to the InstallShield Wizard for MATLAB(R) Compiler Runtime 7.13

The InstallShield Wizard will install MATLAB(R) Compiler Runtime 7.13 on your
computer.
To continue, choose Next.

MATLAB(R) Compiler Runtime 7.13
The MathWorks
http://www.mathworks.com
[...]

@gllmflndn
Copy link

Can you test what happens with this version of SPM12 that uses the R2021b Runtime: WCHN/CTseg#9 (comment)

@DimitriPapadopoulos
Copy link
Contributor

Good news!

The new version:

  • fixes issue 1,
  • fixes issue 3, of course, since the MCR v911 from MATLAB R2021b is fully compatible with recent versions of Ubuntu such as 18.04 and 20.04,
  • makes issue 4 irrelevant, as the SPM12 executable has been compiled with a recent Matlab compiler.

I'll investigate issue 2 and come back to you.

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Nov 2, 2021

@Hboni and @manuegrx, could test the new Standalone SPM12 installed for testing purposes under /i2bm/local/_spm12-standalone-8168?

Just run:

export SPM_HTML_BROWSER=0
/i2bm/local/_spm12-standalone-8168/run_spm12.sh /i2bm/local/matlab/MATLAB_Runtime/v911

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Nov 5, 2021

Also you must have added a libXp.so.6library to casa-distro containers, as this library is not available any more on Ubuntu 18.04. Where did you get that library from?

In my case:

$ dpkg -S /usr/lib/x86_64-linux-gnu/libXp.so.6
libxp6:amd64: /usr/lib/x86_64-linux-gnu/libXp.so.6
$ 
$ apt show libxp6
Package: libxp6
Version: 1:1.0.1-2
Status: install ok installed
Priority: optional
Section: libs
Source: libxp
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Installed-Size: 78,8 kB
Pre-Depends: multiarch-support
Depends: libc6 (>= 2.4), libx11-6, libxau6, libxext6
Download-Size: inconnu
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: X Printing Extension (Xprint) client library
 libXp provides public APIs to allow client applications to render to
 non-display devices, making use of the X Print Service.
 .
 More information about X.Org can be found at:
 <URL:http://www.X.org>
 .
 This module can be found at
 git://anongit.freedesktop.org/git/xorg/lib/libXp

$ 

@Hboni
Copy link
Contributor

Hboni commented Nov 5, 2021

All the images of casa-distro that I used for tests were based on Ubuntu-18.04 as mentionned here. I could try to dig to find differences between image versions when I have some time.

@denisri
Copy link
Contributor

denisri commented Jun 14, 2022

I'm coming back on this issue as I'm trying to test shipping SPM in casa-distro images (see brainvisa/brainvisa.github.io#106).
I confirm that spm12-standalone-8168 with MCR 911, at least can launch the GUI inside or outside a container on a Ubuntu 18.04 system. I did not set the variable SPM_HTML_BROWSER but it worked anyway, but I can set it up. It seems to start also in an Ubuntu 22.04 container, which is good news.
For the libXp.so.6 problem mentioned above, SPM did actually start without it. So is it still required, or did this dependency disappear in MCR 911 ? Thus it is possible to install libXp.so.6 from sources in an Ubuntu 18.04 system (we use https://mirror.umd.edu/ubuntu/pool/main/libx/libxp/libxp_1.0.2.orig.tar.gz) but it seems pretty impossible to install in Ubuntu 22.04 (I have tried it because some users wanted to use AFNI which apparently requires it, and I had to give up).

However I see that the MCR 911 installed at neurospin is 8.5 Gb in size, whereas the v713 shipped with spm12-standalone-7771 was "only" 500 Mb large. That's a notable difference... Has v713 been pruned in any way because parts were not needed for SPM, or did the "raw" MCR grow this big ?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Jun 14, 2022

  • I am confident libXp.so.6 will not be required by recent MCRs. I think libXp.so.6 can be installed using the DEB package from an older Ubuntu distribution up to Ubuntu 20.04 (but 22.04 is not based on X11 by default anyway).
  • We are still waiting for an official new release of SPM Standalone - 8168 is a temporary release. @gllmflndn What about a new SPM Standalone release? 😄
  • The difference in MCR sizes might be related to the above: for 8168 I have installed the full MCR download from Mathworks (/i2bm/local/matlab/MATLAB_Runtime/v911), while for 7771 I use the MCR bundled with SPM12 Standalone (/i2bm/local/spm12-standalone-7771/mcr/v713).

That said, I do see a growth in MCR sizes ! Here is the output of su -h:

897M	MATLAB_Compiler_Runtime/v717
1,1G	MATLAB_Compiler_Runtime/v80
1,1G	MATLAB_Compiler_Runtime/v81
1,5G	MATLAB_Compiler_Runtime/v83
1,6G	MATLAB_Compiler_Runtime/v84
1,6G	MATLAB_Compiler_Runtime/v85
1,6G	MATLAB_Compiler_Runtime/v90
3,3G	MATLAB_Runtime/v93
4,1G	MATLAB_Runtime/v95
5,8G	MATLAB_Runtime/v97
8,5G	MATLAB_Runtime/v911

[edited for proper ordering of MCR versions]

@denisri
Copy link
Contributor

denisri commented Jun 14, 2022

Yes, that was part of the question: is the mcr 713 bundled with SPM12 standalone a lightened version, and is it possible to lighten 911 the same way, or do we need to carry the whole 8.5 Go ? From your stats, it seems that MCRs have consistently grown in a somewhat uncontrolled exponential way (this size seems crazy to me: just the matlab runtime is 3 times the size of a complete full featured operating system with several programming languages in it - gosh !)

@denisri
Copy link
Contributor

denisri commented Jun 14, 2022

(actually I don't even know how the numbers are ordered: is 911 > 97 ?)

@DimitriPapadopoulos
Copy link
Contributor

My wrong, I had misinterpreted the MATLAB Runtime version numbers:
(911 = 9.11) > (97 = 9.7)

I have reordered the above list.

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Jun 14, 2022

I'm not certain the MCR bundled with SPM12 Standalone is a light version. The size of the bundled v713 is 451M, which is half the size of v717, 897M – this is consistent with the exponential growth 😄

MATLAB

@denisri
Copy link
Contributor

denisri commented Jun 14, 2022

So we're doomed. No escape. :|

@denisri
Copy link
Contributor

denisri commented Jun 15, 2022

Unless an official version of SPM is released soon with only the needed MCR parts in it, since it is said to be possible (https://fr.mathworks.com/matlabcentral/answers/101332-why-is-matlab-runtime-so-large)..........? ;)

@gllmflndn
Copy link

I have a look at this soon but would it help already if you can specify which toolboxes to install from the MCR as we do here:
https://github.com/spm/spm-docker/blob/main/matlab/singularity.def#L22-L23

@DimitriPapadopoulos
Copy link
Contributor

I don't think we can without your MATLAB Compiler. See https://fr.mathworks.com/matlabcentral/answers/101332-why-is-matlab-runtime-so-large:

Starting from R2016a release, to distribute your application/Compiler SDK library with a subset of MATLAB Runtime that is needed for the application/library to run, you can generate an application/library installer with deploytool GUI or "compiler.package.installer" command. With this installer, the selective MATLAB Runtime will be installed together with the target standalone application or Compiler SDK library. When you generate the installer, MATLAB Runtime can be packaged either in the installer or downloaded from web.
[...]
MATLAB Runtime can also be installed with installer downloaded from
[...]
This installer will install the monolithic runtime and there is no way to configure selective installation.

@denisri
Copy link
Contributor

denisri commented Jun 15, 2022

Well I'm not sure to be able to fully answer that ;) We are using the core SPM (normalization, segmentation...), and Dartel, but I'm not completely aware of what are using the different toolboxes of brainvisa... I don't think we want to install a "custom SPM" just for us if the main distribution ships the whole MCR in order to allow all possible toolboxes to run, if this is needed. I was just hoping the whole SPM + toolboxes could require a limited set of libraries and ship only those, but I was maybe naive.
This is probably too difficult to handle, both for you @gllmflndn for SPM, and for us in brainvisa.

@gllmflndn
Copy link

The MCR v713 we distribute with SPM standalone is the unmodified one from 2010a. As you noticed, the MCR has evolved over time to include more and more of their (unused) toolboxes. What I was pointing out was that, despite the statement above ("This installer will install the monolithic runtime and there is no way to configure selective installation."), it seems that you can select when installing the MCR which toolboxes to deploy. See for example the final size of the singularity image:
https://github.com/spm/spm-docker/pkgs/container/spm-docker/23763165?tag=matlab

@denisri
Copy link
Contributor

denisri commented Jun 15, 2022

So you've already done that, using MCR 97 lightened to the needed toolboxes, in a Ubuntu 22.04 system. I just check it and see that the MCR there is "only" 2.3 GB (compared to 5.8 as listed by @DimitriPapadopoulos above). I did not know such a container already existed, and that's a very good news, and maybe we should rely on it. The problem is that we cannot merge singularity containers, nor call one from another one (at least I have not succeeded in such an attempt), thus any modularity seems impossible. But we could perhaps unpack the image and copy its content (all is in /opt I guess), or merge/include your singularity recipe (or part of it) into ours.
Thanks @gllmflndn ...

@gllmflndn
Copy link

I hadn't checked the actual size of the MCR there and I presume that the size mentioned in the manifest (~1.2GB) is for everything compressed. It's still quite large though. It seems that some extra files can be safely removed but I didn't look into this recently:
spm/spm-docker#2
From what I understand you are doing, I would just copy the relevant bit of the singularity recipe to install only some parts of the MCR:
https://github.com/spm/spm-docker/blob/main/matlab/singularity.def#L18-L25

@denisri
Copy link
Contributor

denisri commented Jun 15, 2022

Yes, singularity .sif images are a bit compressed, and are larger inside than outside (the magic "bag of holding" concept). Yes it seems that for SPM you install just the MCR core and "numeric" package. It is still big, yes, but less than the full thing. And, yes, it's probably the good way to go, thanks again :)

@denisri
Copy link
Contributor

denisri commented Jun 16, 2022

By the way, @DimitriPapadopoulos, we should probably install this version of SPM12 (7771 + v97) in neurospin, shouldn't we ?

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Jun 16, 2022

Mix 7771 with v97? But that cannot work, can it?

We have:

  • 7771 with the bundled v713 MCR
  • temporary test version 8168 with v911

[edit: v97 → v911]

@gllmflndn
Copy link

Would this help?

@denisri
Copy link
Contributor

denisri commented Jun 16, 2022

It seems to: that's what is shipped in the SPM containers (it's obviously another build of 7771 based on v97, not the one we are using in neurospin). I have done it on my laptop and it works, just as in https://github.com/spm/spm-docker/blob/main/matlab/singularity.def

@denisri
Copy link
Contributor

denisri commented Jun 16, 2022

(otherwise I could not run the SPM 8168 installed in neurospin with a MCR 911 installed "minimally": it complains that the MCR version is not the expected one, whereas it does work with the "full" MCR 911 installed in neurospin (same version, in principle?), and I don't understand that - but maybe I did a mistake somewhere)

@denisri
Copy link
Contributor

denisri commented Jun 16, 2022

temporary test version 8168 with v97

I just realize I did not read that correctly - 8186 is built with v97, not 911 ? I ran it using 911 and it did not complain (the full 911, as I said just earlier)

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Jun 16, 2022

My wrong. We currently have:

  • 7771 with the bundled MCR v713
  • temporary test version 8168 with v911

I will install I have installed:

  • 7771 with MCR v97, as suggested by @gllmflndn (I assume I just need to overwrite with the ZIP file and point to our v97 instead of v713

@DimitriPapadopoulos
Copy link
Contributor

I just realize I did not read that correctly - 8186 is built with v97, not 911 ? I ran it using 911 and it did not complain (the full 911, as I said just earlier)

8186 is built with v911. From /i2bm/local/_spm12-standalone-8168/spm12_mcr/.META/manifest.xml:

<manifest ... mcr-major-version="9" mcr-minor-version="11" mcr-release-version="0" need_exclusive_mcr_process="0" need_java="1 ...>

You might find a list of required MCR components in there.

@denisri
Copy link
Contributor

denisri commented Jun 16, 2022

I think the installation of spm12-standalone-7771 + mcr v97 fixes this issue. I guess we can close the ticket now.
Thanks to all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants