Skip to content

Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.10.13") #327

@kevinsmia1939

Description

@kevinsmia1939

Hi,

I am trying to build spglib 2.1.0 for Flatpak on openSUSE Tumbleweed Linux.
I got this error below. I simply think that it cannot find Numpy, so I include both paths.
I test one of them at a time, but none work.

numpy-1.26.0

      - -DPython3_NumPy_INCLUDE_DIRS=/app/lib/python3.10/site-packages/numpy/core/include/numpy
      - -DPython3_NumPy_INCLUDE_DIRS=/usr/include/python3.10
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The Fortran compiler identification is GNU 12.2.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Spglib:: Build type: Release
CMake Error at /usr/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found
  version "3.10.13")
Call Stack (most recent call first):
  /usr/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.27/Modules/FindPython/Support.cmake:3824 (find_package_handle_standard_args)
  /usr/share/cmake-3.27/Modules/FindPython3.cmake:545 (include)
  CMakeLists.txt:138 (find_package)


-- Configuring incomplete, errors occurred!

I use the cmake options below.

      - -DSPGLIB_WITH_Fortran=ON
      - -DSPGLIB_WITH_Python=ON
      - -DSPGLIB_USE_OMP=OFF
      - -DSPGLIB_WITH_TESTS=OFF
      - -DSPGLIB_SHARED_LIBS=ON
      - -DSPGLIB_INSTALL=ON
      - -DSPGLIB_TEST_COVERAGE=OFF
      - -DPython3_NumPy_INCLUDE_DIRS=/app/lib/python3.10/site-packages/numpy/core/include/numpy (tried one at a time)
      - -DPython3_NumPy_INCLUDE_DIRS=/usr/include/python3.10 (tried one at a time)
      - -DCMAKE_VERBOSE_MAKEFILE=ON 

To be sure that Numpy and Python exist, here is the file list.

      - ls -l /app/lib/python3.10/site-packages/numpy/core/include/numpy
      - ls -l /usr/include | grep "python"

Running: ls -l /app/lib/python3.10/site-packages/numpy/core/include/numpy
total 380
-rw-r--r-- 2 kevin kevin   282 Jan  1  1970 arrayobject.h
-rw-r--r-- 2 kevin kevin  3944 Jan  1  1970 arrayscalars.h
-rw-r--r-- 2 kevin kevin 16697 Jan  1  1970 _dtype_api.h
-rw-r--r-- 2 kevin kevin 15532 Jan  1  1970 experimental_dtype_api.h
-rw-r--r-- 2 kevin kevin  1959 Jan  1  1970 halffloat.h
-rw-r--r-- 2 kevin kevin 12116 Jan  1  1970 __multiarray_api.c
-rw-r--r-- 2 kevin kevin 61519 Jan  1  1970 __multiarray_api.h
-rw-r--r-- 2 kevin kevin 10183 Jan  1  1970 ndarrayobject.h
-rw-r--r-- 2 kevin kevin 68009 Jan  1  1970 ndarraytypes.h
-rw-r--r-- 2 kevin kevin  1857 Jan  1  1970 _neighborhood_iterator_imp.h
-rw-r--r-- 2 kevin kevin  6830 Jan  1  1970 noprefix.h
-rw-r--r-- 2 kevin kevin  4327 Jan  1  1970 npy_1_7_deprecated_api.h
-rw-r--r-- 2 kevin kevin 15883 Jan  1  1970 npy_3kcompat.h
-rw-r--r-- 2 kevin kevin 37688 Jan  1  1970 npy_common.h
-rw-r--r-- 2 kevin kevin  4629 Jan  1  1970 npy_cpu.h
-rw-r--r-- 2 kevin kevin  2786 Jan  1  1970 npy_endian.h
-rw-r--r-- 2 kevin kevin  1948 Jan  1  1970 npy_interrupt.h
-rw-r--r-- 2 kevin kevin 18945 Jan  1  1970 npy_math.h
-rw-r--r-- 2 kevin kevin   678 Jan  1  1970 npy_no_deprecated_api.h
-rw-r--r-- 2 kevin kevin  1120 Jan  1  1970 npy_os.h
-rw-r--r-- 2 kevin kevin   855 Jan  1  1970 _numpyconfig.h
-rw-r--r-- 2 kevin kevin  5308 Jan  1  1970 numpyconfig.h
-rw-r--r-- 2 kevin kevin  6405 Jan  1  1970 old_defines.h
drwxr-xr-x 1 kevin kevin    90 Jan  1  1970 random
-rw-r--r-- 2 kevin kevin  1714 Jan  1  1970 __ufunc_api.c
-rw-r--r-- 2 kevin kevin 12456 Jan  1  1970 __ufunc_api.h
-rw-r--r-- 2 kevin kevin 12070 Jan  1  1970 ufuncobject.h
-rw-r--r-- 2 kevin kevin  1185 Jan  1  1970 utils.h
Running: ls -l /usr/include | grep "python"
drwxr-xr-x 1 kevin kevin   1878 Jan  1  1970 python3.10

Use -DSPGLIB_WITH_Python=OFF will compile without issue.
Let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions