[Numpy-discussion] Re: How to get numpy.distutils.fcompiler to find my absoft compiler

2023-07-30 Thread Samuel H Dupree Jr

Rohit,

Thank you responding to my posting.

I attempted to do a 'meson' build. The build failed. The commands I used 
follow:


   echo f2py build for divapy
   echo deleting previous build
   rm -i *.so
   rm -i divapy.f
   rm -i divapy-f2pywrappers.f
   rm -i divapymodule.c
   echo concatenating files
   cat *.f > divapy.f
   echo building Python wrappers using meson
   /Users/user/opt/anaconda3/bin/python -m numpy.f2py divapy.f -m
   divapy --lower
   meson --wipe builddir
   meson setup builddir
   meson compile -C builddir
   cd builddir
   /Users/user/opt/anaconda3/bin/python -c 'import divapy'
   echo done.

The meson log file is attached for reference. The output written to the 
terminal is:


   The Meson build system
   Version: 1.1.1
   Source dir: /Users/user/Various_Python_Examples/diva.f_for_f2py
   Build dir: /Users/user/Various_Python_Examples/diva.f_for_f2py/builddir
   Build type: native build
   Project name: diva_example
   Project version: 0.1
   C compiler for the host machine: cc (clang 14.0.3 "Apple clang
   version 14.0.3 (clang-1403.0.22.14.1)")
   C linker for the host machine: cc ld64 857.1
   Host machine cpu family: x86_64
   Host machine cpu: x86_64
   meson.build:8: WARNING: add_languages is missing native:, assuming
   languages are wanted for both host and build.
   Fortran compiler for the host machine: gfortran (gcc 13.1.0 "GNU
   Fortran (Homebrew GCC 13.1.0) 13.1.0")
   Fortran linker for the host machine: gfortran ld64 857.1
   Program python3 found: YES (/usr/local/opt/python@3.11/bin/python3.11)
   Found pkg-config: /usr/local/bin/pkg-config (0.29.2)

   meson.build:14:15: ERROR: Command
   `/usr/local/opt/python@3.11/bin/python3.11 -c 'import os;
   os.chdir(".."); import numpy; print(numpy.get_include())'` failed
   with status 1.

   A full log can be found at
   
/Users/user/Various_Python_Examples/diva.f_for_f2py/builddir/meson-logs/meson-log.txt
   WARNING: Running the setup command as `meson [options]` instead of
   `meson setup [options]` is ambiguous and deprecated.
   The Meson build system
   Version: 1.1.1
   Source dir: /Users/user/Various_Python_Examples/diva.f_for_f2py
   Build dir: /Users/user/Various_Python_Examples/diva.f_for_f2py/builddir
   Build type: native build
   Project name: diva_example
   Project version: 0.1
   C compiler for the host machine: cc (clang 14.0.3 "Apple clang
   version 14.0.3 (clang-1403.0.22.14.1)")
   C linker for the host machine: cc ld64 857.1
   Host machine cpu family: x86_64
   Host machine cpu: x86_64
   meson.build:8: WARNING: add_languages is missing native:, assuming
   languages are wanted for both host and build.
   Fortran compiler for the host machine: gfortran (gcc 13.1.0 "GNU
   Fortran (Homebrew GCC 13.1.0) 13.1.0")
   Fortran linker for the host machine: gfortran ld64 857.1
   Program python3 found: YES (/usr/local/opt/python@3.11/bin/python3.11)
   Found pkg-config: /usr/local/bin/pkg-config (0.29.2)

   meson.build:14:15: ERROR: Command
   `/usr/local/opt/python@3.11/bin/python3.11 -c 'import os;
   os.chdir(".."); import numpy; print(numpy.get_include())'` failed
   with status 1.

   A full log can be found at
   
/Users/user/Various_Python_Examples/diva.f_for_f2py/builddir/meson-logs/meson-log.txt

   ERROR: Current directory is not a meson build directory:
   `/Users/user/Various_Python_Examples/diva.f_for_f2py/builddir`.
   Please specify a valid build dir or change the working directory to it.
   It is also possible that the build directory was generated with an old
   meson version. Please regenerate it in this case.
   Traceback (most recent call last):
  File "", line 1, in 
   ModuleNotFoundError: No module named 'divapy'
   done.
   (base) user@Mac-Pro diva.f_for_f2py %

In doing a deeper dive, I found that I have meson installed under Homebrew.

Before I open an issue, I'd like to know do I need to have meson and/or 
meson-python installed under Anaconda?


Sam Dupree.


On 7/29/23 10:49, Rohit Goswami wrote:
More of a workaround, since it seems like the wrappers and binding 
files are generated could you try the `meson` build following this 
page in the documentation?


https://numpy.org/devdocs/f2py/buildtools/meson.html

`distutils` support is patchy at best, but if the meson build doesn't 
work the bindings might be incorrect, please open an issue in that case.


--- Rohit


*From:* Samuel H Dupree Jr 
*Sent:* Saturday, 29 July 2023 09:33
*To:* Discussion of Numerical Python
*Subject:* [Numpy-discussion] How to get numpy.distutils.fcompiler to 
find my absoft compiler


Hello everyone,

I'm trying to wrap some Fortran77 subroutines from the Math77 library 
using f2py3. f2py3 responds with a message:


 File

"/Users/user/opt/anaconda3/lib/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py",
line 426, in get_version
    raise CompilerNotFound()
numpy.distutils

[Numpy-discussion] next NumPy community meeting

2023-07-30 Thread Inessa Pawson
The next NumPy community meeting will be held this Wednesday, August 2nd at
5pm UTC.
Join us via Zoom:
https://numfocus-org.zoom.us/j/83278611437?pwd=ekhoLzlHRjdWc0NOY2FQM0NPemdkZz09
.
Everyone is welcome and encouraged to attend.
To add to the meeting agenda the topics you’d like to discuss, follow the
link: https://hackmd.io/76o-IxCjQX2mOXO_wwkcpg?both.
For the notes from the previous meeting, visit:
https://github.com/numpy/archive/blob/main/community_meetings/community-2023-07-19.md
.

-- 
Cheers,
Inessa

Inessa Pawson
Contributor Experience Lead | NumPy
https://numpy.org/
GitHub: inessapawson
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com