Skip to content

Building from source fails on Linux systems with pre-installed Intel OpenMP #25603

@adarshyoga

Description

@adarshyoga

Describe the issue linked to the documentation

On systems that have Intel compilers with OpenMP support (like icx and icpc), building scikit-learn from source fails with the following error.

ImportError: libomp.so: cannot open shared object file: No such file or directory

Suggest a potential alternative/fix

Building scikit-learn from source uses -fopenmp to compile with OpenMP. However, Intel compilers require -qopenmp option to compile OpenMP applications. See Intel OpenMP documentation here.

I was able to overcome the build failure by explicitly setting the CPPFLAGS environment variable as below.

export CPPFLAGS="$CPPFLAGS -qopenmp"

The documentation needs to direct users compiling with Intel compilers to set the environment variable before building from source.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions