Solving Makefile Confusion for Fortran Code

  • Context: Fortran 
  • Thread starter Thread starter Matterwave
  • Start date Start date
  • Tags Tags
    Confusion
Click For Summary
SUMMARY

This discussion focuses on modifying a Fortran codebase that utilizes a Makefile for compilation. The user aims to incorporate a new module, "spincohere.F90", and a different linear algebra package, "zheev", into the existing code. The user is unfamiliar with Makefile syntax and structure, leading to confusion about how to properly declare dependencies and compile the new module. Key insights include the importance of correctly specifying object file dependencies and the necessity of understanding Makefile syntax, particularly the use of tabs versus spaces.

PREREQUISITES
  • Understanding of Fortran programming language
  • Familiarity with Makefile syntax and structure
  • Knowledge of linear algebra packages, specifically "zheev"
  • Experience with compiling Fortran code using gfortran
NEXT STEPS
  • Research "GNU Make" and its syntax for writing Makefiles
  • Learn how to manage module dependencies in Fortran
  • Explore tutorials on integrating external libraries like "zheev" into Fortran projects
  • Practice writing and modifying Makefiles with sample Fortran projects
USEFUL FOR

This discussion is beneficial for Fortran developers, software engineers working with legacy code, and anyone looking to understand Makefile management in complex codebases.

  • #31
Matterwave said:
Do you mean the whole code, or just the module spincohere?

The whole code is VERY long! I'd imagine it would take quite a while to actually go through. I never even went through it all in its entirety...@_@
Just spincohere.
 
Technology news on Phys.org
  • #32
DrClaude said:
Just spincohere.

I have messaged it to you. Thanks. :D
 
  • #33
Matterwave said:
I have messaged it to you. Thanks. :D
I had a look, and there is no problem there. I now realize that I misread something in the error message you posted, and it should've been clear to me that the error was not in your code.

I'll get back to you tomorrow.
 
  • #34
DrClaude said:
I had a look, and there is no problem there. I now realize that I misread something in the error message you posted, and it should've been clear to me that the error was not in your code.

I'll get back to you tomorrow.

Ok thanks!
 
  • #35
DrClaude said:
I had a look, and there is no problem there. I now realize that I misread something in the error message you posted, and it should've been clear to me that the error was not in your code.

I'll get back to you tomorrow.

I have figured it out! I needed to install liblapack-dev instead of just liblapack3 as well. Now my code runs! But now I have more questions, which, since it has nothing to do with this make file, I will now post in a separate thread.