[CMake] cmake + OSX + gfortran + 64bit problem

Clinton Stimpson clinton at elemtech.com
Wed Dec 15 17:48:24 EST 2010


On Wednesday, December 15, 2010 03:08:10 pm Convey, Christian J CIV NUWC NWPT, 
B-171 wrote:
> Here's what I've got:
> Cmake: 2.8.3
> OS X: 10.5.x
> gfortran: 4.5.1
> 
> I'm trying to build a Fortran program on OS X using CMake.  I'm trying to
> write CMakeLists.txt files that can handle either the GNU fortran compiler
> or the Intel fortran compiler.
> 
> When set CMAKE_OSX_ARCHITECTURES to x86_64, the resulting makefiles end up
> supplying "-arch x86_64" to the gfortran command line.  That flag is
> appropriate for the Intel fortran compiler but it isn't valid for
> gfortran, even on a Mac.  It should be "-m64".
> 
> Does anyone know of a good way around this?

That probably depends which gfortran you are using on the Mac.
I've used the -arch flag with gfortran before, and at the time, I thought the 
only multi-arch gfortran available to download/install took the -arch flag.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com


More information about the CMake mailing list