[CMake] Fortran 90 module output directories, dependency analysis
Kelly Thompson
kgt at lanl.gov
Tue Jun 1 10:43:43 EDT 2010
This can be done using a Fortran compile option. For gfortran, add the
option "-M<dir>" to CMAKE_Fortran_FLAGS.
> -----Original Message-----
> From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
Of
> Jed Brown
> Sent: Monday, May 31, 2010 5:41 AM
> To: cmake at cmake.org
> Subject: [CMake] Fortran 90 module output directories, dependency analysis
>
> Is there a way to specify where generated *.mod files will be placed?
> Something analogous to CMAKE_LIBRARY_OUTPUT_DIRECTORY?
>
> Also, I notice that if I delete a module file, the build fails (unlike
> everything else where it will be properly regenerated). This is with a
> plain Makefile build, cmake-2.8.1, after a successful complete build:
>
> $ rm petscmat.mod
> $ make VERBOSE=1
> /usr/bin/cmake -H/home/jed/petsc -B/home/jed/petsc/ompi-complex-int64 --
> check-build-system CMakeFiles/Makefile.cmake 0
> /usr/bin/cmake -E cmake_progress_start /home/jed/petsc/ompi-complex-
> int64/CMakeFiles /home/jed/petsc/ompi-complex-
> int64/CMakeFiles/progress.marks
> make -f CMakeFiles/Makefile2 all
> make[1]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> make -f CMakeFiles/petsc.dir/build.make CMakeFiles/petsc.dir/depend
> make[2]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> cd /home/jed/petsc/ompi-complex-int64 && /usr/bin/cmake -E cmake_depends
> "Unix Makefiles" /home/jed/petsc /home/jed/petsc /home/jed/petsc/ompi-
> complex-int64 /home/jed/petsc/ompi-complex-int64 /home/jed/petsc/ompi-
> complex-int64/CMakeFiles/petsc.dir/DependInfo.cmake --color=
> make[2]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make -f CMakeFiles/petsc.dir/build.make CMakeFiles/petsc.dir/requires
> make[2]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> make -f CMakeFiles/petsc.dir/build.make CMakeFiles/petsc.dir/src/sys/f90-
> mod/petscmod.F.o.provides.build
> make[3]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> /usr/bin/cmake -E cmake_copy_f90_mod petscsys
> CMakeFiles/petsc.dir/petscsys.mod.stamp GNU
> /usr/bin/cmake -E cmake_copy_f90_mod petscsysdef
> CMakeFiles/petsc.dir/petscsysdef.mod.stamp GNU
> /usr/bin/cmake -E touch CMakeFiles/petsc.dir/src/sys/f90-
> mod/petscmod.F.o.provides.build
> make[3]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make -f CMakeFiles/petsc.dir/build.make CMakeFiles/petsc.dir/src/vec/f90-
> mod/petscvecmod.F.o.provides.build
> make[3]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> /usr/bin/cmake -E cmake_copy_f90_mod petscis
> CMakeFiles/petsc.dir/petscis.mod.stamp GNU
> /usr/bin/cmake -E cmake_copy_f90_mod petscisdef
> CMakeFiles/petsc.dir/petscisdef.mod.stamp GNU
> /usr/bin/cmake -E cmake_copy_f90_mod petscvec
> CMakeFiles/petsc.dir/petscvec.mod.stamp GNU
> /usr/bin/cmake -E cmake_copy_f90_mod petscvecdef
> CMakeFiles/petsc.dir/petscvecdef.mod.stamp GNU
> /usr/bin/cmake -E touch CMakeFiles/petsc.dir/src/vec/f90-
> mod/petscvecmod.F.o.provides.build
> make[3]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make -f CMakeFiles/petsc.dir/build.make CMakeFiles/petsc.dir/src/mat/f90-
> mod/petscmatmod.F.o.provides.build
> make[3]: Entering directory `/home/jed/petsc/ompi-complex-int64'
> /usr/bin/cmake -E cmake_copy_f90_mod petscmat
> CMakeFiles/petsc.dir/petscmat.mod.stamp GNU
> Error copying Fortran module "petscmat". Tried "PETSCMAT.mod" and
> "petscmat.mod".
> make[3]: *** [CMakeFiles/petsc.dir/src/mat/f90-
> mod/petscmatmod.F.o.provides.build] Error 1
> make[3]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make[2]: ***
[CMakeFiles/petsc.dir/src/mat/f90-mod/petscmatmod.F.o.provides]
> Error 2
> make[2]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make[1]: *** [CMakeFiles/petsc.dir/all] Error 2
> make[1]: Leaving directory `/home/jed/petsc/ompi-complex-int64'
> make: *** [all] Error 2
>
>
> Jed
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list