You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard-coding the C++ compiler command line is problematic for a number of reasons:
It is not possible to split the source code into multiple implementation (.cpp) files.
It is not possible to enable compiler optimizations (e.g. -O3).
It is not possible to select a more modern version of the C++ standard (e.g. -std=gnu++17).
It is not possible to link with any libraries. For example, talking to a server via HTTP practically requires the use of a library. The gcc image includes libcurl4-openssl-dev, but using it requires linking with -lcurl.
As an alternative, I recall a past contest where teams could supply two scripts, e.g. "build" and "run". The build script can invoke the compiler with any necessary arguments, or run a tool like "make", etc. The run script can run the program with any necessary arguments, environment variables, etc. If no special arguments are needed, the run script can just be the binary itself. I would also suggest copying an entire directory rather than just a single binary. The directory might contain the run script, the compiled binary, data files, shared libraries, etc.
I'll create a pull request along these lines if you are open to it.
The text was updated successfully, but these errors were encountered:
Hard-coding the C++ compiler command line is problematic for a number of reasons:
As an alternative, I recall a past contest where teams could supply two scripts, e.g. "build" and "run". The build script can invoke the compiler with any necessary arguments, or run a tool like "make", etc. The run script can run the program with any necessary arguments, environment variables, etc. If no special arguments are needed, the run script can just be the binary itself. I would also suggest copying an entire directory rather than just a single binary. The directory might contain the run script, the compiled binary, data files, shared libraries, etc.
I'll create a pull request along these lines if you are open to it.
The text was updated successfully, but these errors were encountered: