www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/15/20:31:18

Date: Mon, 16 Dec 96 12:16:42 DST
Message-Id: <9612160116.AA03619@ncc01.ho.BoM.GOV.AU>
From: Trevor Casey <t DOT casey AT bom DOT gov DOT au>
To: djgpp AT delorie DOT com
Subject: Compiling Libraries in MSDOS
Mime-Version: 1.0

DJGPP and F2C

help from the gurus

Fair dinkum you blokes, I've just about given up! Why can't someone write 
some simple instructions in plain english for the installation of gcc and 
f2c together on a PC. Either they talk down to you like you're the village 
idiot and say "put your index finger on the return key and press once" or 
else the instructions are that vaque, complicated, ambiguous and 
incomprehensible that its like some inside joke among rocket scientists 
which only the after-burn engineering department appreciate. There has got 
to be a middle way.

I started out all hopeful that I would get this up and running in a few 
days. It is now over a month since I started and I have given up several 
times in sheer frustration and thought I might as well go out and spend the 
$150 on a commercial F77 software package and save myself the aggravation. 
I can program OK in fortran and have for years. I can get around on UNIX 
and was nurtured on DOS going back to XTs and before that CP-M on PCs, and 
I have a bit of a backgound with JCL on mainframes. But I am not a systems 
or assembler programmer and find most of the heavy duty stuff to do with 
the setup of compilers etc mind-numbingly tedious and like a foreign 
language (written in heiroglyphs).  I have only perserverd because I 
endorse the ideals of the FSF and (given that I will get it to work 
someday) may benefit to the point where I may be able to make a 
contribution.

I think I have done all that has been asked and is humanly possible given 
my limited abilities. I got the readme.1st file, read that, and did what 
was said there. I downloaded all the zip files. I unzipped the files using 
the supplied unzip386 down to and including the listed zip files in FAQ2.01 
for developing C programs (no C++). I also got the DJGPP quick setup guide 
from http://remus.rutgers.edu, and I have now assiduously read a lot of the 
FAQ2.01 (over and over). I think the DJGPP part is properly installed with 
f2c.h in the lib subdirectory of DJGPP and it has a pointer in the 
DJGPP.ENV file and this has a pointer in the autoexec.bat file as explained 
to do (buried in the middle of the FAQ2, but suitably up front in the 
readme.1st and rutgers guide). In the rutgers guide it also suggested doing 
a test on whether the installation went smoothly. I have run the bat file 
MAKEALL.BAT from the unzipped djtst200.zip and it said some thing like 
"nothing to be done for 'all' ", and 
gcc -02 -g -c check.cc
gcc.exe: Installation problem, cannot exec 'cc1plus': no such file or 
directory
(ENOENT)
make.exe: *** [check.o] Error 1
Now I dont know a lot about makes and makefiles and what any of this means 
except that it seems to indicate there is a missing file (cc1plus?) but as 
I said I only installed the zips down to the bit for C development and not 
for C++, so I guess that means the rest might be OK. ?? Anyway I cant be 
sure of the installation until I get to properly compiling with it. 
Hopefully I will be able to sort out any subsidiary problems with the help 
of big brother FAQ2.

My main and immediate problem (and sorry for the delay in getting around to 
it, but I thought I should explain where I've got to with DJGPP as 
background) is with the compilation of the libraries in f2c.

The documentation I have for this part (of what I thought would be a cheap 
and easy way of acquiring a f77 compiler for my PC) is rather sketchy, 
seems to be mainly written for UNIX installations with what appear to be 
dismissive and half disdainful asides if you happen to be an MSDOS based 
user. I originally started from a web search for a link.exe file to go with 
a copy of Lahey F77L, as my DOS6.0 doesn't supply one. I previously had 
this running great on my old 286 and it used to link OK with a copy of a 
Compaq operating system link.exe file, but since my upgrade to a 486dx I'm 
stuck. I came across a web site (through 'fortran' as search key) with the 
faq "where can I get a free (FORTRAN 77) compiler? Yippee I thought. So as 
suggested, I ftp'd to netlib AT research DOT att DOT com and got the readme and index 
info etc. Next, I got a precompiled version of f2c and the libraries 
sf2c.lib and lf2c.lib, but I read somewhere (from the fortran faq site by 
one Judah Milgram) that some changes would need to be made to the libraries 
if they were to run under the gnu gcc. So I then downloaded the programs 
from the f2c/src subdirectory of netlib with an email of "send all from 
src" where I obtained source for the libraries. I have also, for the sake 
of complete confusion got an MSDOS executable f2c in zipped form ( I think 
from a Simtel site). Its round about here that  the problem starts. I have 
a bunch of readmes. Some of the readmes are explicitly for UNIX and the 
ones for DOS dont really give enough information or are ambiguous. Other 
info I have says modify the library file like this and like that etc. to 
accommodate gcc. I have made what I think are the appropriate changes in 
the library source codes but now don't know how to create the object files 
or compile the bundles. It is suggested to combine the two libs into one 
library such as libf2c.a which can then be linked with gcc when it comes to 
compiling the converted f2c code.

