Skip to content

Unable to link to libpython using Intel Python #29255

@kgerheiser

Description

@kgerheiser

Steps to reproduce

Spack uses python -m sysconfig, specifically the values LDLIBRARY and LIBRARY, to query the Python libs for spec['python'].libs.

However, this doesn't work for newer versions of Intel Python on Linux. I went into the build scripts that Intel uses and found that Intel builds Python twice, once with static libraries, and once with shared libraries. The static interpreter is used, but only the shared libraries are installed. This causes Spack to look for libpython3.a, but it doesn't exist.

I get that this is a quirk of how Intel builds their Python distribution, but is there some sort of workaround I could use?

Error message

print(json.dumps(config))
'
==> [2022-02-24-21:53:28.823817] Creating stage lock spack-stage-clingo-bootstrap-spack-ho7bogyy6ccoz5s3tmw7ypuoamazhhpj
==> [2022-02-24-21:53:28.827407] Error: RuntimeError: Unable to locate libpython3.9.a libraries in /apps/oneapi/intelpython/latest/lib

spack/var/spack/repos/builtin/packages/python/package.py:889, in libs:
        886                return LibraryList(os.path.join(macos_developerdir, ldlibrary))
        887            else:
        888                msg = 'Unable to locate {0} libraries in {1}'
  >>    889                raise RuntimeError(msg.format(ldlibrary, libdir))
        890        else:
        891            library = self.config_vars['LIBRARY']
        892

Information on your system

  • Spack: 0.17.1-1372-6eef12cd10
  • Python: 3.9
  • Platform: linux-ubuntu20.04-skylake
  • Concretizer: clingo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageThe issue needs to be prioritized

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions