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

BLD: meson build failure - missing xsimd.hpp #15698

Closed
schettino72 opened this issue Mar 5, 2022 · 18 comments
Closed

BLD: meson build failure - missing xsimd.hpp #15698

schettino72 opened this issue Mar 5, 2022 · 18 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Meson Items related to the introduction of Meson as the new build system for SciPy

Comments

@schettino72
Copy link
Contributor

Describe your issue.

Using environment_meson.yml.
Ubuntu: 20.4
python 3.10
Conda: 4.11.0

Build fails with missing hpp file
python dev.py --build-only

In file included from scipy/stats/_hypotests_pythran.cpp:24:
/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran/pythonic/include/numpy/ceil.hpp:8:10: fatal error: xsimd/xsimd.hpp: No such file or directory
    8 | #include <xsimd/xsimd.hpp>

I noticed the compilation command includes: -I"${CONDA_PREFIX}"/include/python3.10 but the xsimd files are located at ${CONDA_PREFIX}"/include (notice the path on command has an extra python3.10 in path).

Reproducing Code Example

python dev.py --build-only                             (scipy-meson) 
The Meson build system
Version: 0.61.2
Source dir: /home/eduardo/work/scipy/scipy-doit
Build dir: /home/eduardo/work/scipy/scipy-doit/build
Build type: native build
Project name: SciPy
Project version: 1.9.0.dev0
C compiler for the host machine: cc (gcc 9.4.0 "cc (GCC) 9.4.0")
C linker for the host machine: cc ld.bfd 2.36.1
C++ compiler for the host machine: c++ (gcc 9.4.0 "c++ (GCC) 9.4.0")
C++ linker for the host machine: c++ ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-but-set-variable: YES 
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 9.4.0 "GNU Fortran (GCC) 9.4.0")
Fortran linker for the host machine: gfortran ld.bfd 2.36.1
Program cython found: YES (/home/eduardo/miniconda3/envs/scipy-meson/bin/cython)
Program pythran found: YES (/home/eduardo/miniconda3/envs/scipy-meson/bin/pythran)
Program cp found: YES (/usr/bin/cp)
Program python3 found: YES (/home/eduardo/miniconda3/envs/scipy-meson/bin/python3.10)
WARNING: Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.platlibdir" option.
WARNING: Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.purelibdir" option.
Found pkg-config: /home/eduardo/miniconda3/envs/scipy-meson/bin/pkg-config (0.29.2)
Library npymath found: YES
Library npyrandom found: YES
Run-time dependency openblas found: YES 0.3.18
Dependency openblas found: YES 0.3.18 (cached)
Program _build_utils/cythoner.py found: YES (/home/eduardo/miniconda3/envs/scipy-meson/bin/python3.10 /home/eduardo/work/scipy/scipy-doit/scipy/_build_utils/cythoner.py)
Checking for function "open_memstream" : NO 
Configuring messagestream_config.h using configuration
Compiler for C++ supports arguments -fvisibility=hidden: YES 
Checking for size of "void*" : 8
Run-time dependency threads found: YES
Checking for size of "void*" : 8
Dependency threads found: YES unknown (cached)
Compiler for C++ supports arguments -fvisibility=hidden: YES (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
Compiler for C++ supports arguments -Wno-format-truncation: YES 
Compiler for C++ supports arguments -Wno-class-memaccess: YES 
Build targets in project: 196

SciPy 1.9.0.dev0

  User defined options
    prefix: /home/eduardo/work/scipy/scipy-doit/build-install

Error message

Meson build setup OK
ninja: Entering directory `build'
[794/1557] Compiling C++ object scipy/stats/_h....p/meson-generated_..__hypotests_pythran.cpp.o
FAILED: scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o 
c++ -Iscipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/numpy/core/include -I/home/eduardo/miniconda3/envs/scipy-meson/include/python3.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -fPIC -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-int-in-bool-context -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -MD -MQ scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o -MF scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d -o scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o -c scipy/stats/_hypotests_pythran.cpp
In file included from scipy/stats/_hypotests_pythran.cpp:24:
/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran/pythonic/include/numpy/ceil.hpp:8:10: fatal error: xsimd/xsimd.hpp: No such file or directory
    8 | #include <xsimd/xsimd.hpp>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
[803/1557] Compiling C++ object scipy/sparse/s...ls.cpython-310-x86_64-linux-gnu.so.p/bsr.cxx.o
ninja: build stopped: subcommand failed.
Build failed!

SciPy/NumPy/Python version information

(1.9.0.dev0', '1.22.2', sys.version_info(major=3, minor=10, micro=2, releaselevel='final', serial=0)

@schettino72 schettino72 added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Mar 5, 2022
@tupui tupui added the Meson Items related to the introduction of Meson as the new build system for SciPy label Mar 5, 2022
schettino72 added a commit to schettino72/scipy that referenced this issue Mar 12, 2022
@ev-br
Copy link
Member

ev-br commented Mar 12, 2022

Cannot reproduce, also on ubuntu lucid.

$ conda env create -f environment_meson.yml 

# <loooong looong loong installation + why oh why what's going on>

$ conda --version
conda 4.9.2


$ conda activate scipy-meson
$ meson setup build-meson --prefix=$PWD/build-meson
$ meson install -C build-meson

<new terminal window>

$ cd temp
$ conda activate scipy-meson
$ export PYTHONPATH=~/repos/scipy/scipy/build-meson/lib/python3.10/site-packages/
$ pytest --pyargs scipy

<snip>

= 48022 passed, 2638 skipped, 249 xfailed, 13 xpassed, 117 warnings in 933.93s (0:15:33)

For completeness, here's the meson setup log:

$ meson setup build-meson --prefix=$PWD/build-meson
The Meson build system
Version: 0.61.2
Source dir: /home/br/repos/scipy/scipy
Build dir: /home/br/repos/scipy/scipy/build-meson
Build type: native build
Project name: SciPy
Project version: 1.9.0.dev0
C compiler for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-cc (gcc 9.4.0 "x86_64-conda-linux-gnu-cc (GCC) 9.4.0")
C linker for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-cc ld.bfd 2.36.1
C++ compiler for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-c++ (gcc 9.4.0 "x86_64-conda-linux-gnu-c++ (GCC) 9.4.0")
C++ linker for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-c++ ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-but-set-variable: YES 
Library m found: YES
Fortran compiler for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-gfortran (gcc 9.4.0 "GNU Fortran (GCC) 9.4.0")
Fortran linker for the host machine: /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-gfortran ld.bfd 2.36.1
Program cython found: YES (/home/br/miniconda3/envs/scipy-meson/bin/cython)
Program pythran found: YES (/home/br/miniconda3/envs/scipy-meson/bin/pythran)
Program cp found: YES (/usr/bin/cp)
Program python3 found: YES (/home/br/miniconda3/envs/scipy-meson/bin/python3.1)
WARNING: Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.platlibdir" option.
WARNING: Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.purelibdir" option.
Found pkg-config: /home/br/miniconda3/envs/scipy-meson/bin/pkg-config (0.29.2)
Library npymath found: YES
Library npyrandom found: YES
Run-time dependency openblas found: YES 0.3.18
Dependency openblas found: YES 0.3.18 (cached)
Program _build_utils/cythoner.py found: YES (/home/br/miniconda3/envs/scipy-meson/bin/python3.1 /home/br/repos/scipy/scipy/scipy/_build_utils/cythoner.py)
Checking for function "open_memstream" : NO 
Configuring messagestream_config.h using configuration
Compiler for C++ supports arguments -fvisibility=hidden: YES 
Checking for size of "void*" : 8
Run-time dependency threads found: YES
Checking for size of "void*" : 8
Dependency threads found: YES unknown (cached)
Compiler for C++ supports arguments -fvisibility=hidden: YES (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
Compiler for C++ supports arguments -Wno-format-truncation: YES 
Compiler for C++ supports arguments -Wno-class-memaccess: YES 
Build targets in project: 197

SciPy 1.9.0.dev0

  User defined options
    prefix: /home/br/repos/scipy/scipy/build-meson

Found ninja-1.10.2 at /home/br/miniconda3/envs/scipy-meson/bin/ninja

@schettino72
Copy link
Contributor Author

uhmmm.... Thanks for trying to reproduce it.

Could you please check for me where is your "xsimd.hpp" file is located ?

Also:

$ pkg-config --cflags python3        
-I/home/eduardo/miniconda3/envs/scipy-meson/include/python3.10
$ pkg-config --cflags xsimd                                                                                                                                 
-I/home/eduardo/miniconda3/envs/scipy-meson/include
$ conda list | grep pythran                                                                                                                                 
pythran                   0.11.0          py310h7c3ba0c_0    conda-forge
$ echo $SCIPY_USE_PYTHRAN

@ev-br
Copy link
Member

ev-br commented Mar 12, 2022

(scipy-meson) br@gonzales:~/repos/scipy/scipy$ pkg-config --cflags python3  
-I/home/br/miniconda3/envs/scipy-meson/include/python3.10
(scipy-meson) br@gonzales:~/repos/scipy/scipy$ pkg-config --cflags xsimd 
-I/home/br/miniconda3/envs/scipy-meson/include
(scipy-meson) br@gonzales:~/repos/scipy/scipy$  echo $SCIPY_USE_PYTHRAN

and

(scipy-meson) br@gonzales:~/repos/scipy/scipy$ ll "$CONDA_PREFIX"/include/xsimd |grep xsimd*
-rw-rw-r--  2 br br  1379 дек  8 19:26 xsimd.hpp
(scipy-meson) br@gonzales:~/repos/scipy/scipy$ ll "$CONDA_PREFIX"/python3.10/include/xsimd |grep xsimd*
ls: cannot access '/home/br/miniconda3/envs/scipy-meson/python3.10/include/xsimd': No such file or directory

@eli-schwartz
Copy link
Contributor

Typically <prefix>/include is baked into the compiler itself for any given prefix as a default include directory. What's the output of:

/home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-c++ -v -E - </dev/null

with particular reference to:

#include "..." search starts here:
#include <...> search starts here:
          # <<<< right here is the interesting stuff
End of search list.

@ev-br
Copy link
Member

ev-br commented Mar 13, 2022

$ /home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-c++ -v -E - </dev/null
Reading specs from /home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/specs
COLLECT_GCC=/home/br/miniconda3/envs/scipy-meson/bin/x86_64-conda-linux-gnu-c++
Target: x86_64-conda-linux-gnu
Configured with: ../configure --prefix=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho --with-slibdir=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib --libdir=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib --build=x86_64-conda-linux-gnu --host=x86_64-conda-linux-gnu --target=x86_64-conda-linux-gnu --enable-default-pie --enable-languages=c,c++,fortran,objc,obj-c++ --enable-__cxa_atexit --disable-libmudflap --enable-libgomp --disable-libssp --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer --enable-lto --enable-threads=posix --enable-target-optspace --enable-plugin --enable-gold --disable-nls --disable-bootstrap --disable-multilib --enable-long-long --enable-default-pie --with-sysroot=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/x86_64-conda-linux-gnu/sysroot --with-build-sysroot=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_build_env/x86_64-conda-linux-gnu/sysroot --with-gxx-include-dir=/home/conda/feedstock_root/build_artifacts/gcc_compilers_1646270363722/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/x86_64-conda-linux-gnu/include/c++/9.4.0
Thread model: posix
gcc version 9.4.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/br/miniconda3/envs/scipy-meson/bin/../libexec/gcc/x86_64-conda-linux-gnu/9.4.0/cc1 -E -quiet -v -iprefix /home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/ -isysroot /home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot - -mtune=generic -march=x86-64
ignoring duplicate directory "/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/../../lib/gcc/x86_64-conda-linux-gnu/9.4.0/include"
ignoring nonexistent directory "/home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/usr/local/include"
ignoring duplicate directory "/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/../../lib/gcc/x86_64-conda-linux-gnu/9.4.0/include-fixed"
ignoring duplicate directory "/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/../../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/include
 /home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/include-fixed
 /home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/include
 /home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/home/br/miniconda3/envs/scipy-meson/bin/../libexec/gcc/x86_64-conda-linux-gnu/9.4.0/:/home/br/miniconda3/envs/scipy-meson/bin/../libexec/gcc/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/bin/
LIBRARY_PATH=/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/lib/../lib/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../lib/:/home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/lib/../lib/:/home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../../x86_64-conda-linux-gnu/lib/:/home/br/miniconda3/envs/scipy-meson/bin/../lib/gcc/x86_64-conda-linux-gnu/9.4.0/../../../:/home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/lib/:/home/br/miniconda3/envs/scipy-meson/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

For completeness, a system analog, without conda --- which, I believe, is used in pip builds:

$ x86_64-linux-gnu-g++ -v -E - </dev/null
Using built-in specs.
COLLECT_GCC=x86_64-linux-gnu-g++
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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-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 --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --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-9-yTrUTS/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04) 
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -E -quiet -v -imultiarch x86_64-linux-gnu - -mtune=generic -march=x86-64 -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/9/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "<stdin>"
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

schettino72 added a commit to schettino72/scipy that referenced this issue Mar 13, 2022
@schettino72
Copy link
Contributor Author

If you look at ninja.build you can see exactly what compiler command was used.
On my local machine:

build with pip env

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o: cpp_COMPILER scipy/stats/_hypotests_pythran.cpp
 DEPFILE = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 DEPFILE_UNQUOTED = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 ARGS = -Iscipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I/home/eduardo/.virtualenvs/scipy310/lib/python3.10/site-packages/pythran -I/home/eduardo/.virtualenvs/scipy310/lib/python3.10/site-packages/numpy/core/include -I/usr/include/python3.10 -I/usr/include/x86_64-linux-gnu/python3.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -fPIC -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-int-in-bool-context -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE

build with conda (without patch)

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o: cpp_COMPILER scipy/stats/_hypotests_pythran.cpp
 DEPFILE = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 DEPFILE_UNQUOTED = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 ARGS = -Iscipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/numpy/core/include -I/home/eduardo/miniconda3/envs/scipy-meson/include/python3.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -fPIC -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-int-in-bool-context -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE

build with conda (with patch)

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o: cpp_COMPILER scipy/stats/_hypotests_pythran.cpp
 DEPFILE = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 DEPFILE_UNQUOTED = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 ARGS = -Iscipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran -I/home/eduardo/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/numpy/core/include -I/home/eduardo/miniconda3/envs/scipy-meson/include/python3.10 -I/home/eduardo/miniconda3/envs/scipy-meson/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -fPIC -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-int-in-bool-context -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE

Still not clear to me which xsimd.hpp file is being found for you without a patch.
But I guess my patch is in worth case harmless...

@eli-schwartz
Copy link
Contributor

eli-schwartz commented Mar 13, 2022

@ev-br your default paths have /home/br/miniconda3/envs/scipy-meson/x86_64-conda-linux-gnu/include but not /home/br/miniconda3/envs/scipy-meson/include so xsimd's pkg-config location is definitely not being picked up.

pythran does by default ship with bundled code copies of xsimd, which are probably stripped out by Linux distros at a minimum.

It's also stripped out by the pythran-feedstock in conda, with the following comment:

# unvendor xsimd; use version packaged by conda-forge

TBH I do not know why it ever works for you at all given this combination, unless you using a conda env, but installing a non-conda pythran?

@ev-br
Copy link
Member

ev-br commented Mar 13, 2022

Does not look like I've pythran outside of the conda env:

(scipy-meson) br@gonzales:~/repos/scipy$ pythran     # outside of the conda env
pythran: command not found
br@gonzales:~/repos/scipy$ conda activate scipy-meson
(scipy-meson) br@gonzales:~/repos/scipy$ pythran --version
0.11.0
(scipy-meson) br@gonzales:~/repos/scipy$ which pythran
/home/br/miniconda3/envs/scipy-meson/bin/pythran

I definitely did not install pythran outside of some virtualenvironment. I very well might have it in some of them (heck, the main scipy-dev does have it for sure; it's a different python version but hey) but that's about it. Whether it might get picked up or not, I have no idea. If some other diagnostics I can run on this machine, let me know. Other than that, I can only shrug :-).

@eli-schwartz
Copy link
Contributor

Does the pythran directory in site-packages (inside the conda env) have an xsimd directory?

@ev-br
Copy link
Member

ev-br commented Mar 13, 2022

No it doesn't seem to.

(scipy-meson) br@gonzales:~/repos/scipy$ ll /home/br/miniconda3/envs/scipy-meson/include/ |grep xsimd
drwxrwxr-x  8 br br   4096 мар 12 14:45 xsimd/
(scipy-meson) br@gonzales:~/repos/scipy$ ll /home/br/miniconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran/ |grep xsimd
(scipy-meson) br@gonzales:~/repos/scipy$

@eli-schwartz
Copy link
Contributor

Alrighty so you have the conda pythran and it doesn't have a bundled code copy of xsimd, which matches my expectation.

That then makes the question of "so just where does your conda env pick up the xsimd headers from" very confusing. It's not the location reported by pkg-config --cflags xsimd because that location is not either in the compiler defaults or in the build.ninja generated command line.

Seems to be quite the mystery!

@rgommers
Copy link
Member

I cannot reproduce this on Arch Linux with a fresh scipy-meson env.

Location of xsimd:

$ locate xsimd.hpp
...
/home/rgommers/anaconda3/envs/scipy-meson/include/xsimd/xsimd.hpp
$ pkg-config --cflags xsimd
-I/home/rgommers/anaconda3/envs/scipy-meson/include

The reason xsimd.hpp is found is this flag in the compile args:

-isystem /home/rgommers/anaconda3/envs/scipy-meson/include

Full output for _hypotests_pythran extension:

build scipy/stats/_hypotests_pythran.cpp: CUSTOM_COMMAND ../scipy/stats/_hypotests_pythran.py | /home/rgommers/anaconda3/envs/scipy-meson/bin/pythran
 COMMAND = /home/rgommers/anaconda3/envs/scipy-meson/bin/pythran -E ../scipy/stats/_hypotests_pythran.py -o scipy/stats/_hypotests_pythran.cpp
 description = Generating$ scipy/stats/_hypotests_pythran$ with$ a$ custom$ command

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o: cpp_COMPILER scipy/stats/_hypotests_pythran.cpp
 DEPFILE = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 DEPFILE_UNQUOTED = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o.d
 ARGS = -Iscipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.10/site-packages/pythran -I/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.10/site-packages/numpy/core/include -I/home/rgommers/anaconda3/envs/scipy-meson/include/python3.10 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O2 -g -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/rgommers/anaconda3/envs/scipy-meson/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/rgommers/anaconda3/envs/scipy-meson/include -fPIC -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-int-in-bool-context -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.symbols: SHSYM scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so
 IMPLIB = scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so

build scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so: cpp_LINKER scipy/stats/_hypotests_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__hypotests_pythran.cpp.o
 LINK_ARGS = -L/home/rgommers/anaconda3/envs/scipy-meson/lib -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/home/rgommers/anaconda3/envs/scipy-meson/lib -Wl,-rpath-link,/home/rgommers/anaconda3/envs/scipy-meson/lib -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/rgommers/anaconda3/envs/scipy-meson/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/rgommers/anaconda3/envs/scipy-meson/include

Output of conda list:

$ conda list
# packages in environment at /home/rgommers/anaconda3/envs/scipy-meson:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
asv                       0.4.2           py310h122e73d_3    conda-forge
attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
beniget                   0.4.1              pyhd8ed1ab_0    conda-forge
binutils                  2.36.1               hdd6e379_2    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
binutils_linux-64         2.36                 hf3e587d_7    conda-forge
brotli                    1.0.9                h7f98852_6    conda-forge
brotli-bin                1.0.9                h7f98852_6    conda-forge
brotlipy                  0.7.0           py310h6acc77f_1003    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-compiler                1.3.0                h7f98852_0    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8       py310hff52083_1    conda-forge
cffi                      1.15.0          py310h0fdd8cc_0    conda-forge
chardet                   4.0.0           py310hff52083_2    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
compilers                 1.3.0                ha770c72_0    conda-forge
conda                     4.11.0          py310hff52083_2    conda-forge
conda-build               3.21.8          py310hff52083_0    conda-forge
conda-package-handling    1.8.0           py310h5764c6d_0    conda-forge
coverage                  6.3.2           py310h5764c6d_1    conda-forge
cryptography              36.0.1          py310h685ca39_0    conda-forge
cxx-compiler              1.3.0                h4bd325d_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    0.29.28         py310h122e73d_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
docutils                  0.17.1          py310hff52083_1    conda-forge
execnet                   1.9.0              pyhd8ed1ab_0    conda-forge
executing                 0.8.3              pyhd8ed1ab_0    conda-forge
expat                     2.4.7                h27087fc_0    conda-forge
filelock                  3.6.0              pyhd8ed1ab_0    conda-forge
flake8                    4.0.1              pyhd8ed1ab_2    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.96              h8e229c2_2    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.30.0          py310h5764c6d_0    conda-forge
fortran-compiler          1.3.0                h1990efc_0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gast                      0.5.3              pyhd8ed1ab_0    conda-forge
gcc                       9.4.0                h192d537_7    conda-forge
gcc_impl_linux-64         9.4.0               h03d3576_14    conda-forge
gcc_linux-64              9.4.0                h391b98a_7    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
gfortran                  9.4.0                h2018a41_7    conda-forge
gfortran_impl_linux-64    9.4.0               h0003116_14    conda-forge
gfortran_linux-64         9.4.0                hf0ab688_7    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
glob2                     0.7                        py_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gmpy2                     2.1.2           py310h92f7908_0    conda-forge
gst-plugins-base          1.18.5               hf529b03_3    conda-forge
gstreamer                 1.18.5               h9f60fe5_3    conda-forge
gxx                       9.4.0                h192d537_7    conda-forge
gxx_impl_linux-64         9.4.0               h03d3576_14    conda-forge
gxx_linux-64              9.4.0                h0316aca_7    conda-forge
icu                       69.1                 h9c3ff4c_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
imagesize                 1.3.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.3          py310hff52083_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
ipython                   8.1.1           py310hff52083_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.18.1          py310hff52083_0    conda-forge
jinja2                    3.0.3              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h7f98852_0    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_15    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.0           py310hbf28c38_0    conda-forge
krb5                      1.19.3               h3790be6_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libarchive                3.5.2                hccf745f_1    conda-forge
libblas                   3.9.0           13_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h7f98852_6    conda-forge
libbrotlidec              1.0.9                h7f98852_6    conda-forge
libbrotlienc              1.0.9                h7f98852_6    conda-forge
libcblas                  3.9.0           13_linux64_openblas    conda-forge
libclang                  13.0.1          default_hc23dcda_0    conda-forge
libdeflate                1.10                 h7f98852_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libevent                  2.1.10               h9b69904_4    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-devel_linux-64     9.4.0               hd854feb_14    conda-forge
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
libgfortran-ng            11.2.0              h69a702a_14    conda-forge
libgfortran5              11.2.0              h5c6108e_14    conda-forge
libglib                   2.70.2               h174f98d_4    conda-forge
libgomp                   11.2.0              h1d223b6_14    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           13_linux64_openblas    conda-forge
liblief                   0.11.5               h9c3ff4c_1    conda-forge
libllvm13                 13.0.1               hf817b99_2    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.18          pthreads_h8fe5266_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     14.2                 hd57d9b9_0    conda-forge
libsanitizer              9.4.0               h79bfe98_14    conda-forge
libstdcxx-devel_linux-64  9.4.0               hd854feb_14    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
libtiff                   4.3.0                h542a066_3    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp                   1.2.2                h3452ae3_0    conda-forge
libwebp-base              1.2.2                h7f98852_1    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h885dcf4_1    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
markupsafe                2.1.0           py310h5764c6d_1    conda-forge
matplotlib                3.5.1           py310hff52083_0    conda-forge
matplotlib-base           3.5.1           py310h23f4a51_0    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
meson                     0.61.3             pyhd8ed1ab_0    conda-forge
mpc                       1.2.1                h9f54685_0    conda-forge
mpfr                      4.1.0                h9202a9a_1    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy                      0.940           py310h5764c6d_0    conda-forge
mypy_extensions           0.4.3           py310hff52083_4    conda-forge
mysql-common              8.0.28               ha770c72_0    conda-forge
mysql-libs                8.0.28               hfa10184_0    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
ninja                     1.10.2               h4bd325d_1    conda-forge
nspr                      4.32                 h9c3ff4c_1    conda-forge
nss                       3.74                 hb5efdd6_0    conda-forge
numpy                     1.22.3          py310h45f3432_0    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
openblas                  0.3.18          pthreads_h4748800_0    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
patchelf                  0.14.5               h58526e2_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.0.1           py310he619898_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
pkginfo                   1.8.2              pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0           py310hff52083_2    conda-forge
ply                       3.11                       py_1    conda-forge
prompt-toolkit            3.0.27             pyha770c72_0    conda-forge
psutil                    5.9.0           py310h6acc77f_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py                        1.11.0             pyh6c4a22f_0    conda-forge
py-lief                   0.11.5          py310h122e73d_1    conda-forge
pybind11                  2.9.1           py310h91b1402_0    conda-forge
pybind11-global           2.9.1           py310h91b1402_0    conda-forge
pycodestyle               2.8.0              pyhd8ed1ab_0    conda-forge
pycosat                   0.6.3           py310h6acc77f_1009    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydata-sphinx-theme       0.8.0              pyhd8ed1ab_0    conda-forge
pyflakes                  2.4.0              pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.7              pyhd8ed1ab_0    conda-forge
pyqt                      5.12.3          py310hff52083_8    conda-forge
pyqt-impl                 5.12.3          py310h1f8e252_8    conda-forge
pyqt5-sip                 4.19.18         py310h122e73d_8    conda-forge
pyqtchart                 5.12            py310hfcd6d55_8    conda-forge
pyqtwebengine             5.12.1          py310hfcd6d55_8    conda-forge
pysocks                   1.7.1           py310hff52083_4    conda-forge
pytest                    7.1.0           py310hff52083_0    conda-forge
pytest-cov                3.0.0              pyhd8ed1ab_0    conda-forge
pytest-forked             1.4.0              pyhd8ed1ab_0    conda-forge
pytest-xdist              2.5.0              pyhd8ed1ab_0    conda-forge
python                    3.10.2          h85951f9_4_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-libarchive-c       4.0             py310hff52083_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pythran                   0.11.0          py310h7c3ba0c_0    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310h6acc77f_3    conda-forge
qt                        5.12.9               ha98a1a1_5    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
ripgrep                   13.0.0               h2f28480_2    conda-forge
ruamel_yaml               0.15.80         py310h6acc77f_1006    conda-forge
setuptools                59.8.0          py310hff52083_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
sphinx                    4.4.0              pyh6c4a22f_1    conda-forge
sphinx-panels             0.6.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_1    conda-forge
sqlite                    3.37.0               h9cd32fc_0    conda-forge
stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
sysroot_linux-64          2.12                he073ed8_15    conda-forge
threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.1             py310h6acc77f_2    conda-forge
tqdm                      4.63.0             pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
unicodedata2              14.0.0          py310h6acc77f_0    conda-forge
urllib3                   1.26.8             pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xsimd                     8.0.5                h4bd325d_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zipp                      3.7.0              pyhd8ed1ab_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.2                ha95c52a_0    conda-forge

The difference in ARGS list of compile flags between what @schettino72 is seeing in his "without patch" comment above and what I'm seeing is:

-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/rgommers/anaconda3/envs/scipy-meson/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/rgommers/anaconda3/envs/scipy-meson/include -fPIC

Some of these flags are repeated twice, also I have -std=c++14 (which is the default in SciPy's meson.build) followed by -std=c++17 - that is coming from conda's compiler activation:

So my hypothesis is something going awry with compiler/environment activation. From https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/main/recipe/activate-g%2B%2B.sh#L91, we get flags:

CXXFLAGS_USED="@CXXFLAGS@ -isystem ${CONDA_PREFIX}/include"

CXXFLAGS and CONDA_PREFIX are set during environment activation:

$ echo $CONDA_PREFIX
/home/rgommers/anaconda3/envs/scipy-meson
$ echo $CXXFLAGS
-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/rgommers/anaconda3/envs/scipy-meson/include

$ conda deactivate
(base) rgommers@machine:~/code/scipy (main)$ echo $CXXFLAGS

(base) rgommers@machine:~/code/scipy (main)$ echo $CONDA_PREFIX
/home/rgommers/anaconda3

$ conda --version
conda 4.11.0

@schettino72 is it possible you built without activating your environment, or doing so in a nonstandard way? Can you check CXXFLAGS and CONDA_PREFIX env vars?

@rgommers
Copy link
Member

This is always a bit of a hunt, but these variables are defined within the environment:

$ cat envs/scipy-meson/etc/conda/activate.d/activate-gcc_linux-64.sh  | grep CPPFLAGS
  CPPFLAGS_USED="-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem ${PREFIX}/include"
  DEBUG_CPPFLAGS_USED="-D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem ${PREFIX}/include"
  CPPFLAGS_USED="-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem ${CONDA_PREFIX}/include"
  DEBUG_CPPFLAGS_USED="-D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem ${CONDA_PREFIX}/include"
  "CPPFLAGS,${CPPFLAGS_USED} ${CPPFLAGS:-}" \
  "DEBUG_CPPFLAGS,${DEBUG_CPPFLAGS_USED} ${DEBUG_CPPFLAGS:-}" \

@schettino72
Copy link
Contributor Author

Thanks. So the problem is a missing CXXFLAGS on my env.

I did activate my conda env but I was using FISH shell. It works ok when I use BASH.
Checking the conda issue tracker I can see a few known issues related to these activation scripts on FISH.

conda/conda#6820
conda/conda#7993
conda/conda-build#4012

I will try to dig a bit or just use BASH.

@rgommers
Copy link
Member

Ah, that explains it, thanks. Would be great if that made it from "backlog" to "fixed".

@akhmerov
Copy link
Contributor

@schettino72 I've just encountered the same issue. Did you manage to find a workaround allowing to automatically correctly set CXXFLAGS in fish?

@schettino72
Copy link
Contributor Author

@akhmerov
No. I just used bash. My previous comment here has links to issues on conda dealing with this issue.

@rgommers
Copy link
Member

rgommers commented May 9, 2023

This turned out to be a problem with conda on Windows for several folks as well. It's a conda bug with compiler activation, as discussed above - but gh-18439, which is now merged into main, works around that problem. So fingers crossed this will not happen again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Meson Items related to the introduction of Meson as the new build system for SciPy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants