When running a python "case" file for a computational/simulation program (used in research) via the command line on my MacBook (Big Sur 11.5) I get the following error:
ld: library not found for -lm
collect2: error: ld returned 1 exit status
(1) I don't know how to interpret what this means and would love an explanation. (2) I would appreciate input on how to troubleshoot this problem. Please note the problem is 100% not in my case file or the software. It has to be a problem with how I've set up things on my Mac.
Since my experience with running programs via the command line is limited, and my Fortran experience nonexistent, please don't assume very much prior knowledge on my part. I truly want a "for dummies" explanation.
The program I'm running has several dependencies, which according to the developer are:
- Python 3
- numpy
- scipy (only needed for additional utilities, postprocessor)
- matplotlib (only needed for additional utilities)
- GNU C (gcc/g++) and Fortran (gfortran) compilers (development headers must be present)
- Xcode and developer tools (OpenMPI support requires that Fortran-compatible libraries be built)
I've done my best to install up-to-date versions of all of the above. But honestly, some of the guides and stackoverflow conversations for working through this stuff is totally Greek to me. Particularly this stuff:
- "Development headers must be present" NO idea at all what that means.
- "OpenMPI support requires Fortran-compatible libraries be built" Again, not sure what that directive indicates I need to do.
I'm running the following versions of things:
- GNU Fortran/GCC: Homebrew GCC 11.3.0
- Python: 3.9.13
- Open MPI: 4.1.4