AvtechScientific / ASL

Advanced Simulation Library - hardware accelerated multiphysics simulation platform.
http://asl.org.il
GNU Affero General Public License v3.0
223 stars 55 forks source link

Install examles on cmake install. #9

Closed bircoph closed 9 years ago

bircoph commented 9 years ago

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 commented 9 years ago

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:

  1. 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 commented 9 years ago
  1. examples serve no practical purpose - only educational.

+1 for not building / installing examples.

AvtechScientific commented 9 years ago

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

bircoph commented 9 years ago

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.

2) 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 commented 9 years ago

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

AvtechScientific commented 9 years ago

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 commented 9 years ago

sounds reasonable to me and consistent with other projects practice

AvtechScientific commented 9 years ago

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 commented 9 years ago
  • 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 commented 9 years ago

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 commented 9 years ago

Done