Module dependency with Fortran code (avoiding compilation cascades)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Module dependency with Fortran code (avoiding compilation cascades)

Angel de Vicente
Hi,

our project was using hand-made makefiles which were becoming difficult
to maintain, so I decided to migrate to CMake. This is my first time
with CMake, so still testing it, but there is something that I haven't
figured out how to do, namely avoid compilation cascades.

I'm using right now Intel Fortran and the issue with it is that
everytime you make a change in the source code, the generated .mod file
is also created even if the procedures interfaces were not changed at
all. With our hand made makefiles I was keeping a copy of the .mod files
in another directory, then after the .mod file was generated I stripped
the first bytes (to avoid a timestamp that Intel Fortran puts in the
.mod files) and then compared with the old .mod file. If both were
identical I overwrote the new .mod file with the old one, and since
other object files depended on the .mod files (as per the hand-made
written makefile), then no recompilation of other files using that
module was performed.

I was hoping to get similar behaviour with CMake, but without so much
hand-made tweaking (as I read that CMake could do its own dependency
resolution), but I'm not sure how to proceed, as at least now every time
I just modify anything in one of the source files, every module that
uses it is recompiled (recursively all the project up).

Any pointers on how to avoid compilation cascades with Fortran+CMake?

Many thanks,
--
Ángel de Vicente
http://www.iac.es/galeria/angelv/         
---------------------------------------------------------------------------------------------
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Protección de Datos, acceda a http://www.iac.es/disclaimer.php
WARNING: For more information on privacy and fulfilment of the Law concerning the Protection of Data, consult http://www.iac.es/disclaimer.php?lang=en

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...