Solving Makefile Confusion for Fortran Code

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

Discussion Overview

The discussion revolves around modifying a Fortran codebase that utilizes a makefile for building the project. The original poster is attempting to incorporate a new module and a different linear algebra package into an existing code structure, which involves understanding and potentially modifying the makefile to accommodate these changes.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • The original poster describes their modifications to the Fortran code and expresses confusion about how to adjust the makefile to include a new module and a different linear algebra package.
  • Some participants suggest adding the new module as a separate object file and ensuring that the necessary modules are accessible to it.
  • One participant emphasizes the importance of function names and the order of linking object files in the makefile.
  • Another participant advises separating modules into their own files for better organization and accessibility.
  • There are comments expressing frustration with makefiles, with some participants noting that they are still widely used in programming despite their complexity.
  • Several participants mention the importance of correct whitespace in makefiles, particularly the use of tabs versus spaces.
  • A suggestion is made to refer to specific literature on makefiles for further guidance.

Areas of Agreement / Disagreement

Participants express varying levels of frustration and confusion regarding makefiles, with some advocating for their use and others expressing a preference for GUI tools. There is no consensus on the best approach to modifying the makefile or the organization of modules.

Contextual Notes

Participants highlight the potential complexity of the makefile and the need for careful attention to syntax and structure when making modifications. There are unresolved questions about the accessibility of modules and the implications of linking order.

Who May Find This Useful

This discussion may be useful for individuals working with Fortran codebases, particularly those unfamiliar with makefiles or seeking to modify existing code structures involving multiple modules and dependencies.

  • #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.