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

Add examples to build system #9

Merged
merged 3 commits into from
Nov 11, 2021

Conversation

peanutfun
Copy link

@peanutfun peanutfun commented Nov 10, 2021

What does this PR do?

Add the example source files as executables to the build system. This way, they can be easily built by executing

$ make examples

Why was this PR suggested?

The examples would so far need to be compiled with commands to the compiler after installing GiNaCDE. Since they are part of the repository, it improves usability if they are included in the build system. This way, users do not need to install GiNaCDE to build and execute (and possibly also modify) the examples.

Open questions

  • The examples/ folder also contains the output of the example executables. This can cause some issues as files that are produced by the code in a repository are often forgotten when updating the code. For example, the example files have been recently updated in aeeb00a, with some files being renamed, but the old files have not been removed. Once the examples are part of the regular build system, it might be enough to just keep one single output file in the repository as an example. All other example output files can be easily recreated locally by running all the examples.

  • I needed to update the includes from <GiNaCDE/GiNaCDE.h> to <GiNaCDE.h> for building the examples. This is against the instructions of the current README.md, but in line with the pkg-config include directory settings, see my comment in Support and advertise usage in downstream build systems #8.

Related issues

openjournals/joss-reviews#3885

* Register examples as executables that are `EXCLUDED_FROM_ALL`
  (not built by default).
* Add meta-target `examples` for building all examples.
* Fix includes for all examples.
Add instructions for building examples.
@mithun218 mithun218 merged commit db70baf into mithun218:master Nov 11, 2021
@mithun218
Copy link
Owner

Nice improvement, looks good. Thanks @peanutfun. I have checked it works fine. I have merged it as it is.

@mithun218
Copy link
Owner

I agree with your suggestions:

The examples/ folder also contains the output of the example executables. This can cause some issues as files that are produced by the code in a repository are often forgotten when updating the code. For example, the example files have been recently updated in aeeb00a, with some files being renamed, but the old files have not been removed. Once the examples are part of the regular build system, it might be enough to just keep one single output file in the repository as an example. All other example output files can be easily recreated locally by running all the examples.

I have implemented it in PR #14 .

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

Successfully merging this pull request may close these issues.

None yet

2 participants