Problem with "make" in SuSE?

Thanks very much in advance for any help! I’ve been trying to compile someone else’s fortran software that’s written for many different platforms using old-style “make” scripts (i.e., not automake). I’m hoping someone can spot a syntax problem because it dies claiming there’s no rule to make PREPRC.f, though I see the rule in the makefile - I suspect there’s a format problem in the makefile that SuSE’s make has trouble with: (this is all in tcsh)

make[1]: Entering directory /home/patti/vulk/Ver_6.0.2/Source_code' make[1]: *** No rule to make target /home/patti/vulk/Ver_6.0.2/Source_code/PREPRC.F’, needed by /home/patti/Vulk/Ver_6.0.2/Source_code/PREPRC.o'. Stop. make[1]: Leaving directory /home/patti/vulk/Ver_6.0.2/Source_code’
make: *** [inpre] Error 2

Ver_6.0.2/Scripts>

But here’s the makefile where it’s dying… it looks to me like there IS a rule defined to make PREPRC.F - but for some reason, make is not picking it up. The console output above seems to suggest it gets part-way through this makefile until trying to build PREPRC.f - but I do see a “rule” for building “.f” files… so I’m stuck…

#SRC = $(vulkpath)/Source_code
#EXC = $(vulkpath)/Executable
#CPP = cpp
#CPPFLAGS = -P -C

.SUFFIXES: .F $(FSFXFLG)

OBJS= $(SRC)/PREPRC.o
$(SRC)/GBFESI.o
$(SRC)/GENERIC.o
$(SRC)/READ.o
$(SRC)/RDDATA.o
$(SRC)/RDQBC.o
$(SRC)/THERMO.o
$(SRC)/TRANPRT.o
$(SRC)/vulk_MPP.o
$(SRC)/WPARAM.o

$(EXC)/vulk_preprc: $(OBJS)
$(FC) $(FFLAGS) -o $(EXC)/vulk_preprc $(OBJS) $(FLFLAGS)

$(OBJS):
cd $(SRC);
$(CPP) $(CPPFLAGS) $.F > $$(FSFXFLG);
$(FC) $(FFLAGS) -c $$(FSFXFLG);
/bin/rm -f $
$(FSFXFLG)

.F$(FSFXFLG):
cd $(SRC);
$(CPP) $(CPPFLAGS) $.F > $$(FSFXFLG)

.F.o:
cd $(SRC);
$(CPP) $(CPPFLAGS) $.F > $$(FSFXFLG);
$(FC) $(FFLAGS) -c $$(FSFXFLG);
/bin/rm -f $
$(FSFXFLG)

$(FSFXFLG).o:
cd $(SRC);
$(FC) $(FFLAGS) -c $*$(FSFXFLG)

.F:
cd $(SRC);
$(CPP) $(CPPFLAGS) $.F > $$(FSFXFLG);
$(FC) $(FFLAGS) -c $*$(FSFXFLG)

$(FSFXFLG):
cd $(SRC);
$(FC) $(FFLAGS) -c $*$(FSFXFLG)

$(SRC)/PREPRC.o : $(SRC)/PREPRC.F
$(SRC)/GBFESI.o : $(SRC)/GBFESI.F
$(SRC)/GENERIC.o : $(SRC)/GENERIC.F
$(SRC)/READ.o : $(SRC)/READ.F
$(SRC)/RDDATA.o : $(SRC)/RDDATA.F

**Can any experts in MAKE help me with this? I’m totally stuck and know almost nothing about this syntax - I just need to compile it.
THANK YOU!!!
:confused: Patti :frowning: **

Where is the rule for creating .F files? Please indicate the paragraph that you think applies.

**Hi:
I was told this is the rule for all “.f” files:
**
.F:
cd $(SRC);
$(CPP) $(CPPFLAGS) $.F > $$(FSFXFLG);
$(FC) $(FFLAGS) -c $*$(FSFXFLG)

**…and here is the list of “.f” files to process by that rule:
**
$(SRC)/PREPRC.o : $(SRC)/PREPRC.F
$(SRC)/GBFESI.o : $(SRC)/GBFESI.F
$(SRC)/GENERIC.o : $(SRC)/GENERIC.F
$(SRC)/READ.o : $(SRC)/READ.F
$(SRC)/RDDATA.o : $(SRC)/RDDATA.F

