<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>I don't know the specifics of this case, but the only time we've ever had trouble with F90 modules is when we add a dependency and don't delete the build tree before trying to reconfigure. <br><br>We have several hundred modules, many in the same directory and many used across directories and don't have any issues with it. I know that's not super helpful to hear when you have an issue, but the dependency scanner does seem to work.<br><br>Have you tried wiping out the entire build tree and trying again?<br><br>Tim<br><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Matthew Schuchard" <ms503@gtri.gatech.edu><br><b>To: </b>"brad king" <brad.king@kitware.com><br><b>Cc: </b>cmake@cmake.org<br><b>Sent: </b>Friday, March 2, 2012 10:28:09 AM<br><b>Subject: </b>[CMake] Fortran 90 Module Issues in CMake<br><br>
<pre>>> but I have found that this person:
>><i> <a href="http://www.cmake.org/pipermail/cmake/2010-November/040832.html" target="_blank">http://www.cmake.org/pipermail/cmake/2010-November/040832.html</a>
</i>>><i> had a very similar problem.
</i>
> This one?
<a href="http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/32850/focus=32893" target="_blank">> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/32850/focus=32893</a>
Yes.
That person also had an issue with one Fortran 90 file using a module built by another Fortran 90
file in the same target and directory, and had the same error message from gnumake as I did.
His solution was to manually add a dependency since in his case it appeared CMake missed it?
But I have about a hundred instances of this same-target/directory module dependence.
Also, I think some rpm installed in the background without my knowing it, so I restarted Firefox
and now I can view your examples of:
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/CMakeLists.txt;hb=v2.8.7" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/CMakeLists.txt;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/a.f90;hb=v2.8.7" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/a.f90;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/b.f90;hb=v2.8.7" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/b.f90;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/CMakeLists.txt;hb=v2.8.7" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/CMakeLists.txt;hb=v2.8.7</a>
<a href="http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/main.f90;hb=v2.8.7" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/main.f90;hb=v2.8.7</a>
Something that confuses me is:
1 INCLUDE_DIRECTORIES(${Library_MODDIR})
7 IF(CMAKE_Fortran_MODDIR_FLAG)
8 SET_TARGET_PROPERTIES(subdir_mods PROPERTIES
9 Fortran_MODULE_DIRECTORY modules
10 )
11 ENDIF(CMAKE_Fortran_MODDIR_FLAG)
If a hardcoded directory "modules" is being specified as the output directory for modules built from
a.f90 and b.f90 when the compiler supports a module output flag, why isn't "modules" in the include
directories so that a.f90 can find B.mod? Or is "${Library_MODDIR}" an intrinsic CMake function which
is assigned the local target's module output directory?
>><i> The problem is I need a Fortran 90 file to be built using a module from another Fortran 90 file in the same
</i>>><i> directory and target, and I need this often.
</i>
> This is expected to work. If one Fortran 90 source file in
> a single target provides a module and another one uses it then
> CMake will detect this and add the proper make dependencies to
> build them in the right order (and rebuild).
> -Brad
But this is not working for me. I still have the error:
*** No rule to make target `dir/CMakeFiles/target.a.dir/foo2.mod.stamp',
needed by `dir/foo.tmp.f'. Stop.
for add_library(target foo.f90 foo2.f90), where foo.f90 has "USE foo."
This may be a similar issue as my Ada modules having the erroneous requires step which
caused a red herring error to show up which you caught in January (vis a vis something other
than dependency checking is causing the error). So why would a make rule for
*.mod.stamp not be generated?
</pre>
<br>--<br><br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.cmake.org/mailman/listinfo/cmake</div><br></div></body></html>