MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014252 | CMake | (No Category) | public | 2013-06-28 09:13 | 2016-06-10 14:31 |
Reporter | Mojca Miklavec | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | x86_64-darwin | OS | Mac OS X | OS Version | 10.7.5 |
Product Version | CMake 2.8.10.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0014252: Unsupported "-arch x86_64" mysteriously ends up in Fortran_FLAGS | ||||
Description | http://public.kitware.com/pipermail/cmake-developers/2013-January/006230.html [^] An unsupported compiler flag "-arch x86_64" mysteriously sneaks into Fortran_FLAGS when -DCMAKE_OSX_ARCHITECTURES="x86_64" is passed to cmake. That flag CMAKE_OSX_ARCHITECTURES is added automatically to all projects in MacPorts (third-party package manager for Mac OS X) even when cross-compiling or compilation of fat binaries (like i386+x86_64) is not needed, so no project that needs Fortran and CMake can be compiled (luckily there are not many such projects, but it's still a showstopper to switch to CMake). The g95 compiler ignores "-arch <...>" flag, but GCC's gfortran 4.x throws an error and breaks compilation. I could probably try to prevent DCMAKE_OSX_ARCHITECTURES from being passed to cmake (via some tricks in MacPorts or by modifying MacPorts sources), but I still believe that passing "-arch x86_64" to Fortran_FLAGS is a bug in CMake. | ||||
Steps To Reproduce | Compiled Root (root.cern.ch) or any minimal project which needs Fortran with cmake \ -DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran-mp-4.5 \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ -DCMAKE_INSTALL_PREFIX=/path/to/install \ -DCMAKE_OSX_ARCHITECTURES="x86_64" ../path/to/sources In that particular project the generated file misc/minicern/CMakeFiles/minicern.dir/flags.make ends up containing the following variables (among others): C_FLAGS = -m64 -pipe -W -Wall -fsigned-char -fno-common -O2 -g-arch x86_64 -fPIC -I<path/to/some/include/dirs> Fortran_FLAGS = -m64 -std=legacy -arch x86_64 -fPIC -I<path/to/some/include/dirs> The flag "-arch x86_64" shouldn't be there. | ||||
Additional Information | Citing http://public.kitware.com/pipermail/cmake-developers/2013-January/006230.html [^] The "-arch" flag is hard-coded here: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalGenerator.cxx;hb=v2.8.10.2#l1826 [^] It was added to CMake way back when universal binary support was first added to OS X under the assumption that all compilers that would be used in combination with CMAKE_OSX_ARCHITECTURES would support the flag. Obviously the assumption is wrong. The hard-coded flag needs to be replaced with a lookup of a new per-language platform information variable, perhaps called CMAKE_<LANG>_OSX_ARCHITECTURE_FLAG -Brad Some more links: - https://trac.macports.org/ticket/37732 [^] (about the -arch flag in Fortran) - https://trac.macports.org/ticket/37688 [^] ([also] about development of a package for Root using CMake) - https://sft.its.cern.ch/jira/browse/ROOT-4874 [^] (not strictly related) | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-06-28 09:13 | Mojca Miklavec | New Issue | |||
2013-06-28 09:28 | Brad King | Additional Information Updated | bug_revision_view_page.php?rev_id=1203#r1203 | ||
2013-06-28 09:31 | Brad King | Note Added: 0033397 | |||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042305 | |||
2016-06-10 14:29 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|