Opened 17 years ago

Closed 17 years ago

#65 closed bug (Fixed)

makefile library access — at Version 3

Reported by: arango Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.1
Component: Nonlinear Version: 3.1
Keywords: Cc:

Description (last modified by arango)

There is a problem in the makefile and the application-dependent compilation options from file make_macros.mk. This one is a little bit tricky and affects the order of configuration files included in the makefile. It turns out that the file make_macros.mk needs to be included first before the dependencies are generated and included. This implies that the application-dependent CPP flags need to be set-up earlier because they are needed to create configuration file make_macros.mk.

Change History (3)

comment:1 by arango, 17 years ago

Description: modified (diff)
Resolution: Fixed
Status: newclosed

Many thanks to John Warner for reporting this problem. I also corrected few typos.

comment:2 by m.hadfield, 17 years ago

Resolution: Fixed
Status: closedreopened

I'm not sure this is working properly. On one of the platforms I use (MINGW-g95) I get this warning

/bin/sh: cc: command not found

and then the message about including make_macros.h

I believe the warning is generated in trying to execute the following makefile code:

 MACROS := $(shell $(CPP) $(ROMS_CPPFLAGS) Compilers/make_macros.h > \
		$(MAKE_MACROS); $(CLEAN) $(MAKE_MACROS))

This calls the preprocessor CPP, which has yet to be defined by the platform-specific include file, so make's default value is used, which I think is "cc -E". But this system has no "cc" command, so the above warning is generated by the shell and the $(MAKE_MACROS) file is empty.

The above interpretation is confirmed by the fact that I can suppress the warning, and get a non-empty $(MAKE_MACROS) file if I specify CPP=cpp on the make command line.interpretation.

So macros.mk has to be included before the platform make file to make sure the application-dependent macros (USE_ADJOINT etc) are defined. But to generate macros.mk we require the CPP macro to be valid, and this is specified in the platform make file. Aaaaaarrrrrrrrgggggggggghhhhhh!

comment:3 by arango, 17 years ago

Description: modified (diff)
Resolution: Fixed
Status: reopenedclosed

This ticket has been open for a while. The makefile was changed on 07/31/07 (ticket:70) as:

MACROS := $(shell cpp -P $(ROMS_CPPFLAGS) Compilers/make_macros.h > \
                $(MAKE_MACROS); $(CLEAN) $(MAKE_MACROS))

so the cpp -P command is used instead of the CPP definition. This implies that the user needs to have the cpp program location in the PATH environmental variable. This solution is not perfect but it is the best that we can do.

Note: See TracTickets for help on using tickets.