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

Install examles on cmake install. #9

Closed
bircoph opened this issue Jul 25, 2015 · 11 comments
Closed

Install examles on cmake install. #9

bircoph opened this issue Jul 25, 2015 · 11 comments

Comments

@bircoph
Copy link

bircoph commented Jul 25, 2015

Hi,

right now if ASL is configured with examples enabled (default behaviour) examples are built, but not installed during cmake install phase. CMakeLists.txt for examples contain no installation instructions, please fix this.

It should be the best to install binaries together with their source code, so that users will be able to learn how they work.

@AvtechScientific
Copy link
Owner

The idea behind this behaviour is the following:

  1. examples serve no practical purpose - only educational. Most probably even if somebody will need some of them to solve his real problem - he will have to adjust it more or less and then rebuild. Building is also part of learning. That's why we thought that there is no reason to install prebuild examples as part of a package, eventhough they are in the cmake build-tree.

another reason:
2. If run without a parameters file, relying only on the buildin default parameters values - many examples will try to dump the output in the "./" directory. That might lead to either errors requiring root permissions or to unintended output in the middle of the users /home-tree.

What do you think?

@ghisvail
Copy link
Contributor

  1. examples serve no practical purpose - only educational.

+1 for not building / installing examples.

@AvtechScientific
Copy link
Owner

We are closing this for now. Should there be more reasons to build/install examples feel free to reopen.

@bircoph
Copy link
Author

bircoph commented Jul 30, 2015

  1. My idea is very simple: if examples are being built, they should be installed.

Right now default behaviour is to build examples, but not to install them. This is strange and just wastes CPU time. If you consider examples not useful for general public, disable them by default. But if user asks for the examples, they should be installed as well.

In Gentoo we have special USE flag for this: USE=examples, so users may configure either globally or per-package if they want usage/config/educational/etc examples or not.

  1. Dumping output in $PWD is OK. Of course, examples should be runnable from any directory where user can write, not only from the directory where binary file lies.

However there is a problem here: some examples need input data files (examples/input_data) and, as far as I can see from the code, example programs try to read them from $PWD, which is wrong. Some preconfigured location should be checked as well.

@AvtechScientific
Copy link
Owner

Which "preconfigured location" would you suggest, so it stays platform independent?

@AvtechScientific
Copy link
Owner

What do you think about following scenario:

  1. disable examples by default (most distros will choose this by default)
  2. if enabled:
    • install them into bin
    • install examples/input_data into share/ASL/examples/input_data into
    • install their sources into share/ASL/examples/

As for reading input data we suggest to introduce a parameter --input-file without a default value that will accomodate the path to the input file.

@ghisvail
Copy link
Contributor

sounds reasonable to me and consistent with other projects practice

@AvtechScientific
Copy link
Owner

Done.
We left examples enabled by default, to make life easier for those who work directly with the tarball - @ghisvail, you'll have to disable it for the distro.

@bircoph
Copy link
Author

bircoph commented Jul 30, 2015

  • install them into bin

Please then consider renaming them into something like asl-$examplename. Otherwise there will be random collisions with other packages. General names like "flow" and "compressor" will be definitely a pain.

As for reading input data we suggest to introduce a parameter --input-file without a default value that will accomodate the path to the input file

Why not to set default to "share/ASL/examples/input_data" since files will be installed there anyway?

@AvtechScientific
Copy link
Owner

Please then consider renaming them into something like asl-$examplename. Otherwise there will be random collisions with other packages. General names like "flow" and "compressor" will be definitely a pain.

Yes, I was wondering how it is done on Gentoo... will do.

Why not to set default to "share/ASL/examples/input_data" since files will be installed there anyway?

  1. it would require configuring source code by cmake - this would make examples more complicated
  2. those who download and work with the tarball will often not install the examples but rather play with them in the build tree (thats why we have initially enabled examples without installing them) - in that case input data is not in share

@AvtechScientific
Copy link
Owner

Done

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

3 participants