-
Notifications
You must be signed in to change notification settings - Fork 129
Use empty blas_ldflags if no cxx is configured #506
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
Conversation
@lucianopaz do you think it's worth it to add a test? |
In all honesty, I don’t know how to test this properly. I know that I can mock the cxx config but I’m not sure if that we’ll have us completely covered. @twiecki, could you try out this branch when there is no compiler and see if it works? |
Why mock? Can't you use the context manager Edit: Or this fails more internally? If so, ignore me |
Yes you're right, I can use the context manager instead. I realized now that I didn't cover the potential for failures in this part of the code. If
I think that I'll add some guardrails for that case in this PR and write a test for it too. |
1f90f5c
to
8b71f65
Compare
@ricardoV94, @twiecki, can I bother you to try out this PR and see if it breaks your installations that used:
|
Mine doesn't seem to have changed: Main:python -c "import pytensor; print(pytensor.config.blas__ldflags)"
-L/home/ricardo/miniconda3/envs/pytensor/lib -llapack -lblas -lcblas -lm -Wl,-rpath,/home/ricardo/miniconda3/envs/pytensor/lib PYTENSOR_FLAGS='cxx=""' python -c "import pytensor; print(pytensor.config.blas__ldflags)"
# IndexError: list index out of range PR:python -c "import pytensor; print(pytensor.config.blas__ldflags)"
-L/home/ricardo/miniconda3/envs/pytensor/lib -llapack -lblas -lcblas -lm -Wl,-rpath,/home/ricardo/miniconda3/envs/pytensor/lib PYTENSOR_FLAGS='cxx=""' python -c "import pytensor; print(pytensor.config.blas__ldflags)"
WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions. |
That looks fine. To add on this, I tried out using a C compiler that pytensor seems to like but I don't have installed PYTENSOR_FLAGS='cxx="icpc"' python -c "import pytensor; print(pytensor.config.blas__ldflags)"
~/repos/pytensor/pytensor/link/c/cmodule.py:2735: UserWarning: Pytensor cxx failed to communicate its search dirs. As a consequence, it might not be possible to automatically determine the blas link flags to use.
Command that was run: icpc -print-search-dirs
Output printed to stderr: /bin/sh: 1: icpc: not found
warnings.warn(
WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions. So I think that this PR is good to be merged |
Closes #504
Major / Breaking Changes
New features
Bugfixes
Documentation
Maintenance