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

EDM generation broken after install #58

Closed
gaede opened this issue Sep 27, 2019 · 9 comments · Fixed by #59
Closed

EDM generation broken after install #58

gaede opened this issue Sep 27, 2019 · 9 comments · Fixed by #59
Labels

Comments

@gaede
Copy link
Contributor

gaede commented Sep 27, 2019

As a result of #54 the EDM egenration does not work anymore for external clients (EDM4Hep).
The reason is the hardcoded template_dir path "../templates" that is no longer available in the install. @drbenmorgan can you have a look at this ?

Current workaround:

cd INSTALL_DIR
ln -s SOURCE_DIR/templates .
@gaede gaede added the bug label Sep 27, 2019
@drbenmorgan
Copy link
Contributor

Hi @gaede, apologies for that, I'll get a fix Pull Request prepared.

@drbenmorgan
Copy link
Contributor

Having had a quick look at this, there are a several ways to resolve this so thought better to discuss here before fixing in a Pull Request:

  1. Restore original behaviour, so the install tree would look like:

    +- CMAKE_INSTALL_PREFIX/
       +- python/
       +- templates/
    

    The simplest, but will cause problems for packagers - e.g. say the install prefix is /usr/local, then /usr/local/templates is non-standard and could easily clash (I'm ignoring the python dir for now!).

  2. Move templates as a subdirectory of python, so the relative path becomes "./templates". This is probably the best solution if the template files aren't for general access/use, i.e. only podio's python code will read them.

  3. Update the relative path on install using known install locations to construct a relative path.

I'll implement whatever solution is preferred for podio. My personal recommendation would be the second one if the template files are only intended for internal use by podio's class generation.

@gaede
Copy link
Contributor Author

gaede commented Sep 27, 2019

Hi @drbenmorgan, I'd also vote for option 2). Can't think of any other use cases for the templates than from our python generators.

@gaede
Copy link
Contributor Author

gaede commented Sep 27, 2019

PS: shouldn't the INSTALL_DIR/python have a podio subdirectory in case someone wants to install to /usr/local/ ?

@drbenmorgan
Copy link
Contributor

Thanks @gaede, I'll go ahead and implement 2).

You're right on the INSTALL_DIR/python issue, but python/podio also seems odd. Looking at the files in python/, there are some programs and modules

  • programs: podio_class_generator.py, podio_create_package.py
  • modules: podio_config_reader.py, podio_templates.py, EventStore.py

The former should probably go under a bin/ subdirectory, but am not sure about the latter. I'd guess lib/pythonX.Y/site-packages/podio. Maybe just install them all to bin for now?

@drbenmorgan
Copy link
Contributor

Ah scratch that install to bin, since that would stick templates under that which wouldn't be good.

@gaede
Copy link
Contributor Author

gaede commented Sep 27, 2019

How about having sth like:

/usr/local/include
/usr/local/lib
/usr/local/podio
/usr/local/podio/python
/usr/local/podio/templates
/usr/local/podio/...

Then we could easily add whatever is needed to /usr/local/podio/ ?

drbenmorgan added a commit to drbenmorgan/podio that referenced this issue Sep 27, 2019
The changes introduced by AIDASoft#54 caused installs to fail due to the change
in location of the templates directory relative to python/.

Following discussion in AIDASoft#58, implement simplest possible change to fix
by moving templates inside the python directory. Retain this layout at
install time, adjusting the `template_dir` variable in
podio_class_generator.py accordingly.

Fixes: AIDASoft#58
@drbenmorgan
Copy link
Contributor

I've submitted a Pull Request to fix the main issue using the 2nd option. Long term, it's probably best to think about a structure like:

+- bin/
    +- podio_class_generator
+- include/
    +- podio/
+- lib/
    +- libpodio.so
    +- ...dict...
    +- cmake/
    +- pythonX.Y/
       +- site-packages/
          +- podio/
             +- EventStore.py ?
             +- podio_config_reader.py ?
                 ...

That would require a little more work though, so thought best to submit the PR to get the fix in directly for now!

@peremato
Copy link
Collaborator

peremato commented Sep 27, 2019 via email

@gaede gaede closed this as completed in #59 Sep 27, 2019
gaede pushed a commit that referenced this issue Sep 27, 2019
The changes introduced by #54 caused installs to fail due to the change
in location of the templates directory relative to python/.

Following discussion in #58, implement simplest possible change to fix
by moving templates inside the python directory. Retain this layout at
install time, adjusting the `template_dir` variable in
podio_class_generator.py accordingly.

Fixes: #58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants