Problem with %attach for SageMath 9.0 on Windows 10 with .spyx files

asked 2018-11-03 20:27:46 +0200

updated 2020-02-06 08:13:31 +0200

EDIT (01/02/2020) on version 9.0.

Consider a source code reduced to the following line:

# %attach SAGE/AttachTest.spyx

When I attach it the first time, it is OK, but if I save again the source code, there is the following problem (which appears from version 8.3 or less). How to fix this problem?

Note that this problem is specific to .spyx files, as everything works well for .sage files.

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.7.3. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
sage: %attach SAGE/AttachTest.spyx
Compiling ./SAGE/AttachTest.spyx...
sage:       0 [main] python3.7 1214 child_info_fork::abort: unable to map \??\C:\Users\Sébastien Palcoux\.sage\temp\LAPTOP-7O5QV19T\1192\spyx\_home_sage_SAGE_AttachTest_spyx\_home_sage_SAGE_A
ttachTest_spyx_0.dll (using C:\Users\Sébastien Palcoux\.sage\temp\LAPTOP-7O5QV19T\1192\spyx\_home_sage_SAGE_AttachTest_spyx\_home_sage_SAGE_AttachTest_spyx_0.dll), Win32 error 126
### reloading attached file AttachTest.spyx modified at 05:48:32 ###
Compiling /home/sage/SAGE/AttachTest.spyx...
---------------------------------------------------------------------------
BlockingIOError                           Traceback (most recent call last)
/opt/sagemath-9.0/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py in _wrapper(*args, **kwargs)
     59         try:
---> 60             return func(*args, **kwargs)
     61         except OSError as e:

/opt/sagemath-9.0/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py in _query(package, *options)
     69     cmd = '{0} {1} {2}'.format(pkg_config_exe, ' '.join(options), package)
---> 70     proc = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE)
     71     out, err = proc.communicate()

/opt/sagemath-9.0/local/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    774                                 errread, errwrite,
--> 775                                 restore_signals, start_new_session)
    776         except:

/opt/sagemath-9.0/local/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1452                             errpipe_read, errpipe_write,
-> 1453                             restore_signals, start_new_session, preexec_fn)
   1454                     self._child_created = True

BlockingIOError: [Errno 11] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-2-7b41dee30a81> in <module>()
----> 1 sage.repl.load.load(sage.repl.load.base64.b64decode("L2hvbWUvc2FnZS9TQUdFL0F0dGFjaFRlc3Quc3B5eA=="),globals(),True)

/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/repl/load.py in load(filename, globals, attach)
    274         if attach:
    275             add_attached_file(fpath)
--> 276         exec(load_cython(fpath), globals)
    277     elif ext == '.f' or ext == '.f90':
    278         from sage.misc.inline_fortran import fortran

/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/repl/load.py in load_cython(name)
     65     """
     66     from sage.misc.cython import cython
---> 67     mod, dir = cython(name, compile_message=True, use_cache=True)
     68     import sys
     69     sys.path.append(dir)

/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/misc/cython.py in cython(filename, verbose, compile_message, use_cache, create_local_c_file, annotate, sage_namespace, create_local_so_file)
    324             try:
    325                 ext, = cythonize([ext],
--> 326                                  aliases=cython_aliases(),
    327                                  include_path=includes,
    328                                  compiler_directives=directives,

/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/env.py in cython_aliases()
    392     for lib in ['fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular']:
    393         var = lib.upper().replace("-", "") + "_"
--> 394         aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split()
    395         pc = pkgconfig.parse(lib)
    396         # INCDIR should be redundant because the -I options are also

/opt/sagemath-9.0/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py in cflags(package)
    106     If ``pkg-config`` not on path, raises ``EnvironmentError``.
    107     """
--> 108     return _query(package, '--cflags')
    109
    110

/opt/sagemath-9.0/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py in _wrapper(*args, **kwargs)
     60             return func(*args, **kwargs)
     61         except OSError as e:
---> 62             raise EnvironmentError("pkg-config is probably not installed. Could not run pkg-config: %r"%e)
     63     return _wrapper
     64

OSError: pkg-config is probably not installed. Could not run pkg-config: BlockingIOError(11, 'Resource temporarily unavailable')
sage:
edit retag flag offensive close merge delete

Comments

Could you please tell us:

  • which OS ?
  • did you install Sage from the binaries, and which ones ?
  • did you compile Sage yourself ?
tmonteil gravatar imagetmonteil ( 2018-11-04 02:37:27 +0200 )edit

Windows 10. I downloaded the .exe file from the following page: http://www-ftp.lip6.fr/pub/math/sagem...

Sébastien Palcoux gravatar imageSébastien Palcoux ( 2018-11-04 11:38:54 +0200 )edit

Sorry, I have no idea. You might have a virus scanner or something interfering with the newly compiled DLL... Strangely, when I try using %attach on a .pyx or .spyx file on the newly release Sage 8.4 I just get a file not found error, which is also not so good.

Iguananaut gravatar imageIguananaut ( 2018-11-06 10:19:54 +0200 )edit

I've opened an issue about this here: https://github.com/sagemath/sage-wind... The error you're getting could be related as well, even though it's exhibiting in a different way. I'm not 100% sure about that though.

Iguananaut gravatar imageIguananaut ( 2018-11-06 10:27:18 +0200 )edit

@tmonteil The problem is still unfixed.

Sébastien Palcoux gravatar imageSébastien Palcoux ( 2020-01-30 09:54:48 +0200 )edit

@Iguananaut The problem is still unfixed.

Sébastien Palcoux gravatar imageSébastien Palcoux ( 2020-01-30 09:55:54 +0200 )edit

Have you tried 9.0? I believe this problem may be fixed in 9.0.

Iguananaut gravatar imageIguananaut ( 2020-01-31 18:13:54 +0200 )edit

I tried it on 9.0 and it does appear to be fixed. Compiling the spyx module is a little slow--slower than it should be for some reason--but it works.

Iguananaut gravatar imageIguananaut ( 2020-01-31 18:21:37 +0200 )edit

@Iguananaut Following your advice, I just installed the version 9.0, but unfortunatly the problem is (for me) still unfixed.

Sébastien Palcoux gravatar imageSébastien Palcoux ( 2020-02-01 07:58:46 +0200 )edit

Could you please post a piece of sample code which reproduces the problem for you? I can reproduce the problem with 8.9, but not with 9.0.

Iguananaut gravatar imageIguananaut ( 2020-02-03 14:06:15 +0200 )edit