holgern / pyedflib

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.
http://pyedflib.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
223 stars 124 forks source link

Build fails on FreeBSD: error: implicit declaration of function '_mm512_4fmadd_ps' is invalid in C99 [-Werror,-Wimplicit-function-declaration] #104

Open yurivict opened 3 years ago

yurivict commented 3 years ago

Trying to build pyedflib in the FreeBSD ports framework. It uses setup.py configure and setup.py build.

===>  Configuring for py37-pyEDFlib-0.1.20
WARNING: The pip package is not available, falling back to EasyInstall for handling setup_requires/test_requires; this is deprecated and will be removed in a future version.
Running from numpy source directory.
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/setup.py:485: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
  run_build = parse_setuppy_commands()
Cythonizing sources
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_pcg64.pyx
Processing numpy/random/_bounded_integers.pyx.in
Processing numpy/random/mtrand.pyx
Processing numpy/random/bit_generator.pyx
Processing numpy/random/_common.pyx
Processing numpy/random/_generator.pyx
Processing numpy/random/_mt19937.pyx
Processing numpy/random/_philox.pyx
Processing numpy/random/_sfc64.pyx
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/system_info.py:1989: UserWarning: 
    Optimized (vendor) Blas libraries are not found.
    Falls back to netlib Blas library which has worse performance.
    A better performance should be easily gained by switching
    Blas library.
  if self._calc_info(blas):
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/system_info.py:1989: UserWarning: 
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  if self._calc_info(blas):
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/system_info.py:1989: UserWarning: 
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  if self._calc_info(blas):
non-existing path in 'numpy/distutils': 'site.cfg'
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/system_info.py:1849: UserWarning: 
    Lapack (http://www.netlib.org/lapack/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  return getattr(self, '_calc_info_{}'.format(name))()
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/system_info.py:1849: UserWarning: 
    Lapack (http://www.netlib.org/lapack/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.
  return getattr(self, '_calc_info_{}'.format(name))()
/usr/local/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
gnu: no Fortran 90 compiler found
Could not locate executable cc -shared
Could not locate executable g77
Could not locate executable f77
gnu: no Fortran 90 compiler found
Could not locate executable gfortran
Could not locate executable f95
gnu95: no Fortran 90 compiler found
gnu95: no Fortran 90 compiler found
don't know how to compile Fortran code on platform 'posix'
non-existing path in 'numpy/core': 'build/src.freebsd-12.2-STABLE-amd64-3.7/numpy/core/src/common'
### Warning:  Using unoptimized lapack ###
### Warning:  Using unoptimized lapack ###
no previously-included directories found matching 'doc/build'
no previously-included directories found matching 'doc/source/generated'
no previously-included directories found matching 'benchmarks/env'
no previously-included directories found matching 'benchmarks/results'
no previously-included directories found matching 'benchmarks/html'
no previously-included directories found matching 'benchmarks/numpy'
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.swp' found anywhere in distribution
warning: no previously-included files matching '*.bak' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files found matching 'LICENSES_bundled.txt'
CCompilerOpt.__init__[959] : unable to detect compiler type which leads to treating it as GCC. this is a normal behavior if you're using gcc-like compiler such as MinGW or IBM/XLC.check dist_info:<<
('freebsd-12.2-STABLE-amd64', 'cc', '-Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer')
>>
CCompilerOpt.dist_test[576] : CCompilerOpt._dist_test_spawn[713] : Command (cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -fPIC -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/usr/local/include/python3.7m -Ibuild/src.freebsd-12.2-STABLE-amd64-3.7/numpy/core/src/common -Ibuild/src.freebsd-12.2-STABLE-amd64-3.7/numpy/core/src/npymath -c /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/test_flags.c -o /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/temp/tmpf5o9ls1f/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/test_flags.o -MMD -MF /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/temp/tmpf5o9ls1f/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/test_flags.o.d -mavx5124fmaps -mavx5124vnniw -mavx512vpopcntdq) failed with exit status 1 output -> 
cc: error: unknown argument: '-mavx5124fmaps'
cc: error: unknown argument: '-mavx5124vnniw'

CCompilerOpt.cc_test_flags[1003] : testing failed
CCompilerOpt.dist_test[576] : CCompilerOpt._dist_test_spawn[713] : Command (cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -fPIC -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/usr/local/include/python3.7m -Ibuild/src.freebsd-12.2-STABLE-amd64-3.7/numpy/core/src/common -Ibuild/src.freebsd-12.2-STABLE-amd64-3.7/numpy/core/src/npymath -c /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c -o /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/temp/tmpf5o9ls1f/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.o -MMD -MF /tmp/easy_install-8obb_40k/numpy-1.20.0rc2/temp/tmpf5o9ls1f/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.o.d -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mavx512cd -mavx512er -mavx512pf -Werror) failed with exit status 1 output -> 
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:9:9: error: implicit declaration of function '_mm512_4fmadd_ps' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    b = _mm512_4fmadd_ps(b, b, b, b, b, NULL);
        ^
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:9:9: note: did you mean '_mm512_fmadd_ps'?
/usr/lib/clang/10.0.1/include/avx512fintrin.h:2716:1: note: '_mm512_fmadd_ps' declared here
_mm512_fmadd_ps(__m512 __A, __m512 __B, __m512 __C)
^
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:9:7: error: assigning to '__m512' (vector of 16 'float' values) from incompatible type 'int'
    b = _mm512_4fmadd_ps(b, b, b, b, b, NULL);
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:11:9: error: implicit declaration of function '_mm512_4dpwssd_epi32' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    a = _mm512_4dpwssd_epi32(a, a, a, a, a, NULL);
        ^
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:11:9: note: did you mean '_mm512_dpwssd_epi32'?
/usr/lib/clang/10.0.1/include/avx512vnniintrin.h:68:1: note: '_mm512_dpwssd_epi32' declared here
_mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)
^
/tmp/easy_install-8obb_40k/numpy-1.20.0rc2/numpy/distutils/checks/cpu_avx512_knm.c:11:7: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
    a = _mm512_4dpwssd_epi32(a, a, a, a, a, NULL);
      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

It begins to cythonize numpy for some reason, and fails. Numpy is already installed from a package.

Version 0.1.20 OS: FreeBSD 12.2 Python-3.7 clang-10

skjerns commented 3 years ago

@holgern maybe you know something about this?

holgern commented 3 years ago

Please check https://www.freshports.org/misc/py-pyEDFlib/

Build Build dependencies for Freebsd according to the link above: py37-numpy>=1.16,1<1.20,1 : math/py-numpy@py37 gfortran10 : lang/gcc10 cython-3.7 : lang/cython@py37 py37-setuptools>0 : devel/py-setuptools@py37 python3.7 : lang/python37 gcc10 : lang/gcc10 as : devel/binutils

yurivict commented 3 years ago

Yes, I created this port yesterday.

The problem is that it breaks with clang. Could you please check why is build broken with clang?

skjerns commented 1 year ago

@yurivict does this problem persist?