OS X 10.9 gcc enlaces a clang


Acabo de notar que después de instalar OS X 10.9, el compilador de g++ enlaza con el compilador de clang. ¿Hay alguna manera de volver a gcc / g++?

Author: ryan, 2013-10-23

5 answers

Ha sido así durante mucho tiempo. El " GCC " que vino con 10.8 era realmente GCC front-end con LLVM back-end.

La mejor manera de obtener GCC es a través de Homebrew. Después del comando de instalación homebrew de una línea en la parte inferior de la página vinculada, solo necesita:

$ brew install gcc49

A diferencia de macports, Homebrew no desordena las dirs de su sistema y es mucho mejor en la gestión de versiones y desinstalaciones. Tampoco requiere la muleta conocida como sudo.

 66
Author: Adam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-19 21:24:18

Tendrías Que instalarlo desde macports:

$ sudo port install gcc49

Sin embargo, no estoy seguro de cómo integraría gcc en Xcode 5, sin embargo, no menciona por qué no puede usar clang?

 11
Author: trojanfoe,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-23 07:30:34

Los paquetes GCC accesibles y actualizados están en http://hpc.sourceforge.net /

 4
Author: user2962717,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-06 23:43:17

También puede obtener un compilador de g++ desde http://hpc.sourceforge.net / . Tienen el compilador en un paquete pre-construido. Solo tienes que descargar y seguir sus instrucciones. Tenga en cuenta que puede necesitar cambiar la ruta del ejecutable y tener /usr/local/bin por delante de /usr/bin. Esto es para asegurar que g++ llame al compilador correcto.

 3
Author: Zachary Kraus,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-23 14:15:29

Esto es por diseño, y no es nuevo en OS X 10.9. Apple obsoleta GCC hace mucho tiempo. Simplemente use Clang, o si necesita fortran / openmp/..., instale GCC usted mismo a través de homebrew / macports/...

 1
Author: rubenvb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-23 07:30:10