我在 Mac 上编译 Mercury 时遇到问题。我正在运行 Mac OS X 10.8,安装了 Xcode 4.5 以及命令行工具。
到目前为止我做了什么:
我下载了 tar.gz 文件,将其解压缩,./configure
在该文件夹中运行,然后使用make PARALLEL=-j2 install
命令(如其后所述./configure
)。
在该步骤中,我在命令行中得到以下信息:
MMAKE_DIR=`pwd`/scripts scripts/mmake MMAKEFLAGS=-j2 DESTDIR= install
cd scripts && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2
make[2]: Nothing to be done for `default_target'.
cd util && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2 mfiltercc
make[2]: `mfiltercc' is up to date.
gc_grade=`scripts/ml --grade none.gc --print-gc-grade`; \
cd boehm_gc && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2 GC_GRADE=$gc_grade
MAKEFLAGS=""; export MAKEFLAGS; \
PATH=../util:$PATH make -j2 -j1 \
GRADE=none.gc GC_GRADE=gc \
AR=ar RANLIB=ranlib \
libgc.a libgc.dylib \
FINAL_INSTALL_MERC_GC_LIB_DIR=/usr/local/mercury-11.07.2/lib/mercury/lib \
dylib
make[3]: `libgc.a' is up to date.
make[3]: `libgc.dylib' is up to date.
make[3]: Nothing to be done for `dylib'.
cd runtime && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2
make[2]: Nothing to be done for `default_target'.
cd util && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2
make[2]: Nothing to be done for `default_target'.
cd robdd && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2
make[2]: Nothing to be done for `default_target'.
cd library && PATH=../scripts:../util:$PATH MMAKE_VPATH=. MMAKE_DIR=../scripts DESTDIR= ../scripts/mmake -j2
../scripts/mgnuc --grade none.gc -- -c tree234.c -o tree234.o
../scripts/mgnuc --grade none.gc -- -c array.c -o array.o
tree234.c:619: error: initializer element is not constant
tree234.c:619: error: (near initialization for ‘mercury_common_1[0].f2’)
tree234.c:623: error: initializer element is not constant
tree234.c:623: error: (near initialization for ‘mercury_common_1[1].f2’)
tree234.c:631: error: initializer element is not constant
tree234.c:631: error: (near initialization for ‘mercury_common_1[3].f2’)
tree234.c:640: error: initializer element is not constant
tree234.c:640: error: (near initialization for ‘mercury_common_2[0].f1[1]’)
tree234.c:646: error: initializer element is not constant
tree234.c:646: error: (near initialization for ‘mercury_common_2[1].f1[1]’)
tree234.c:652: error: initializer element is not constant
tree234.c:652: error: (near initialization for ‘mercury_common_2[2].f1[1]’)
tree234.c:658: error: initializer element is not constant
tree234.c:658: error: (near initialization for ‘mercury_common_2[3].f1[1]’)
array.c:681: error: initializer element is not constant
array.c:681: error: (near initialization for ‘mercury_common_1[0].f1[1]’)
array.c:699: error: initializer element is not constant
array.c:699: error: (near initialization for ‘mercury_common_1[3].f1[1]’)
array.c:715: error: initializer element is not constant
array.c:715: error: (near initialization for ‘mercury_common_1[6].f1[0]’)
array.c:717: error: initializer element is not constant
array.c:717: error: (near initialization for ‘mercury_common_1[6].f1[1]’)
array.c:729: error: initializer element is not constant
array.c:729: error: (near initialization for ‘mercury_common_1[8].f1[1]’)
array.c:754: error: initializer element is not constant
array.c:754: error: (near initialization for ‘mercury_common_2[1].f2’)
array.c:758: error: initializer element is not constant
array.c:758: error: (near initialization for ‘mercury_common_2[2].f2’)
array.c:762: error: initializer element is not constant
array.c:762: error: (near initialization for ‘mercury_common_2[3].f2’)
make[2]: *** [array.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [tree234.o] Error 1
make[1]: *** [library] Error 2
make: *** [install] Error 2
然后我通读了自述文件,它说我应该使用其他版本的GCC
. 所以我安装了这些Command Line Tools
(因为我发现它们确实包含 GCC)并再次尝试。没有运气,仍然是同样的问题。
任何帮助,将不胜感激。