After two full work days of struggling with this, I've solved the problem!
On the Compute Canada environment (Cedar specifically) and with the settings described in my question, the only three error messages that I was given, were the ones provided in the initial post. These were compeltely unhelpful and referred to very stable parts of the code that I never modified. These errors were occurring in my own fork (I didn't check the upstream Master branch because I was working with my own fork as a developer, and since these error messages referred to parts of the software that had nothing to do with the parts that I changed, I didn't think my instructions above for compiling the upstream Master would result in any behavior different from what I observed in my fork). Because the upstream Master compiled perfectly in the environment described in the answer by Camps, I switched to that environment and got the following (much more helpful!) error when building my fork with make -j4
:
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/get_etwo_act.F90.o
/home/nike/OpenMolcas/src/level/level.f(394): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated. [MMLR]
2 MMLR,CMM,NCMM,IVSR,IDSTT,RHOAB)
--------^
/home/nike/OpenMolcas/src/level/level.f(525): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated. [MMLR]
2 PARM,MMLR,CMM,NCMM,IVSR,IDSTT,RHOAB)
-------------^
This was followed by a bunch of compiler progress:
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/dynamic_properties.F90.o
compilation aborted for /home/nike/OpenMolcas/src/level/level.f (code 1)
make[2]: *** [CMakeFiles/level/CMakeFiles/level_obj.dir/build.make:80: CMakeFiles/level/CMakeFiles/level_obj.dir/level.f.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8087: CMakeFiles/level/CMakeFiles/level_obj.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/get_nat_lorb.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/fluctuating.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/primo_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/mck_interface.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/mckinley_global.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/rdvec_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/make_fluctuating_charges.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/acore.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/wrvec_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/move_polar.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/polar.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbn2dc.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/bitmap_localisation_atom.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbnacb1.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/print_local.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/print_mpprop.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/bitmap_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbnacb2.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/chk_input.F90.o
[ 84%] Building Fortran object CMakeFiles/loprop/CMakeFiles/loprop_obj.dir/readin_polar.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/domain_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbneldot.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/genbmp_localisation.F90.o
[ 84%] Built target loprop_obj
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/get_cnos.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbnel.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbns1_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/getinfo_localisation_0.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbns2a.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/localise_iterative.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/localise_noniterative.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/loc_nat_orb.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbns2b.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbns2.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/pao_analysis.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/readinp_localisation.F90.o
[ 84%] Building Fortran object CMakeFiles/localisation/CMakeFiles/localisation_obj.dir/testloc.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbnt1_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cmbnt2.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cnthlf_mck.F90.o
[ 84%] Built target localisation_obj
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/cntrct_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/coreb.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/crsph_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ctldns.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ctrlmo.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/dan.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/dede_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/din.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/drvel1.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/drvetc.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/drvh2.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/drvk2_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/drvn1_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/elgrddot.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/elgrd.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/elmem.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/hssprt.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/k2loop_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/knegrd_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/knehss.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/knemem_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/knemmh.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ltocore.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ltosph.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/lu2lu.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/m1grd_mck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/m1kernel.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/m1mm1.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/m1mmh.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/makemo.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/mckinley_banner.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/mkfck.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/moacc.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/mult_sro.F90.o
[ 84%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/na2mem.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/nagrd_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/namem_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/nammh.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/nonatwo.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ovrgrd_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ovrhss.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ovrmem_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/ovrmmh.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/pckint_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/pckmo2.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/pickmo.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/prjgrd_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/prjhss.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/prjmm1.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/prjmmh.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/psoao0_h.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/request_mclr_run.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/rtocore.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/rtosph.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/schint_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/screen_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/smadna.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/sort_mck.F90.o
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/srogrd_mck.F90.o
and then an "internal error" message like the ones I described in the intial post (again in a totally unrelated part of the software, and even in a place unrelated to the three places in which this error was occuring before):
[ 85%] Building Fortran object CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/srohss.F90.o
/home/nike/OpenMolcas/src/mckinley/srogrd_mck.F90(174): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
call SmAdNa(Array(ipFin),nt,rFinal,mop,loper,JndGrd,iuvwx,Indx,idcar,One,tr)
^
[ Aborting due to internal error. ]
compilation aborted for /home/nike/OpenMolcas/src/mckinley/srogrd_mck.F90 (code 1)
make[2]: *** [CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/build.make:1263: CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/srogrd_mck.F90.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:8792: CMakeFiles/mckinley/CMakeFiles/mckinley_obj.dir/all] Error 2
make: *** [Makefile:158: all] Error 2
This means that the integral error
message can basically happen anywhere in the code, due to a totally unrelated warning (or error
in the case of the MOLCAS BIGOT=ON
option which uses -Wall
to turn all
warnings into errors) elsewhere. For some reason the warning/error that triggered these "internal error" messges, didn't show up in the Compute Canada environment, but thankfully did in the environment described by Camps.
By doing literally nothing else but changing MMLR
to MMLR(3)
in both suggested locations of level.f
and rerunning make -j4
, the compilation completed to 100% with no warnings/errors (the "internal errors" in other parts of the software were "fixed" by fixing this unrelated file).
Why did I change MMLR
to MMLR(3)
?
It's strange, because right next to MMLR
were PARM
and CMM
which should have sizes 4
and 3
respectively, and the compiler never complained about those (neither before changing MMLR
to MMLR(3)
, nor after).
This thread on Intel Communities shows that NASTRAN
a finite-element code developed by several companies for NASA starting in the 1960s, had the same error, and that the size of the array should be specified in the CALL
statement (i.e. the "actual" argument) even if it's not specified in the subroutine's first line (i.e. the "dummy" arguments).
Before looking at the above Intel Community thread, I was unsuccessful in getting a solution from this StackOverflow thread which had the same shape matching rules
error message, but I'm putting the link here in case it's useful to others. I had also opened tabs with this, this, this, this, this, this, this and this page, but that first Intel Community thread came up first, either by luck or because of Google watching precisely what I've been doing on my computer in the last two days, so I didn't need the other pages (but again I'm providing them here in case they're helpful to others with similar errors in the future).