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

Easier installation suggestion #77

Open
gbene opened this issue Feb 16, 2024 · 1 comment
Open

Easier installation suggestion #77

gbene opened this issue Feb 16, 2024 · 1 comment

Comments

@gbene
Copy link

gbene commented Feb 16, 2024

Hi again!

I am opening another issue since it is completely unrelated from the first that I made today.

DFNWorks is fantastic but I find it a bit cumbersome to install and use pydfnworks.
All the different components to compile locally in multiple machines and OSs takes quite a bit of time. I was wandering if you ever considered to organize and compact the pip package by including precompiled binaries of lagrit, DFGen etcetc. You could do this by including the binaries in a folder inside the package itself (so for example in pydfnworks>builds).

This would firstly simplify a lot the path management. Since the precompiled libraries are in a folder within the library there won't be the need to use the .dfnworksrc file. Secondly, with a bit of work, it could be possible to make DFNWorks crossplatform!

Implementation of this should not be that difficult because It would require to add the paths of the precompiled libraries in the package_data dict in setup.py like this:

        ...
        package_data={'': ['dfnGen/generation/output_report/figures/*png',
                           'builds/ConnectivityTest',
                           'builds/correct_stor',
                           'builds/correct_uge',
                           'builds/DFNGen',
                           'builds/lagrit',]}
      )

and then add in the init.py a way to get the internal path (that is also the the dfnworks_PATH). Something like this:

...
file_path = os.path.realpath(__file__)

internal_filepath = os.path.dirname(file_path)
os.environ['dfnworks_PATH'] = internal_filepath

os.environ['DFNGEN_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/DFNGen')
os.environ['CORRECT_UGE_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/correct_uge')
os.environ['CORRECT_STOR_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/correct_stor')
os.environ['CONNECT_TEST_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/ConnectivityTest')
os.environ['LAGRIT_EXE'] = os.path.join(os.environ['dfnworks_PATH'], 'builds/lagrit')
...

The difficult part would be to automate the compilation of the different libraries (maybe using github actions?).

Let me know your thoughts about this!

Thank you again!

@hymanjd
Copy link
Collaborator

hymanjd commented Feb 16, 2024

Thank you kindly for the recommendations. For those interested in simpler installation, we provide a docker container. If you would like to test this and submit a pull request, you're most welcome to. Thanks!

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 a pull request may close this issue.

2 participants