[MITgcm-support] help with g77 or gfortran compiling on OSX
Martin Losch
mlosch at awi-bremerhaven.de
Mon Apr 3 03:35:15 EDT 2006
Jen,
gfortran and g77 need different netcdf libraries. The ones that work
with g77 will not work with gfortran, that's why the test within
genmake2 is failing. Create netcdf libraries with gfortran and link
those, and it will work (worked for me, also on PB G4).
The other error message "per se" is no problem, and the code should
compile anyway.
However, all tests pass on my system. I use the default g77 optfile
"tools/build_options/darwin_ppc_g77" (and only because I have
installed my netcdf libraries with fink, in /sw/lib and /sw/include,
this works). And I use this version of g77:
> > g77 -v
> Reading specs from /sw/lib/gcc/powerpc-apple-darwin8.0.0/3.4.3/specs
> Configured with: ../gcc-3.4.3/configure --prefix=/sw --enable-
> languages=f77 --infodir=/share/info --libexecdir=/lib --disable-shared
> Thread model: posix
> gcc version 3.4.3
and gfortran:
> > gfortran -v
> Using built-in specs.
> Target: powerpc-apple-darwin8.5.0
> Configured with: ../gcc-4.2-20060218/configure --enable-
> languages=c,c++,fortran
> Thread model: posix
> gcc version 4.2.0 20060218 (experimental)
I also attach my gfortran optfile, which didn't make it into the
repository yet, because of the non-standard paths for netcdf.
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin_ppc_gfortran
Type: application/octet-stream
Size: 775 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20060403/01d5994e/attachment.obj>
-------------- next part --------------
On Apr 3, 2006, at 1:47 AM, Jennifer MacKinnon wrote:
> Hi,
>
> I've been successfully using the MITGCM on a linux cluster, and am
> now trying to get it up and running on my Mac Powerbook G4 OSX
> (Darwin) I've tried two different Fortran compilers - gfortran and
> g77. With gfortran, the model compiles fine, but seems unable to
> work with NetCDF (enable mnc) options - while running genmake 2 it
> says " Can we create NetCDF-enabled binaries... no". I switched
> to g77 and it suddenly is able to create netCDF-enabled binaries,
> but has another problem (Can we register a signal handler using
> g77... no), and fails to compile. I'm wondering if I'm just not
> using the correct flags, I've gotten a little confused looking for
> other examples of optfiles. Anyone have any suggestions?
>
> I'm currently using something like
>
> #!/bin/bash
>
> CPP='/usr/bin/cpp -traditional -P'
> FC=g77 (or gfortran)
> LINK=g77 (or gfortran)
> NOOPTFLAGS='-O0'
> LIBS="-L/Users/jen/Library/netcdf-3.6.1/lib -lnetcdf"
> INCLUDES="-I/Users/jen/Library/netcdf-3.6.1/include"
>
> DEFINES='-DWORDLENGTH=4'
>
>
> S64='$(TOOLSDIR)/set64bitConst.sh'
> MAKEDEPEND='makedepend'
>
> FOPTIM='-O0'
> FFLAGS='-Wimplicit -Wunused -Wuninitialized'
>
>
>
> thanks,
>
> jen mackinnon
>
>
> ---------------------------------------------------------------
> Dr. Jennifer MacKinnon
> Physical Oceanography Research Division
> Scripps Institution of Oceanography
> http://www-pord.ucsd.edu/~jen/
> 858-822-3716
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list