fortran-lang / playground

An interactive Fortran playground
MIT License
34 stars 12 forks source link

Comments on docker run command #8

Closed everythingfunctional closed 2 years ago

everythingfunctional commented 2 years ago

Quoting comment by @milancurcic from #2

A few questions and comments:

  1. Is the command bin/bash here because we're by default in / in this container? I suggest using /bin/bash just to be safe, and if we change WORKDIR later we won't need to tweak this.
  2. Don't use output.o for the executable; *.o is commonly used for non-executable binary objects; there's no conflict here, but it's useful to follow the convention. You can use any name for the executable, e.g. executable, program, x, etc.
  3. I suggest running the executable only if the compile step succeeds; i.e. cd fortran && gfortran Fortran.f90 -o output.o && ./output.o.
ashirrwad commented 2 years ago
  1. We've moved away from calling bin/bash we use commands inside the workdir now
  2. Executable is already named executed_file.o, I think it won't conflict.
  3. I'll add that to the commands, I think displaying error messages from the compiler output would also be useful , I'll work on that
ashirrwad commented 2 years ago

16 addresses the issue of running executable only when output succeeds. We also display the error message from the compiler now.