[CMake] ccmake and fortran
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Tue Aug 15 12:48:29 EDT 2006
On 2006-08-11 17:39-0700 bpwlist at cox.net wrote:
> I also discovered that include paths are not searched properly when the
dependecies are written out . I set my include paths in the CMakeLists.txt
as follows:
> INCLUDE_DIRECTORIES(
> include/
> )
> Included files under the "include/" directory are not written out to
depend.make. I have traced the problem part way down. It appears that when
cmLocalUnixMakefileGenerator3.cxx constructs the cmFortranDepends object
that the includes path vector is empty. The code loops through each
language, the paths gets set for C++ but not for Fortran. The code is
looking for the CMAKE_Fortran_INCLUDES to contain the paths, but the
variable is empty. Anybody have any ideas for a quick fix?
I suspect we have run across the same dependency issue in different form.
Here is a horrible workaround we have to deploy to overcome fortran module
dependency issues. We add a file cmakeworkaround.f which consists of
c Following two lines are to fool cmake into handling the dependecy
c correctly for plplot.
c module plplot
c end module plplot
subroutine dummy
end subroutine dummy
This fakes CMake into thinking there is a locally defined module called plplot
(although the compiler doesn't generate it because of the c in column 1).
Actually there is a plplot module defined by a fortran library which
CMake built in a different directory. The Fortran compiler can find this
module through the -I option, but CMake cannot find it so it complains
unless we use the above horrible workaround). Note this workaround depends
on the fixed format bug which was just fixed in CVS. As I said, it is
horrible workaround.
Anyhow, I am adding my voice to Bryan's asking for help getting a fundamental
fix for this "include" dependency issue for fortran. My bet is it will also
fix the above fortran module dependency issue.
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