But I don’t know “make” syntax and was hoping someone would spot the problem for me.
Thanks!
Patti

It’s not a rule for making .f files from some other suffix. That sort of rule would look like this:

.something.f:
    command
    command

So if you don’t already have the file PREPRC.f, then you have to have the precursor to it, perhaps PREPRC.something.

Also remember the rules are case-sensitive, so it makes a difference if your file is FOO.F and your rule uses .f.

I do have preprc.f already which is why I think there’s a problem with the MAKEfile syntax - I’m assuming it’s a problem specific to SuSE from whatever system the developer is using. Can it really be a case problem in MAKE? I know the code’s author works on a *nix system so he couldn’t have made that error - unless there is a flavor of *nix that is not case-sensitive?

On Sun, 29 Jun 2008 16:16:04 GMT
PattiMichelle <PattiMichelle@no-mx.forums.opensuse.org> wrote:

>
>I do have PREPRC.f already which is why I think there’s a problem with
>the syntax - perhaps specific to suse. I don’t think it’s a case
>problem in MAKE?
>

Yes, ‘make’ is case-sensitive as well. It’s one of the bigger ‘gotchas’
when moving from a case-insensitive system to one that is
case-sensitive. Just make sure all of the rules and commands match.


Kevin Nathan (Arizona, USA)
Linux is not a destination, it’s a journey – enjoy the trip!

Linux 2.6.22.18-0.2-default
9:29am up 11:36, 21 users, load average: 0.49, 0.47, 0.58

There is a rule how to make an object from fortran source ‘.o.F:’, but I cannot see where the fortran compiler is defined. There should be a line like ‘#FC = gfortran’ or equivalent somewhere near top of the file.

Just ignore my above post. Have not used makefile for years.

On Wed, 02 Jul 2008 07:06:04 GMT
hro1 <hro1@no-mx.forums.opensuse.org> wrote:

>
>Just ignore my above post. Have not used makefile for years.
>
>

Just FYI, if you do need the Fortan compiler, it is usually
‘gcc-fortran’ or something similar. Sometimes has the version number
like: ‘gcc42-fortran’ . . .


Kevin Nathan (Arizona, USA)
Linux is not a destination, it’s a journey – enjoy the trip!

Linux 2.6.22.18-0.2-default
10:07pm up 3 days 0:44, 21 users, load average: 1.11, 1.09, 1.23

BTW, Linuxes use GNU make. The code’s author may have been using traditional Unix make. It is possible that GNU make clarifies some of the ambiguous parts of the make specification that may have worked by accident in Unix make. So you have to examine the Makefile rules and not assume that they were correct to start with.

There may be some debugging options you can turn on to see what make is “thinking” as it tries to make a target.

This is allready off topic, but on comment to

> Just FYI, if you do need the Fortan compiler, it is usually
> ‘gcc-fortran’ or something similar. Sometimes has the version number
> like: ‘gcc42-fortran’ . . .

if you install package gcc-fortran and all required packages you get


~> gfortran --version
GNU Fortran (GCC) 4.2.1 (SUSE Linux)
Copyright (C) 2007 Free Software Foundation, Inc.
...
~> which gfortran
/usr/bin/gfortran
~> ll /usr/bin/gfortran
lrwxrwxrwx 1 root root 12 2007-11-15 15:07 /usr/bin/gfortran -> gfortran-4.2

On Thu, 03 Jul 2008 12:06:03 GMT
hro1 <hro1@no-mx.forums.opensuse.org> wrote:

>This is allready off topic, but on comment to
>
>> Just FYI, if you do need the Fortan compiler, it is usually
>> ‘gcc-fortran’ or something similar. Sometimes has the version number
>> like: ‘gcc42-fortran’ . . .
>
>
>if you install package gcc-fortran and all required packages you get

I was referring to the package, but didn’t make that clear, sorry. It’s
been so long since I’ve used Fortran and I’ve never actually used it on
Linux . . . :slight_smile:


Kevin Nathan (Arizona, USA)
Linux is not a destination, it’s a journey – enjoy the trip!

Linux 2.6.22.18-0.2-default
8:43pm up 16:22, 21 users, load average: 0.28, 0.36, 0.38

I think there could be a problem with suse. I had an almost identical error trying to install dvb-v4l from source.

I just found out that my problem was a bad download of the source. I redownloaded it and it compiled perfectly. So this thread may have been all bogus! (sorry!)