[erlang-questions] compiling problems under OS X Lion

68 views
Skip to first unread message

Sean Moss-Pultz

unread,
Jul 22, 2011, 11:20:53 AM7/22/11
to erlang-q...@erlang.org
Hi List

I'm trying to build R14B03 under OS X Lion. (Xcode v4.1). I'm getting
the following error:

--------------------------------------------------

=== Entering application hipe
(cd ../main && make hipe.hrl)
sed -e "s;%VSN%;3.8;" ../../hipe/main/hipe.hrl.src > ../../hipe/main/hipe.hrl
erlc -W  +debug_info +inline -o../ebin hipe_rtl.erl
(no error logger present) error: "Error in process <0.1.0> with exit
value: {{badfun,[<<5 bytes>>,<<47 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2
bytes>>,<<5 bytes>>,<<12 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8
bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2
bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<50 bytes>>,<<5
bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<6
bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<12
bytes>>]},[{erlang,apply,2}]}\n"

--------------------------------------------------

People using homebrew seem to have the same issue:

https://github.com/mxcl/homebrew/issues/2713

They say to use --use-gcc when running ./configure. I've tried this
but it didn't change the error. Can somebody help me with this?

Thanks!


  -Sean
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Dave Smith

unread,
Jul 22, 2011, 11:37:58 AM7/22/11
to Sean Moss-Pultz, erlang-q...@erlang.org
If you want to compile Erlang w/ clang-llvm on 10.6 (or above) do
this: CFLAGS=-O0 ./configure ...

D.

Sean Moss-Pultz

unread,
Jul 22, 2011, 9:03:10 PM7/22/11
to Dave Smith, erlang-q...@erlang.org
> On Fri, Jul 22, 2011 at 9:20 AM, Sean Moss-Pultz <se...@openmoko.com> wrote:
>> Hi List
>>
>> I'm trying to build R14B03 under OS X Lion. (Xcode v4.1). I'm getting
>> the following error:

{snip}

On Fri, Jul 22, 2011 at 11:37 PM, Dave Smith <diz...@dizzyd.com> wrote:
> If you want to compile Erlang w/ clang-llvm on 10.6 (or above) do
> this: CFLAGS=-O0 ./configure ...
>

Thanks Dave. That got me a lot further. But I'm still getting the
following errors:

------------------------------------------------------------------------------------------------------------------

gcc -O0 -no-cpp-precomp -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Winline -fno-strict-aliasing
-I. -I../include -Iconnect -Iencode -Idecode -Imisc -Iepmd -Iregistry
-Ii386-apple-darwin11.0.0 -Ilegacy -D_THREAD_SAFE -D_REENTRANT
-DPOSIX_THREADS -m32 -o
/Users/mosko/Downloads/otp_src_R14B03/lib/erl_interface/bin/i386-apple-darwin11.0.0/erl_call
prog/erl_call.c prog/erl_start.c \
-L/Users/mosko/Downloads/otp_src_R14B03/lib/erl_interface/obj/i386-apple-darwin11.0.0
-lei -lpthread
ld: warning: ignoring file
/Users/mosko/Downloads/otp_src_R14B03/lib/erl_interface/obj/i386-apple-darwin11.0.0/libei.a,
file was built for archive which is not the architecture being linked
(i386)
Undefined symbols for architecture i386:
"_ei_gethostbyname", referenced from:
_main in ccO2Es4f.o
_do_connect in ccO2Es4f.o
"_ei_connect_xinit", referenced from:
_main in ccO2Es4f.o
"___erl_errno_place", referenced from:
_main in ccO2Es4f.o
"_ei_thishostname", referenced from:
_main in ccO2Es4f.o
_exec_erlang in cc6g0Be0.o
"_ei_connect", referenced from:
_main in ccO2Es4f.o
_do_connect in ccO2Es4f.o
"_ei_encode_list_header", referenced from:
_main in ccO2Es4f.o
"_ei_x_new_with_version", referenced from:
_main in ccO2Es4f.o
"_ei_rpc", referenced from:
_main in ccO2Es4f.o
"_ei_x_free", referenced from:
_main in ccO2Es4f.o
"_ei_encode_string", referenced from:
_main in ccO2Es4f.o
"_ei_encode_binary", referenced from:
_main in ccO2Es4f.o
"_ei_encode_atom", referenced from:
_main in ccO2Es4f.o
"_ei_print_term", referenced from:
_main in ccO2Es4f.o
"_ei_x_new", referenced from:
_main in ccO2Es4f.o
"_ei_x_format_wo_ver", referenced from:
_main in ccO2Es4f.o
"_ei_gethostbyname_r", referenced from:
_get_addr in cc6g0Be0.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make[4]: *** [/Users/mosko/Downloads/otp_src_R14B03/lib/erl_interface/bin/i386-apple-darwin11.0.0/erl_call]
Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

