# Creating a simple fortran Autotools based project

**URL:** <https://fortran-lang.discourse.group/t/creating-a-simple-fortran-autotools-based-project/4938>\
**Category:** Uncategorized\
**Created:** [December 23, 2022, 7:28pm UTC](https://fortran-lang.discourse.group/t/creating-a-simple-fortran-autotools-based-project/4938 "2022-12-23T19:28:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [December 30, 2022, 11:02am UTC](https://fortran-lang.discourse.group/t/creating-a-simple-fortran-autotools-based-project/4938/3 "2022-12-30T11:02:14Z")

</div>

Hi Mary, welcome to Discourse!

The book [21st Century C](https://www.oreilly.com/library/view/21st-century-c/9781491904428/) by Ben Klemens has a section titled “Packaging Your Code with Autotools” (pg. 79) which offers a short introduction. The Autotools workflow is summarized by the following chart:

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/b/bce4edea5022352ecae895955c448f924d4d0bee.png)

Another source of information could be looking at existing Fortran projects using Autotools. One I’m aware of is [PSBLAS](https://github.com/sfilippone/psblas3). A Google search has also led me to [AstroBEAR](https://www.pas.rochester.edu/astrobear/), which offers some materials on the [Use [of] GNU Autotools](http://www.pas.rochester.edu/~bliu/Documents/configure.pdf) (PDF, 305 kB).

Generally speaking, the issue you encounter with GNU Autotools and Fortran is how to capture the module dependencies. We’ve had a few discussions on that topic already including

- [Module dependencies](https://fortran-lang.discourse.group/t/module-dependencies/1194), and
- [How do you generate file dependence when writing Makefile?](https://fortran-lang.discourse.group/t/how-do-you-generate-file-dependence-when-writing-makefile/2125).

Several tools exist to automate generation of these dependencies in the makefile rule format, including compiler built-in ones, [makedepf90](https://linux.die.net/man/1/makedepf90) or [fdep](https://gitlab.mpcdf.mpg.de/elpa/elpa/-/tree/master/fdep) (Autotools specific), however YMMV. Since you say your are contributing to an (existing) big library, it is likely your project already has some mechanisms/conventions for capturing module dependencies (either automated or manually/explicitly).

---

_[View the full topic](https://fortran-lang.discourse.group/t/creating-a-simple-fortran-autotools-based-project/4938)._
