[CMake] Fortran 90 module dependencies problem

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Nov 8 12:20:40 EST 2006


On 2006-11-08 11:48+0100 raffaele borrelli wrote:

> Hi,
> I am quite new to cmake but I am trying to move all my Fortran projects from
> standard
> Makefile to cmake.
> Currently I am facing the following problem.
> I have a file xx.f90 which use a module declared in file yy.f90;
> yy.f90 is not in the same directory as xx.f90.
> The directory tree is like follows:
> /project
> /project/src/xx.f90
> /project/lib/yy.f90
>
> I build first yy.f90, and then xx.f90, however when compiling xx.f90
> it complains that there are no rules to build yy.mod.proxy.
> How can I tell cmake that the module has already been build and it
> must not look for that dependency?

This is bug 3984
(http://www.cmake.org/Bug/bug.php?op=show&bugid=3984&pos=1). That report
includes a reference to this list where this was discussed last as well
as a simple example so that the CMake developers can verify the bug for
themselves.

The ugly workaround is before you execute make you create a file with
arbitrary contents (the Unix touch command will do when testing this by hand
but for our project we create the required file with arbitrary contents
using cmake) called yy.mod.proxy.  Then your make should proceed without
problems.

I hope this bug will get fixed soon.  I believe that everybody using fortran
95 modules trips over this bug.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list