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

PyJulia incompatibility on Linux #14

Closed
blakeaw opened this issue Aug 16, 2024 · 1 comment
Closed

PyJulia incompatibility on Linux #14

blakeaw opened this issue Aug 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@blakeaw
Copy link
Owner

blakeaw commented Aug 16, 2024

Describe the bug
PyJulia only runs correctly out of the box on Linux systems when the installed Python is built with --enable-shared. However, installing Python in a conda environment on Linux yields a statically linked Python that PyJulia doesn't support.

Python Environment (please complete the following information):

  • Environment (e.g., conda): conda inside a Docker container with Ubuntu 16.04 base image
  • Python version: 3.10.11
  • GAlibrate version: 0.7.1

Additional context

The troubleshooting guide in the PyJulia docs, https://pyjulia.readthedocs.io/en/latest/troubleshooting.html#your-python-interpreter-is-statically-linked-to-libpython, includes several workarounds.

Potential Fix

I think for GAlibrate, the Turn off compilation cache workaround probably makes the most sense:

from julia.api import Julia
jl = Julia(compiled_modules=False)

I don't think there should be a large performance penalty since the GAlibrate functions in Julia need to be JIT compiled anyways when first called. Although I guess it could add some latency to PyCall.

The run_gao_julia.py module could be patched to check the OS (using sys.platform) and for linux it can apply the above Turn off compilation cache workaround. Something like:

from sys import platform

if platform == 'linux':
    from julia.api import Julia
    jl = Julia(compiled_modules=False)
@blakeaw blakeaw added the bug Something isn't working label Aug 16, 2024
@blakeaw
Copy link
Owner Author

blakeaw commented Aug 16, 2024

Fix (workaround noted above) implemented in PR #15

@blakeaw blakeaw closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant