37 | | == A port build fails on Snow Leopard with: "file is not of required architecture" == #wrongarch |
38 | | |
39 | | If you had MacPorts installed before upgrading to Snow Leopard, see [wiki:Migration]. |
40 | | |
41 | | == A port fails to build when using Xcode 4/5 == #compiler |
42 | | |
43 | | gcc has been the compiler collection MacPorts has used by default up until Xcode 4, in which Apple has switched to the llvm/clang compiler collection. These are new compilers and many programs have not yet been tested with them, and some ports will fail as a result. Using a different compiler may work better for a particular port. If the below workarounds enable you to install a port that failed with its default compiler, file a ticket and let us know so we can fix it. Portfile authors, see wiki:PortfileRecipes#compiler. |
44 | | |
45 | | === Xcode 4.2 and later (including Xcode 5) === #xcode42 |
46 | | |
47 | | If a port ''foo'' fails to build and you're using Xcode 4.2 or later, the default compiler is clang; try compiling with llvm-gcc-4.2 instead: |
48 | | |
49 | | {{{ |
50 | | sudo port clean foo |
51 | | sudo port install foo configure.compiler=llvm-gcc-4.2 |
52 | | }}} |
53 | | |
54 | | If that fails, try installing the apple-gcc42 port and compiling with that: |
55 | | |
56 | | {{{ |
57 | | sudo port clean foo |
58 | | sudo port install apple-gcc42 |
59 | | sudo port install foo configure.compiler=apple-gcc-4.2 |
60 | | }}} |
61 | | |
62 | | === Xcode 4.0 and 4.1 === #xcode40 |
63 | | |
64 | | If a port ''foo'' fails to build and you're using Xcode 4.0 or 4.1, the default compiler is llvm-gcc-4.2; try compiling with clang instead: |
65 | | |
66 | | {{{ |
67 | | sudo port clean foo |
68 | | sudo port install foo configure.compiler=clang |
69 | | }}} |
70 | | |
71 | | If that fails, try using gcc-4.2: |
72 | | |
73 | | {{{ |
74 | | sudo port clean foo |
75 | | sudo port install foo configure.compiler=gcc-4.2 |
76 | | }}} |
77 | | |