It looks easy in UNIX using ar and ranlib if you've got the (bundled) 
object code, but what do you do from DOS? I see that these commands are 
indeed in DJGPP (although I had to additionally unzip the sed*.zip).  What 
does "sh these files" mean?. Looking in the library source, there is all 
this double slash stuff that looks like JCL from the IBM and Fujitsu 
mainframe days of my youth, but it also looks like it expects commands like 
sed and ^ from UNIX. I've tried compiling the whole thing by renaming the 
lib files to append a .c on the end and doing 
gcc -c -DMSDOS libF77.c
but I get errors specifying what look to be line numbers and saying 
'unterminated characters' or somesuch and nothing happens. I tried just 
doing the 'echo' and 'sed' lines on one of the source module names. 
Obviously that's all just too simplistic. In one readme I have, it says 
"MS-DOS users can use the MKS Toolkit to unpack libf77 and libi77". That's 
like saying 'tradesmen can use the back entrance'. Whats 'MKS', where do 
you get it?
How do I pull the modified libraries all apart and compile them (presuming 
gcc is running OK) and put them back together again as bundled object code 
in a form suitable for gcc? Are there special delimiters that have to be 
placed between each of the objects in the bundle? Somewhere else I also 
read that I might have to write a script to do the extraction of each 
module. I am not crash hot on writing scripts in either DOS or UNIX. 17.5 
in FAQ2.01 was the nearest I could find to my problem, but it doesnt really 
answer the question of how it is done in simple step by step instructions.

I've actually run the f2c.exe on a fortran program and got some c source 
code, and that bit looks to be fine, but got nowhere with the gcc 
compilation. The first attempt I made resulted in it spewing out a whole 
lot of messages about not finding the lio.c 's and that sort of stuff, 
which are in the libF77 and libI77 sources.
At the top of the translated file there is the comment (You must link the 
resulting object file with the libraries 
-link<S|C|M|L>f2c.lib (in that order), but I think the .lib is for UNIX is 
it not? Anyway, it still spat the dummy saying the linker input files were 
not used since the linking was not done. I guess that's because they dont 
know about gcc instead of cc. 
What do I do?

Please help me, I am really confused.

go32-v2: 

go32/v2 version 2.0 built Jan 23 1996 22:03:02
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2 binaries as
 well as v1 binaries (old makefiles).  Put ahead of the old go32 in your 
PATH.
DPMI memory available: 2132 Kb
DPMI swap space available: 13628 Kb

(this is also confusing, the machine is 8Mb RAM)


environ.lst:

PROMPT=$P$G
COMSPEC=C:\COMMAND.COM
TZ=EST-10EDT
PATH=C:\;C:\WINDOWS;C:\DOS;D:\SPLUSWIN\CMD;D:\ZIP;D:\F2C;D:\F77\TEMP;D:\DJG
PP;D:\F2C\BIN;D:\DJGPP;D:\DJGPP\BIN
DJGPP=D:\DJGPP\DJGPP.ENV
INCLUDE=D:\DJGPP\INCLUDE;D:\F2C\INCLUDE
LIB=D:\DJGPP\LIB;D:\F2C\LIB;
HOME=c:\spluswin\home
TEMP=C:\WINDOWS\TEMP
windir=C:\WINDOWS





Trevor Casey                                *
National Climate Centre                   *   *
Box 1289K Melbourne 3001          *          * 
ph:  +61 3 9669 4068          *             * 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019