Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug reported by a nobody. #431

Closed
ghost opened this issue Apr 27, 2019 · 4 comments
Closed

A bug reported by a nobody. #431

ghost opened this issue Apr 27, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 27, 2019

No description provided.

@jeanPerier
Copy link
Collaborator

jeanPerier commented Apr 29, 2019

f18 is written in modern C++, it requires quite some memory to be built. However, it requires nowhere near 32 GB. I actually just checked that I could build it on a machine with the following config:

  • 8 GB of RAM
  • Linux Ubuntu 19.04
  • GCC 8.3 (comes with Ubuntu 19.04)
  • LLVM 9.0 (from LLVM source repo)
  • GNU make 4.2.1 (comes with Ubuntu 19.04)
  • ld linker from GNU binutils 2.32 (comes with Ubuntu 19.04).

I did not use any cmake options but the one to indicate the path to LLVM (LLVM_DIR).

The peak memory usage I measured was around 7 GB when compiling lib/parser/parsing.cc. This is looks normal to me because the parser is heavily templatized. So it is close from the 8GB of RAM you have, but it worked on my machine with 8GB. For other files, the average compilation memory usage is between 1 to 3 GB of RAM usage.
With only 8GB of RAM you should unfortunately avoid parallel jobs or doing other memory intensive tasks on your machine while building f18.

I do not know which compiler version you are using. If you keep having memory issue, consider trying with another compiler/compiler version. I do not know which linker you are using nor when your f18 build is crashing, but if you are running into memory exhaustion during link-time, please consider using a different linker such as lld from LLVM or GNU gold.

@klausler
Copy link
Collaborator

The f18 parser is composed at compiler build time via C++ template expansion that elaborates and combines parsers for each of the parts of Fortran syntax. This technique yields a fast and correct parser for Fortran programs, but is memory-intensive to build with current C++ compilers. We have chosen to prioritize Fortran compilation correctness and performance.

@klausler
Copy link
Collaborator

The f18 parser is complete today for Fortran 2018 and OpenMP 4.5, so I would not expect the grammar to grow until the next revisions of those standards arrive and are implemented.

@ghost ghost changed the title Too much RAM required. A bug reported by a nobody. Dec 8, 2019
@klausler
Copy link
Collaborator

It might be worth checking f18's build time and build memory requirements again in your environment; I've put some time into mitigating these costs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants