again problem with ansidecl.h

811 views
Skip to first unread message

perplexed

unread,
May 19, 2008, 7:33:04 PM5/19/08
to gg95
I am trying to build the Fortran 95 compiler, following the
instructions given here
http://www.g95.org/src.shtml
I am on a MAX with OS 10.4.11

Things proceed smoothly for a while until I get to the instruction
change to the main g95 directory and configure with.
./configure .....

The term "main g95 directory" has not been defined precisely. I assume
it is the directory that contains the Fortan compiler source code
which was created during the unpacking and happens to have the name
g95-092/. Referencs is made to the "install directory" which I have
made, installDir/. Reference is made also to "your gcc directory",
which I take to be the gcc directory made earlier in the process. A
partial directory tree is

.... gnuF95/
installDir/
g95-0.92/
gcc-4.0.3/
gcc/ (created earlier , and which I take to be
"your gcc directory"
include/

The include/ directory contains a file ansidecl.h

In the directory g95-092/ I issue the command

./config ==prefix=<absolute path to inStallDir/> --with-gcc-
dir=<absolute path to gcc/>

Things proceed for a time looking good
...
checking for XXXX ...yes (about 60 such lines)

until one comes to

checking ansidecl.h usability... no
checking ansidecl.h presence... no
checking for ansidecl.h... no
configure: error: ansidecl.h not found, can't include gcc headers.

The config script contains a reference thus
#include <ansidecl.h>

Are my assumptions about "main g95 directory, "install directory" and
"your gcc directory" correct.

I'm sure there is a easy kludge to get past this.



Doug

unread,
May 19, 2008, 11:07:03 PM5/19/08
to gg95
Your gcc dir is the one where you unpacked gcc-core-4.0.3.tar

That is, in your case, (looks like), .... gnuF95/gcc-4.0.3/

The g95 directory is the one called g95-0.92

For your install directory, you may want to try something like /opt/
g95-install. This is what you will want to use for prefix. Try this
and see if it fixes the problem.

Doug





perplexed

unread,
May 21, 2008, 12:01:11 AM5/21/08
to gg95
I "got around' the previous problem without understanding why. The
differences were
1/ I had moved the directory tree to what i thought was a more
sensible location /Shared/gnuF95/.....
2/ the gnuF95 directory contained a copy of ansidecl.h
This time the configure command (issued in ../g95-092/)

./configure --prefix=/Shared/gnuF95/g95-install --with-gcc-dir=/Shared/
gnuF95/gcc-4.0.3

appeared to run normally, but its output had no mention of ansidecl.h.
Files config.log, config,status, Makefile were created or modified buy
this step

The next step is to try "make" or "make install". Both failed
spectcularly (in what appears to be the same way) namely


>make install
gcc -DHAVE_CONFIG_H -I. -DTARGET_NAME=\"powerpc-apple-
darwin8.11.0\" -DSTANDARD_EXEC_PREFIX=\"\" -DTARGET_SYSTEM_ROOT=\"\" -
DDEFAULT_TARGET_VERSION=\"\" -DDEFAULT_TARGET_MACHINE=\"\" -
DTOOLDIR_BASE_PREFIX=\"\" -DSTANDARD_STARTFILE_PREFIX=\"\" -
DSTANDARD_STARTFILE_PREFIX_2=\"/usr/lib/\" -DSTANDARD_EXEC_PREFIX=\"\"
-DSTANDARD_BINDIR_PREFIX=\"/bin\" -DSTANDARD_LIBEXEC_PREFIX=\"\" -
DG95_SPEC=\"\" -g -O2 -Wall -Wmissing-prototypes -no-cpp-precomp -MT
g95-g95spec.o -MD -MP -MF .deps/g95-g95spec.Tpo -c -o g95-g95spec.o
`test -f 'g95spec.c' || echo './'`g95spec.c
g95spec.c:47:20: error: config.h: No such file or directory
g95spec.c:48:20: error: system.h: No such file or directory
g95spec.c:49:17: error: gcc.h: No such file or directory
g95spec.c:94: error: parse error before 'PARAMS'
g95spec.c:96: error: parse error before 'PARAMS'
g95spec.c:102: error: array type has incomplete element type
g95spec.c: In function 'lookup_option':
g95spec.c:152: error: 'NULL' undeclared (first use in this function)
g95spec.c:152: error: (Each undeclared identifier is reported only
once
g95spec.c:152: error: for each function it appears in.)
g95spec.c:164: warning: implicit declaration of function 'strcmp'
g95spec.c: In function 'append_arg':
g95spec.c:255: warning: implicit declaration of function 'xmalloc'
g95spec.c:263: warning: implicit declaration of function 'fatal'
g95spec.c: At top level:
g95spec.c:270: warning: no previous prototype for
'lang_specific_driver'
g95spec.c: In function 'lang_specific_driver':
g95spec.c:272: error: parse error before 'ATTRIBUTE_UNUSED'
g95spec.c:346: error: 'NULL' undeclared (first use in this function)
g95spec.c:384: warning: implicit declaration of function 'printf'
g95spec.c:384: warning: incompatible implicit declaration of built-in
function 'printf'
g95spec.c:390: error: 'version_string' undeclared (first use in this
function)
g95spec.c:397: warning: implicit declaration of function 'exit'
g95spec.c:397: warning: incompatible implicit declaration of built-in
function 'exit'
g95spec.c:562: warning: implicit declaration of function 'fprintf'
g95spec.c:562: warning: incompatible implicit declaration of built-in
function 'fprintf'
g95spec.c:562: error: 'stderr' undeclared (first use in this function)
g95spec.c: At top level:
g95spec.c:574: warning: no previous prototype for
'lang_specific_pre_link'
make: *** [g95-g95spec.o] Error 1


The missing header files (config.h system.h gcc.h) are around in ../
gcc-4.0.3/gcc/
Anyone know what the p[roblem is?

Doug

unread,
May 21, 2008, 7:57:30 AM5/21/08
to gg95
The build of gcc used by g95 has to be done as explained in the docs.
That is, after unpacking the tarball, do the following commands:

cd gcc-4.0.3
mkdir g95
cd g95
../configure --enable-languages=c
make

Is that what you did?

If so, the file config.h should be found in <path to gcc dir>/
gcc-4.0.3/g95/gcc

Doug
Reply all
Reply to author
Forward
0 new messages