Re: fortran won't play nice with C

"Jethro Bell" <[email protected]>
Newsgroups gmane.comp.science.photonic-bands
Message-ID <[email protected]>
So I find:

configure:8042: checking for ctl_get_vector3 in -lctl
configure:8079: cc -o conftest -g -O2 -Wall -W -Wbad-function-cast -Wcast-qual -
Wpointer-arith -Wcast-align -pedantic -I/sw/include -I/sw/include
-L/Users/me/libctl-301_compiled/lib -L/sw/lib conftest.c -lctl
-L/sw/lib -lguile -lm -lhd
f5 -lz /sw/lib/lapack.a -lblas -ldfftw -lm  -L/sw/lib/gcc/powerpc-apple-darwin8.
6.0/3.4.3 -L/sw/lib/gcc/powerpc-apple-darwin8.6.0/3.4.3/../../.. -lm -lfrtbegin
-lg2c -lSystem >&5
/usr/bin/ld: warning multiple definitions of symbol _environ
/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/../../../crt1.o definition of _environ
in section (__DATA,__data)
/sw/lib/libguile.dylib(posix.o) definition of _environ
/usr/bin/ld: Undefined symbols:
restFP
saveFP
collect2: ld returned 1 exit status
configure:8082: $? = 1

There's a little program that follows this.  I did a little cut+paste
and a `cut -c 3- conftest1.c  > conftest.c` to get the pieces out, and
tried to compile it (by copying the gcc line out of the config.out
file).  I got the same error.  I had guessed it had something to do
with the crt1.o library, as it is in the errors above and mentioned in
the email from Greg.  So, I deleted the
-L/sw/lib/gcc/powerpc-apple-darwin8.6.0/3.4.3/../../.. and the
-L/sw/lib/gcc/powerpc-apple-darwin8.6.0/3.4.3 options out.... and it
compiled!  The executable, however, died with a "Bus Error" when I
tried to run it.

I went back, and changed the FLIBS variable, and it configured!  *victory dance*
So now it looks like:
FLIBS="-lm -lfrtbegin -lg2c -lSystem"
LDFLAGS=-L/sw/lib
CPPFLAGS=-I/sw/include

./configure --with-lapack=/sw/lib/lapack.a --with-libctl=/sw/share/libctl

Compiling it throws out more warnings than I can follow, but I think
it compiled too!  *more victory*

It seems to have compiled (and executed, mpb-ctl/mpb runs), so I'm
going to go play with it, and if I have any more problems I'll come
back and cry.

Thank you all very much,
Jethro

On 5/22/06, Steven G. Johnson <[email protected]> wrote:
>
> You can look in the config.log file to find the exact compilation command
> and the exact error that caused linking to -lctl to fail.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.