[CMake] Fortran 90 modules not rebuilt

K. Noel Belcourt kbelco at sandia.gov
Tue Nov 16 17:03:11 EST 2010


On Nov 16, 2010, at 2:48 PM, Eric Noulard wrote:

> 2010/11/16 Belcourt, K. Noel <kbelco at sandia.gov>:
>>
>> On Nov 16, 2010, at 2:05 PM, Belcourt, K. Noel wrote:
>>
>>> On Nov 16, 2010, at 1:59 PM, Brad King wrote:
>>>
>>>> On 11/16/2010 01:11 PM, K. Noel Belcourt wrote:
>>>>>
>>>>> I've attached my project's top-level Makefile.  I'm trying to  
>>>>> force
>>>>> all the modules in the project to build first so I created a  
>>>>> single
>>>>> library called modules that contains all my Fortran 90 module  
>>>>> files.
>>>>> I'm invoking the Makefile explicitly passing the modules as the
>>>>> target to build (so I can build a clean project in two steps: make
>>>>> modules ; make)
>>>>
>>>
>>>> The Fortran module dependencies implementation is hidden inside the
>>>> Makefile generators.  There is no API to access any of its  
>>>> timestamp
>>>> files or scanning rules.
>>
>> What's interesting is that in a project that's fully update to  
>> date, running
>> the make modules command gives this curious output:
>>
>> S896822:tools kbelco$ make modules
>> [ 16%] Built target util
>> [ 19%] Built target tp
>> [ 25%] Built target spr
>> [ 35%] Built target rn2
>> [ 61%] Built target rn1
>> [ 61%] Built target mp
>> [100%] Built target modules
>>
>> which is the same list of libraries in these SUBDIRS commands in the
>> top-level CMakeLists.txt file (in reverse order).
>
> Is there any reason you are using SUBDIRS instead of ADD_SUBDIRECTORY?
>
> SUBDIRS is deprecated and as far as I remember it has a different
> "search-ordering" than add_subdirectory
>
> try replacing your SUBDIRS with add_subdirectory.

Same exact behavior with add_subdirectory.

-- Noel




More information about the CMake mailing list