------------------------------------------------------------------------------------------------------------------

Any ideas on this one? I should add, Lion was an upgrade (from Snow
Leopard), not a new install.

Thanks!

Dave Smith

unread,
Jul 22, 2011, 10:06:26 PM7/22/11
to Sean Moss-Pultz, erlang-q...@erlang.org
Try re-doing configure with --enable-darwin-64bit; note that you may
need to wipe out the otp_src directory to get a clean build.

D.

Sean Moss-Pultz

unread,
Jul 22, 2011, 11:44:08 PM7/22/11
to Dave Smith, erlang-q...@erlang.org
On Sat, Jul 23, 2011 at 10:06 AM, Dave Smith <diz...@dizzyd.com> wrote:
> Try re-doing configure with --enable-darwin-64bit; note that you may
> need to wipe out the otp_src directory to get a clean build.

Thanks a lot Dave. That solved the problem!

Jason Bosco

unread,
Jul 24, 2011, 4:30:18 PM7/24/11
to erlang-q...@erlang.org
This didn't work for me. I tried CFLAGS=-O0 ./configure --enable-darwin-64bit and then make but it stopped with this error:

ld: warning: ignoring file /Users/abcd/Downloads/otp_src_R14B03/erts/emulator/zlib/obj/i386-apple-darwin11.0.0/opt/libz.a, file was built for archive which is not the architecture being linked (x86_64) ld: warning: ignoring file /Users/abcd/Downloads/otp_src_R14B03/erts/emulator/pcre/obj/i386-apple-darwin11.0.0/opt/libepcre.a, file was built for archive which is not the architecture being linked (x86_64) Undefined symbols for architecture x86_64:...


Any ideas?

Sean Moss-Pultz

unread,
Jul 24, 2011, 8:54:58 PM7/24/11
to Jason Bosco, erlang-q...@erlang.org

Jason

I don't know but I was able to build by using Xcode (4.1) and that
command on Lion. Actually I wanted SSL so I added --with-ssl. Did you
try building before you added those flags? You might need to clean out
the source directory first.

Jason Bosco

unread,
Jul 24, 2011, 11:32:08 PM7/24/11
to Sean Moss-Pultz, erlang-q...@erlang.org
Sean, 

I did a "make clean" before running CFLAGS=-O0 ./configure --enable-darwin-64bit once again. That should "clean out the source directory" right?

Jason.

Daniel Luna

unread,
Jul 25, 2011, 12:36:46 AM7/25/11
to Jason Bosco, erlang-q...@erlang.org

It should.

However, it doesn't. Has been broken for years.

The makefiles for Erlang/OTP are not particularly good. Hasn't bothered me enough to fix though since you normally only build once.

Cheers,

Daniel

Jason Bosco

unread,
Jul 25, 2011, 1:08:50 AM7/25/11
to Daniel Luna, erlang-q...@erlang.org
Daniel,

I ran 'CFLAGS=-O0 ./configure --enable-darwin-64bit' and then 'make' on a fresh copy of the source and it compiled fine. Thanks!

Regards,
Jason.
Reply all
Reply to author
Forward
0 new messages