[CMake] fortran, modules and case
Andrew Brydon
abrydon at lanl.gov
Wed May 16 14:19:34 EDT 2007
Hi,
I am trying to port a large existing fortran library to using cmake,
and have come up against a problem with the use of inconsistent
module cases in the code (this is permitted in fortran).
I believe the logic in the existing fortran dependancy scanner does
not consistently change the case of modules. The .mod.proxy targets
are sometimes changed to lower case, but at other times the case of
the source code is used. I've attached a small example with two
modules that use inconsistent module access and fail to compile with
the latest cmake from cvs as follows
blanco:~/tmp/cmake_f90/_build/cmake2.4 abrydon$ make
Scanning dependencies of target hello_mods
make[2]: *** No rule to make target `hello1.mod.proxy', needed by
`CMakeFiles/hello_mods.dir/main.o.requires'. Stop.
make[1]: *** [CMakeFiles/hello_mods.dir/all] Error 2
make: *** [all] Error 2
I've attached a patch to cmDependsFortran.cxx which seems to fix the
problem in both the simple example and the existing package.
thanks
Andrew
-------------- next part --------------
PROJECT(Hello Fortran)
ADD_EXECUTABLE(hello_mods
main.f90
Hello1_mod.f90
Hello2_mod.f90
)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hello1_mod.f90
Type: application/octet-stream
Size: 137 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070516/e10583a6/Hello1_mod.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hello2_mod.f90
Type: application/octet-stream
Size: 134 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070516/e10583a6/Hello2_mod.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.f90
Type: application/octet-stream
Size: 98 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070516/e10583a6/main.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_f90_modules.patch
Type: application/octet-stream
Size: 2008 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070516/e10583a6/cmake_f90_modules.obj
-------------- next part --------------
--
Andrew Brydon
CCS-2 Continuum Dynamics
LANL
+1 505 667 5337
More information about the CMake
mailing list