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

Installation of sage_numerical_backends_gurobi package stalls #38268

Closed
2 tasks done
maxale opened this issue Jun 24, 2024 · 5 comments · Fixed by #38319
Closed
2 tasks done

Installation of sage_numerical_backends_gurobi package stalls #38268

maxale opened this issue Jun 24, 2024 · 5 comments · Fixed by #38319

Comments

@maxale
Copy link
Contributor

maxale commented Jun 24, 2024

Environment

- **OS**: Ubuntu 22.04.4 LTS
- **Sage Version**: 10.4.rc0

Steps To Reproduce

sage -i sage_numerical_backends_gurobi stalls with the following output:

[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Installing sage_numerical_backends_gurobi-9.3.1
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] * Creating isolated environment: venv+pip...
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] * Installing packages in isolated environment:
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   - setuptools >= 40.8.0
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] * Getting build dependencies for wheel...
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Traceback (most recent call last):
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/usr/local/sage/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     main()
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/usr/local/sage/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     json_out['return_val'] = hook(**hook_input['kwargs'])
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/usr/local/sage/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     return hook(config_settings)
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/tmp/build-env-30_u25t2/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     return self._get_build_requires(config_settings, requirements=['wheel'])
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/tmp/build-env-30_u25t2/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     self.run_setup()
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/tmp/build-env-30_u25t2/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     super().run_setup(setup_script=setup_script)
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "/tmp/build-env-30_u25t2/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]     exec(code, locals())
[sage_numerical_backends_gurobi-9.3.1] [spkg-install]   File "<string>", line 12, in <module>
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] ModuleNotFoundError: No module named 'Cython'
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] 
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Warning: building with "python3 -m build --wheel --outdir=dist   ." failed.
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Retrying with "python3 -m build --wheel --outdir=dist --no-isolation --skip-dependency-check  .".
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] * Building wheel...
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Python 3.11.4 (main, Dec  5 2023, 11:48:11) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
[sage_numerical_backends_gurobi-9.3.1] [spkg-install] Type "help", "copyright", "credits" or "license" for more information.

Config log

.

Package logs

No response

Additional Information

No response

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 2, 2024

Please try with #38319

@mkoeppe mkoeppe added this to the sage-10.4 milestone Jul 2, 2024
@maxale
Copy link
Contributor Author

maxale commented Jul 10, 2024

@mkoeppe with that PR installation of sage_numerical_backends_gurobi does not complain about missing Cython, but it still stalls (looks like it enters Python's console / interactive mode and stuck there):

make --no-print-directory sage_numerical_backends_gurobi-SAGE_VENV-no-deps
[sage_numerical_backends_gurobi-10.4] Using cached file /usr/local/sage/sage/upstream/sage_numerical_backends_gurobi-10.4.tar.gz
[sage_numerical_backends_gurobi-10.4] Setting up build directory /usr/local/sage/sage/local/var/lib/sage/venv-python3.10/var/tmp/sage/build/sage_numerical_backends_gurobi-10.4
[sage_numerical_backends_gurobi-10.4] No patch files found in ../patches
[sage_numerical_backends_gurobi-10.4] Host system: Linux nutcracker 5.15.0-86-generic #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[sage_numerical_backends_gurobi-10.4] C compiler: gcc, Using built-in specs., COLLECT_GCC=gcc, COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper, OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa, OFFLOAD_TARGET_DEFAULT=1, Target: x86_64-linux-gnu, Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2, Thread model: posix, Supported LTO compression algorithms: zlib zstd, gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
[sage_numerical_backends_gurobi-10.4] No stamp file for package 'sage_numerical_backends_gurobi' in /usr/local/sage/sage/local/var/lib/sage/venv-python3.10/var/lib/sage/installed
[sage_numerical_backends_gurobi-10.4] No spkg-legacy-uninstall script; nothing to do
[sage_numerical_backends_gurobi-10.4] [spkg-install] Installing sage_numerical_backends_gurobi-10.4
[sage_numerical_backends_gurobi-10.4] [spkg-install] * Building wheel...
[sage_numerical_backends_gurobi-10.4] [spkg-install] Python 3.7.14 (default, Sep 15 2022, 10:56:34) 
[sage_numerical_backends_gurobi-10.4] [spkg-install] [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
[sage_numerical_backends_gurobi-10.4] [spkg-install] Type "help", "copyright", "credits" or "license" for more information.

@maxale
Copy link
Contributor Author

maxale commented Jul 10, 2024

I've just discovered that the issue is caused by the missing GUROBI_HOME environment variable. As soon as it set and #38319 is applied, the installation of sage_numerical_backends_gurobi goes without an issue.

I think Sage should report an error if GUROBI_HOME is not set.

@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 12, 2024

@maxale Actually the installation script tries to use gurobi.sh to determine the directory when GUROBI_HOME is not set. I just checked with the latest Gurobi on macOS, and this works as designed.
Which version of Gurobi are you trying to use, what does your gurobi.sh look like, and what happens if you do . gurobi.sh -c "" on your machine?

@maxale
Copy link
Contributor Author

maxale commented Jul 12, 2024

My gurobi.sh has a symlink in /usr/local/bin/ and it has an added line setting up GUROBI_HOME inside it:

GUROBI_HOME="/usr/local/gurobi1101/linux64";export GUROBI_HOME

When I run it from shell, it tells me:

Python 3.7.14 (default, Sep 15 2022, 10:56:34) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.

which matches what I see in the sage_numerical_backends_gurobi log.

The command gurobi.sh -c "" does nothing.

@vbraun vbraun closed this as completed in 9d1f7f2 Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants