Closed mathlusiverse closed 1 year ago
Thank you.
This seems to be the same issue as #49. Apparently the script which rewrites rpaths misses the rpaths to the gfortran library. Since the Sage spkg for gfortran does not work we embed the gfortran library from homebrew. My current guess is that the embedding is happening after the rpath script runs, but it needs to happen before, so the script can find the correct path to the gfortran library. If I am correct this should be relatively easy to fix. But that will need to wait a couple of weeks until I have access to my M1 build system again.
On Fri, Nov 18, 2022, 7:46 PM MLV @.***> wrote:
I installed Sagemath (SageMath-9.7_arm64) on Mac Book Pro (Apple M1 Pro). I can run many Sagemath commands without any problem. Surprisingly, find_root() does not work. I tried very simple equations such as follows: find_root( x-3, -5, 5 ). The exact solution is x=3. Error message follows:
ImportError Traceback (most recent call last) Input In [4], in <cell line: 1>() ----> 1 find_root( x-Integer(3) , -Integer(5), Integer(5) )
File /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/sage/misc/lazy_import.pyx:391, in sage.misc.lazy_import.LazyImport.call (build/cythonized/sage/misc/lazy_import.c:4397)() 389 True 390 """ --> 391 return self.get_object()(*args, **kwds) 392 393 def repr(self):
File /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/sage/numerical/optimize.py:106, in find_root(f, a, b, xtol, rtol, maxiter, full_output) 20 r""" 21 Numerically find a root of
f
on the closed interval[a,b]
22 (or[b,a]
) if possible, wheref
is a function in the one variable. (...) 103 104 """ 105 try: --> 106 return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output) 107 except AttributeError: 108 passFile /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/sage/symbolic/expression.pyx:12596, in sage.symbolic.expression.Expression.find_root (build/cythonized/sage/symbolic/expression.cpp:93733)() 12594 f = self._plot_fast_callable(self.default_variable()) 12595 ff = FastCallableFloatWrapper(f, imag_tol=imaginary_tolerance)
12596 return find_root(ff, a=a, b=b, xtol=xtol, 12597 rtol=rtol,maxiter=maxiter, 12598 full_output=full_output)
File /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/sage/numerical/optimize.py:157, in find_root(f, a, b, xtol, rtol, maxiter, full_output) 154 a = min(s_1, s_2) 155 b = max(s_1, s_2) --> 157 import scipy.optimize 158 brentqRes = scipy.optimize.brentq(f, a, b, 159 full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter) 160 # A check following :trac:
4942
, to ensure we actually found a root 161 # Maybe should use a different tolerance here? 162 # The idea is to take roughly the derivative and multiply by estimated 163 # value of the rootFile /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/init.py:399, in
1 """ 2 ===================================================== 3 Optimization and root finding (:mod: scipy.optimize
) (...) 396 397 """ --> 399 from ._optimize import 400 from ._minimize import 401 from ._root import *File /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/_optimize.py:34, in
32 import numpy as np 33 from scipy.sparse.linalg import LinearOperator ---> 34 from ._linesearch import (line_search_wolfe1, line_search_wolfe2, 35 line_search_wolfe2 as line_search, 36 LineSearchWarning) 37 from ._numdiff import approx_derivative 38 from ._hessian_update_strategy import HessianUpdateStrategy File /private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/_linesearch.py:16, in
1 """ 2 Functions 3 --------- (...) 12 13 """ 14 from warnings import warn ---> 16 from scipy.optimize import _minpack2 as minpack2 17 import numpy as np 19 all = ['LineSearchWarning', 'line_search_wolfe1', 'line_search_wolfe2', 20 'scalar_search_wolfe1', 'scalar_search_wolfe2', 21 'line_search_armijo'] ImportError: dlopen(/private/var/tmp/sage-9.7-current/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/_minpack2.cpython-310-darwin.so, 0x0002): Library not loaded: @rpath/libgfortran.5.dylib Referenced from: <0A67A52E-AD2D-37CA-8E03-AE41ADF22295> /Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/_minpack2.cpython-310-darwin.so Reason: tried: '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/libgfortran.5.dylib' (no such file), '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/libgfortran.5.dylib' (no such file), '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/libgfortran.5.dylib' (no such file), @.***/libgfortran.5.dylib' (no such file), '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/libgfortran.5.dylib' (no such file), '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/python3.10/site-packages/scipy/optimize/libgfortran.5.dylib' (no such file), '/Applications/SageMath-9-7.app/Contents/Frameworks/Sage.framework/Versions/9.7/local/var/lib/sage/venv-python3.10.5/lib/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache)
— Reply to this email directly, view it on GitHub https://github.com/3-manifolds/Sage_macOS/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6CPZU3RQ2BKR7IILIGGTWJAWQTANCNFSM6AAAAAASFBKHNM . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@culler thanks for the quick and detail explanation, hope you have the opportunity to fix the problem soon!
@mathlusiverse: can you please test the diskimage in the v1.5.2 prerelease? Please let me know if it solves this problem. Thanks.
@culler I will be happy to test it. I can find the link of v1.5.1 prerelease, not 1.5.2. Please post the link, thanks.
It is at the top of the releases page. There is a link to the releases page at the right hand side of the Sage_macOS project home page. The url for v1.5.2 is https://github.com/3-manifolds/Sage_macOS/releases/tag/v1.5.2.
@culler Thanks for the link. It worked. I can now run find_root( x-3 , -5, 5 )
and obtain the answer 3. Thanks for updating the executable!
You are welcome. Thanks for the report.
I installed Sagemath (SageMath-9.7_arm64) on Mac Book Pro (Apple M1 Pro). I can run many Sagemath commands without any problem. Surprisingly, find_root() does not work. I tried very simple equations such as follows:
find_root( x-3, -5, 5 )
. The exact solution is x=3. Error message follows: