On May 22, 2006, at 5:21 PM, Gavin Sherlock wrote:
Hi,
I'm trying to compile some software for OSX, that was developed on
linux (tarball available at http://microarray.org/data/download/g2c-1.0.tar.gz)
, and ran into a number of problems, some of which I solved (or
appeared to solve), but I'm now stuck. Any help would be greatly
appreciated. The problems I encountered thus far were:
1. The first problem is when it tries to compile dust.c:
ccsr-2255b-g5 1002 % make all
compiling g2c.c
compiling g2clib.c
compiling gopt.c
compiling blast.c
compiling complementation.c
compiling complexity.c
compiling dust.c
dust.c:2:20: error: malloc.h: No such file or directory
make: *** [dust.o ] Error 1
This is easy to get around - just remove the line:
#include <malloc.h>
from dust.c, as I think the malloc functions are provided from
stdlib.h on OSX.
To get around this, I simply copied libexpat.a to my working
directory.
Or you can specify it on the library include path with the option "-L/
usr/local/lib". There should be an LDFLAGS you can set for this, and
it's also probably a configure option.
3. -shared problem
ccsr-2255b-g5 1016 % cp /usr/local/lib/libexpat.a ./
ccsr-2255b-g5 1017 % make clean
.
.
.
ccsr-2255b-g5 1020 % make all
.
.
.
making g2c
compiling readWuBlast.c
making readwu
making libg2c.so
powerpc-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [libg2c.so] Error 1
making libg2c.so
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [libg2c.so] Error 1
If you could include the entire compilation line for one of the .o
files, that would be helpful.
A common cause of this is missing -fPIC or trying to use 'ld' directly
instead of using "g++" or "gcc" as the linker (whichever is
appropriate), but without the compilation line you are using, there's
no way to know what options you're adding that you shouldn't, or are
missing that you need to add.
-- Terry
I then tried -dynamiclib instead (I have no idea if I should do
this), which got me past the last error, but now this resulted in a
different error:
.
.
.
making g2c
compiling readWuBlast.c
making readwu
making libg2c.so
ld: common symbols not allowed with MH_DYLIB output format with the -
multi_module option
energy_data.o definition of common _WC_Matrix (size 2500)
energy_data.o definition of common _bulge (size 124)
energy_data.o definition of common _loop (size 124)
lzw.o definition of common _append_character (size 4)
lzw.o definition of common _code_value (size 4)
lzw.o definition of common _decode_stack (size 4000)
lzw.o definition of common _prefix_code (size 4)
wublast.o definition of common _token (size 1024)
/usr/bin/libtool: internal link edit command failed
make: *** [libg2c.so] Error 1
and now I'm well and truly stuck.
I'm on 10.4.6 on PowerPC, with the latest version of XCode. gcc --
version says:
ccsr-2255b-g5 1066 % gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.
build 5247)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Many thanks for any help,
Cheers,
Gavin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden