<div dir="ltr">Hi Mainak,<div><br></div><div>JMC: thanks for your comments here.</div><div><br></div><div>I also ran into a similar problem when compiling MITgcm on my</div><div>Macbook w/ the 10.15.7 Catalina upgrade.</div><div><br></div><div>I fixed this by adding "#include <stdio.h>" to:</div><div>/eesupp/src/setdir.c<br></div><div><br></div><div>and adding the following lines to my optfile:</div><div><br>FFLAGS="$FFLAGS -w -fallow-argument-mismatch -O2"<br>FCFLAGS="$FCFLAGS -w -fallow-argument-mismatch -O2"</div><div><br></div><div>Best,</div><div>Dustin <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 16, 2021 at 5:17 AM Jean-Michel Campin <<a href="mailto:jmc@mit.edu">jmc@mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Mainak,<br>
<br>
I am not familiar with macbook, but the error you get might be<br>
due to a recent version of gcc (10 or above) for which we need a patch to the optfile,<br>
as proposed by Gael Forget here:<br>
 <a href="https://github.com/MITgcm/MITgcm/pull/480" rel="noreferrer" target="_blank">https://github.com/MITgcm/MITgcm/pull/480</a><br>
<br>
There might be other issues but hard to tell since it fails to compile<br>
early on because of this new gcc version.<br>
<br>
Also, I would suggest to try first without MPI to check that everything<br>
is in place and once you pass this stage you can try again with MPI.<br>
<br>
Cheers,<br>
Jean-Michel<br>
<br>
On Wed, Jun 16, 2021 at 10:11:06AM +0400, Mainak Mondal wrote:<br>
> Hi,<br>
> <br>
> I recently tried installing MITgcm on macbook pro M1 with 8 core.<br>
> <br>
> I tried the followings:<br>
> <br>
> I installed openmpi, netcdf using Homebrew.<br>
> <br>
> %%%%%%%%%%%%%%%%%%%%%%<br>
> checking for packages installed<br>
> %%%%%%%%%%%%%%%%%%%%%<br>
> pinta@Mainaks-MBP ~ % which gcc<br>
> /usr/bin/gcc<br>
> pinta@Mainaks-MBP ~ % which gfortran<br>
> /opt/homebrew/bin/gfortran<br>
> pinta@Mainaks-MBP ~ % which mpif90<br>
> /opt/homebrew/bin/mpif90<br>
> pinta@Mainaks-MBP ~ % which ncdump<br>
> /opt/homebrew/bin/ncdump<br>
> %%%%%%%%%%%%%%%%%%%%<br>
> <br>
> I downloaded the latest MITgcm<br>
> <br>
> I tried to compile MITgcm/verification/tutorial_plume_on_slope/ using 8<br>
> cores.<br>
> <br>
> %%%%%%%%%%%%%%%%%%%%<br>
> initially while in the build directory, I ran<br>
> pinta@Mainaks-MBP build % ../../../tools/genmake2 -mods=../code  -mpi<br>
> <br>
> It shows:<br>
> The platform appears to be:  darwin_arm64<br>
> Error: can't read OPTFILE="../../../tools/build_options/darwin_arm64_mpif77"<br>
> <br>
> Then I tried with the optfile<br>
> ../../../tools/genmake2 -mods=../code<br>
> --optfile=../../../tools/build_options/darwin_amd64_gfortran -mpi<br>
> <br>
> I changed the followings:<br>
> FC=mpif90<br>
> commented out<br>
> #FFLAGS="$FFLAGS -fconvert=big-endian"<br>
> <br>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
> while make depend , I got lots of warning messeges like:<br>
> <br>
> ./mpif.h:37:24: warning: missing terminating ' character<br>
> [-Winvalid-pp-token]<br>
> ! That being said, OMPI's "mpifort" wrapper compiler should<br>
> <br>
> %%%%%%%%%%%%%%%%%%%%%%%<br>
> <br>
> while doing make<br>
> <br>
> Error: Type mismatch between actual argument at (1) and actual argument at<br>
> (2) (INTEGER(4)/REAL(8)).<br>
> cumulsum_z_tile.for:1193:27:<br>
> <br>
>  1164 |             CALL MPI_RECV (ready_to_receive, 1, MPI_INTEGER,<br>
>       |                           2<br>
> ......<br>
>  1193 |             CALL MPI_RECV (loc2Buf, lbuf2, MPI_DOUBLE_PRECISION,<br>
>       |                           1<br>
> Error: Type mismatch between actual argument at (1) and actual argument at<br>
> (2) (REAL(8)/INTEGER(4)).<br>
> make[1]: *** [cumulsum_z_tile.o] Error 1<br>
> make[1]: *** Waiting for unfinished jobs....<br>
> make: *** [fwd_exe_target] Error 2<br>
> <br>
> <br>
> I would really appreciate it if anyone can help me.<br>
> <br>
> Regards<br>
> --<br>
> *Mainak Mondal*<br>
> Post-Doctoral Associate<br>
> A2 104-C<br>
> Center for Global Sea Level Change<br>
> New York University Abu Dhabi<br>
> ph: +971 26285339<br>
<br>
> _______________________________________________<br>
> MITgcm-support mailing list<br>
> <a href="mailto:MITgcm-support@mitgcm.org" target="_blank">MITgcm-support@mitgcm.org</a><br>
> <a href="http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support" rel="noreferrer" target="_blank">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support</a><br>
<br>
_______________________________________________<br>
MITgcm-support mailing list<br>
<a href="mailto:MITgcm-support@mitgcm.org" target="_blank">MITgcm-support@mitgcm.org</a><br>
<a href="http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support" rel="noreferrer" target="_blank">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support</a><br>
</blockquote></div>