dfm / nufft-ls

Benchmarking LS periodogram implementations
Apache License 2.0
4 stars 0 forks source link

py install problem #7

Closed ahbarnett closed 2 years ago

ahbarnett commented 2 years ago

I'm not a py expert but this fails for me on a fresh conda env. Some pybind11 issue w/ gcc (I have gcc 10 in pop!os21.04):

Here goes (after I did conda update conda, I needed to update beyond my old 3.7):

(base) alex@ross /home/alex/physics/nufft-ls> conda create -n py310 python=3.10
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/alex/miniconda3/envs/py310

  added / updated specs:
    - python=3.10

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    bzip2-1.0.8                |       hb9a14ef_9         109 KB  intel
    certifi-2020.6.20          |     pyhd3eb1b0_3         155 KB
    libuuid-1.0.3              |       h7f8727e_2          17 KB
    ncurses-6.3                |       h7f8727e_2         782 KB
    pip-21.2.4                 |  py310h06a4308_0         1.8 MB
    python-3.10.0              |       h12debd9_4        23.5 MB
    readline-8.1.2             |       h7f8727e_1         354 KB
    setuptools-58.0.4          |  py310h06a4308_0         782 KB
    tk-8.6.11                  |       h1ccaba5_0         3.0 MB
    wheel-0.37.0               |     pyhd3eb1b0_1          31 KB  intel
    ------------------------------------------------------------
                                           Total:        30.6 MB

The following NEW packages will be INSTALLED:

  bzip2              intel/linux-64::bzip2-1.0.8-hb9a14ef_9
  ca-certificates    intel/linux-64::ca-certificates-2021.10.26-h06a4308_2
  certifi            pkgs/main/noarch::certifi-2020.6.20-pyhd3eb1b0_3
  intelpython        intel/linux-64::intelpython-2022.0.0-0
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.35.1-h7274673_9
  libffi             intel/linux-64::libffi-3.3-14
  libgcc-ng          intel/linux-64::libgcc-ng-9.3.0-hdf63c60_101
  libuuid            pkgs/main/linux-64::libuuid-1.0.3-h7f8727e_2
  ncurses            pkgs/main/linux-64::ncurses-6.3-h7f8727e_2
  openssl            intel/linux-64::openssl-1.1.1l-h7f8727e_0
  pip                pkgs/main/linux-64::pip-21.2.4-py310h06a4308_0
  python             pkgs/main/linux-64::python-3.10.0-h12debd9_4
  readline           pkgs/main/linux-64::readline-8.1.2-h7f8727e_1
  setuptools         pkgs/main/linux-64::setuptools-58.0.4-py310h06a4308_0
  sqlite             intel/linux-64::sqlite-3.36.0-hb9a14ef_3
  tk                 pkgs/main/linux-64::tk-8.6.11-h1ccaba5_0
  tzdata             pkgs/main/noarch::tzdata-2021e-hda174b7_0
  wheel              intel/noarch::wheel-0.37.0-pyhd3eb1b0_1
  xz                 intel/linux-64::xz-5.2.5-h74280d8_2
  zlib               intel/linux-64::zlib-1.2.11.1-h1e99aa7_5

Proceed ([y]/n)? y

Downloading and Extracting Packages
readline-8.1.2       | 354 KB    | ##################################### | 100% 
libuuid-1.0.3        | 17 KB     | ##################################### | 100% 
python-3.10.0        | 23.5 MB   | ##################################### | 100% 
wheel-0.37.0         | 31 KB     | ##################################### | 100% 
ncurses-6.3          | 782 KB    | ##################################### | 100% 
tk-8.6.11            | 3.0 MB    | ##################################### | 100% 
certifi-2020.6.20    | 155 KB    | ##################################### | 100% 
setuptools-58.0.4    | 782 KB    | ##################################### | 100% 
bzip2-1.0.8          | 109 KB    | ##################################### | 100% 
pip-21.2.4           | 1.8 MB    | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate py310
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) alex@ross /home/alex/physics/nufft-ls> conda activate py310
(py310) alex@ross /home/alex/physics/nufft-ls> pip install -e .
Obtaining file:///home/alex/physics/nufft-ls
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy
  Downloading numpy-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
     |████████████████████████████████| 16.8 MB 13.4 MB/s 
Collecting astropy
  Downloading astropy-5.0.1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (11.1 MB)
     |████████████████████████████████| 11.1 MB 16.8 MB/s 
Collecting threadpoolctl
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting pyerfa>=2.0
  Downloading pyerfa-2.0.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (743 kB)
     |████████████████████████████████| 743 kB 30.6 MB/s 
Collecting PyYAML>=3.13
  Downloading PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
     |████████████████████████████████| 682 kB 11.3 MB/s 
Collecting packaging>=19.0
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 9.8 MB/s 
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.7-py3-none-any.whl (98 kB)
     |████████████████████████████████| 98 kB 6.7 MB/s 
Installing collected packages: pyparsing, numpy, PyYAML, pyerfa, packaging, threadpoolctl, astropy, nufft-ls
  Running setup.py develop for nufft-ls
    ERROR: Command errored out with exit status 1:
     command: /home/alex/miniconda3/envs/py310/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/alex/physics/nufft-ls/setup.py'"'"'; __file__='"'"'/home/alex/physics/nufft-ls/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/alex/physics/nufft-ls/
    Complete output (19 lines):
    running develop
    /tmp/pip-build-env-aglr0b45/overlay/lib/python3.10/site-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /tmp/pip-build-env-aglr0b45/overlay/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    writing src/nufft_ls.egg-info/PKG-INFO
    writing dependency_links to src/nufft_ls.egg-info/dependency_links.txt
    writing requirements to src/nufft_ls.egg-info/requires.txt
    writing top-level names to src/nufft_ls.egg-info/top_level.txt
    reading manifest file 'src/nufft_ls.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    running build_ext
    building 'nufft_ls.cpu' extension
    src/nufft_ls/cpu.cpp:1:10: fatal error: pybind11/pybind11.h: No such file or directory
        1 | #include <pybind11/pybind11.h>
          |          ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command '/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/alex/miniconda3/envs/py310/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/alex/physics/nufft-ls/setup.py'"'"'; __file__='"'"'/home/alex/physics/nufft-ls/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Is there a C++ only makefile test?

ahbarnett commented 2 years ago

duh, just read README. Trying C++ now... ok, tests pass but no timing performance done here.

lgarrison commented 2 years ago

Try pip install pybind11?

The Python installation is the only way the benchmarks are run right now (via bench/bench.py). I think I just forgot pybind11 in setup.py. Will fix it tomorrow!

ahbarnett commented 2 years ago

Thanks! I guess I'd assumed the local pip would install any needed pkgs, but that's my ignorance. Works now! ryzen laptop:

(py310) alex@ross /home/alex/physics/nufft-ls> ./bench/bench.py 
Running with N=3554, M=100000, dtype float64
baseline took 6.058 sec
winding baseline took 0.209 sec
astropy took 17.17 sec
baseline vs winding
    frac isclose 100%
    max frac err 8.861e-10
winding vs astropy
    frac isclose 100%
    max frac err 4.642e-10
lgarrison commented 2 years ago

Not your fault, I forgot to add a dependency on that package! Glad it's working now.