aburrell / apexpy

A Python wrapper for Apex coordinates
MIT License
34 stars 25 forks source link

Question: Minimum required version of gfortran #101

Closed ljlamarche closed 2 years ago

ljlamarche commented 2 years ago

Describe the problem or ask the question What is the minimum required version of gfortran required to install the new build version of apexpy? I've had some issues attempting to install with gfortran v4.8.5, most seem to be related to unrecognized compiler flag options.

Desktop:

aburrell commented 2 years ago

This is a good question, I've not explored many different versions of gfortran. Which compiler flags aren't recognized?

aburrell commented 2 years ago

FYI I am using GNU Fortran (MacPorts gcc12 12.2.0_0+stdlib_flag) 12.2.0

ljlamarche commented 2 years ago

I believe this is the pertinent part of the error produced from python -m build .:

FAILED: lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o 
cc -Ilib_fortranobject.a.p -I. -I../.. -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/core/include -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src -I/opt/python/include/python3.9 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -MF lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o.d -o lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -c /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c
/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: In function ‘find_first_negative_dimension’:
/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < rank; ++i) {
     ^
/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: note: use option -std=c99 or -std=gnu99 to compile your code
/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: At top level:
cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-misleading-indentation" [enabled by default]

I actually tried specifying the -std flags as the error message suggests in the meson build file, and I think this got me past this particular problem, but there were still other issues. I had more luck just specifying which gfortran/gcc should be used to avoid the very old default one on this computer. That just works with pip install as well.

$ FC=/path/to/good/gfortran CC=/path/to/good/gcc pip install apexpy

I managed to get this working with GNU Fortran (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5), so the minimum version is somewhere between 4.8.5 and 7.3.1? I'm not sure if you want to try to revise the build file so it can handle this case, or just tell users to please not try to use an ancient version of gfortran.

Full error output ``` * Creating virtualenv isolated environment... * Installing packages in isolated environment... (Cython>=0.29.21, meson-python>=0.8.0, numpy, python-dev-tools, setuptools<60.0, wheel) * Getting build dependencies for sdist... * Installing packages in isolated environment... (ninja >= 1.8.2) * Building sdist... + meson setup --prefix=/opt/python /home/llamarche/Tools/apexpy /home/llamarche/Tools/apexpy/.mesonpy-2xmjt8i7/build --native-file=/home/llamarche/Tools/apexpy/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 The Meson build system Version: 0.64.1 Source dir: /home/llamarche/Tools/apexpy Build dir: /home/llamarche/Tools/apexpy/.mesonpy-2xmjt8i7/build Build type: native build Project name: apexpy Project version: 1.1.0 C compiler for the host machine: cc (gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)") C linker for the host machine: cc ld.bfd 2.27-44 Host machine cpu family: x86_64 Host machine cpu: x86_64 Fortran compiler for the host machine: gfortran (gcc 4.8.5 "GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)") Fortran linker for the host machine: gfortran ld.bfd 2.27-44 Compiler for C supports arguments -Wno-unused-but-set-variable: YES Library m found: YES Program python found: YES (/tmp/build-env-qzpwanrp/bin/python) Found pkg-config: /usr/bin/pkg-config (0.27.1) Message: /tmp/build-env-qzpwanrp/bin/python Message: /opt/python/lib/python3.9/site-packages/ Check usable header "Python.h" with dependency python: YES Build targets in project: 3 apexpy 1.1.0 User defined options Native files: /home/llamarche/Tools/apexpy/.mesonpy-native-file.ini debug : false optimization: 2 prefix : /opt/python Found ninja-1.11.1.git.kitware.jobserver-1 at /tmp/build-env-qzpwanrp/bin/ninja + meson dist --allow-dirty --no-tests --formats gztar Unknown option: -C usage: git [--version] [--help] [-c name=value] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [] Created /home/llamarche/Tools/apexpy/.mesonpy-2xmjt8i7/build/meson-dist/apexpy-1.1.0.tar.gz * Building wheel from sdist * Creating virtualenv isolated environment... * Installing packages in isolated environment... (Cython>=0.29.21, meson-python>=0.8.0, numpy, python-dev-tools, setuptools<60.0, wheel) * Getting build dependencies for wheel... * Installing packages in isolated environment... (ninja >= 1.8.2, patchelf >= 0.11.0) * Building wheel... + meson setup --prefix=/opt/python /tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0 /tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0/.mesonpy-upxlrr78/build --native-file=/tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 The Meson build system Version: 0.64.1 Source dir: /tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0 Build dir: /tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0/.mesonpy-upxlrr78/build Build type: native build Project name: apexpy Project version: 1.1.0 C compiler for the host machine: cc (gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)") C linker for the host machine: cc ld.bfd 2.27-44 Host machine cpu family: x86_64 Host machine cpu: x86_64 Fortran compiler for the host machine: gfortran (gcc 4.8.5 "GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)") Fortran linker for the host machine: gfortran ld.bfd 2.27-44 Compiler for C supports arguments -Wno-unused-but-set-variable: YES Library m found: YES Program python found: YES (/tmp/build-env-7e74_pev/bin/python) Found pkg-config: /usr/bin/pkg-config (0.27.1) Message: /tmp/build-env-7e74_pev/bin/python Message: /opt/python/lib/python3.9/site-packages/ Check usable header "Python.h" with dependency python: YES Build targets in project: 3 apexpy 1.1.0 User defined options Native files: /tmp/build-via-sdist-feqaiqj4/apexpy-1.1.0/.mesonpy-native-file.ini debug : false optimization: 2 prefix : /opt/python Found ninja-1.11.1.git.kitware.jobserver-1 at /tmp/build-env-7e74_pev/bin/ninja + meson compile INFO: autodetecting backend as ninja INFO: calculating backend command to run: /tmp/build-env-7e74_pev/bin/ninja [1/14] Compiling C object lib_fortranobject.a.p/_tmp_...hon3.9_site-packages_numpy_f2py_src_fortranobject.c. FAILED: lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o cc -Ilib_fortranobject.a.p -I. -I../.. -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/core/include -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src -I/opt/python/include/python3.9 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -MF lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o.d -o lib_fortranobject.a.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -c /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: In function ‘find_first_negative_dimension’: /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < rank; ++i) { ^ /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: note: use option -std=c99 or -std=gnu99 to compile your code /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: At top level: cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types" [enabled by default] cc1: warning: unrecognized command line option "-Wno-misleading-indentation" [enabled by default] [2/14] Compiling C object fortranapex.cpython-39-x86_...hon3.9_site-packages_numpy_f2py_src_fortranobject.c. FAILED: fortranapex.cpython-39-x86_64-linux-gnu.so.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o cc -Ifortranapex.cpython-39-x86_64-linux-gnu.so.p -I. -I../.. -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/core/include -I/tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src -I/opt/python/include/python3.9 -fvisibility=hidden -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ fortranapex.cpython-39-x86_64-linux-gnu.so.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -MF fortranapex.cpython-39-x86_64-linux-gnu.so.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o.d -o fortranapex.cpython-39-x86_64-linux-gnu.so.p/_tmp_build-env-7e74_pev_lib_python3.9_site-packages_numpy_f2py_src_fortranobject.c.o -c /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: In function ‘find_first_negative_dimension’: /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < rank; ++i) { ^ /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c:707:5: note: use option -std=c99 or -std=gnu99 to compile your code /tmp/build-env-7e74_pev/lib/python3.9/site-packages/numpy/f2py/src/fortranobject.c: At top level: cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types" [enabled by default] cc1: warning: unrecognized command line option "-Wno-misleading-indentation" [enabled by default] [3/14] Generating fortranapexmodule.c with a custom command Reading fortran codes... Reading file '../../fortranapex/magfld.f90' (format:free) Reading file '../../fortranapex/apex.f90' (format:free) Reading file '../../fortranapex/makeapexsh.f90' (format:free) Reading file '../../fortranapex/igrf.f90' (format:free) Reading file '../../fortranapex/apexsh.f90' (format:free) Reading file '../../fortranapex/checkapexsh.f90' (format:free) Post-processing... Block: fortranapex Block: magcof Block: coeffmodule In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:coeffmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: cofrm In: :fortranapex:../../fortranapex/magfld.f90:cofrm get_useparameters: no module igrf info used by cofrm Block: dypol In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:dypol get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: feldg In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:feldg get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: gd2cart In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:gd2cart get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: convrt In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/magfld.f90:convrt get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: apexmodule In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: fint In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apex.f90:apexmodule:fint get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: dipole Block: fldcomd Block: apxin Block: itra Block: apex Block: linapx Block: itrace Block: fndapx Block: dipapx Block: makeapxsh In: :fortranapex:../../fortranapex/makeapexsh.f90:makeapxsh get_useparameters: no module apxshmodule info used by makeapxsh Block: choldc Block: cholsl Block: igrf Block: read_igrf Block: apxshmodule In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 In: :fortranapex:../../fortranapex/apexsh.f90:apxshmodule get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: loadapxsh Block: allocatearrays Block: apxg2q Block: apxg2all Block: apxq2g Block: shcalc Block: alfbasismodule Block: alfbasisinit Block: alfbasis In: :fortranapex:../../fortranapex/apexsh.f90:alfbasis get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Block: checkapexsh In: :fortranapex:../../fortranapex/checkapexsh.f90:checkapexsh get_parameters: got "eval() arg 1 must be a string, bytes or code object" on 4 Post-processing (stage 2)... Block: fortranapex Block: unknown_interface Block: magcof Block: coeffmodule Block: cofrm Block: dypol Block: feldg Block: gd2cart Block: convrt Block: apexmodule Block: fint Block: dipole Block: fldcomd Block: apxin Block: itra Block: apex Block: linapx Block: itrace Block: fndapx Block: dipapx Block: makeapxsh Block: choldc Block: cholsl Block: igrf Block: read_igrf Block: apxshmodule Block: loadapxsh Block: allocatearrays Block: apxg2q Block: apxg2all Block: apxq2g Block: shcalc Block: alfbasismodule Block: alfbasisinit Block: alfbasis Block: checkapexsh Building modules... Building module "fortranapex"... Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "cofrm"... cofrm(date,filename) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "dypol"... colat,elon,vp = dypol() Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "feldg"... bnrth,beast,bdown,babs = feldg(ienty,glat,glon,alt) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "gd2cart"... x,y,z = gd2cart(gdlat,glon,alt) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "convrt"... convrt(i,gdlat,alt,x1,x2) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "apex"... a,alat,alon,bmag,xmag,ymag,zmag,v = apex(date,igrffilein,dlat,dlon,alt) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "linapx"... a,alat,alon,xmag,ymag,zmag,f = linapx(gdlat,glon,alt) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "itrace"... iapx = itrace() Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "fndapx"... a,alat,alon = fndapx(alt,zmag) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "dipapx"... a,alon = dipapx(gdlat,gdlon,alt,bnorth,beast,bdown) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "makeapxsh"... makeapxsh(datafilein,igrffilein,epochgridin,nepochin,lmaxin,mmaxin,nmaxin) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "choldc"... p = choldc(a,n,[np]) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "cholsl"... x = cholsl(a,p,b,[n,np]) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "loadapxsh"... loadapxsh(datafilenew,epochnew) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "allocatearrays"... allocatearrays() Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "apxg2q"... qlatout,qlonout,f1,f2,f = apxg2q(glat,glon,alt,vecflagin) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "apxg2all"... qlatout,qlonout,mlat,mlon,f1,f2,f,d1,d2,d3,d,e1,e2,e3 = apxg2all(glat,glon,alt,hr,vecflagin) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "apxq2g"... glatout,glonout,error = apxq2g(qlat0,qlon0,alt,prec) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "shcalc"... shcalc(theta,phi) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "alfbasisinit"... alfbasisinit(nmax0in,mmax0in) Generating possibly empty wrappers" Maybe empty "fortranapex-f2pywrappers.f" Constructing wrapper function "alfbasis"... p,v,w = alfbasis(nmax,mmax,theta) Constructing F90 module support for "magcof"... Variables: nmax1 ichg gb gv Constructing F90 module support for "coeffmodule"... Variables: pi dtor rtod pid2 twopi req rep eps re ecc2 missing Constructing F90 module support for "apexmodule"... Creating wrapper for Fortran function "fint"("fint")... Constructing wrapper function "apexmodule.fint"... fint = fint(x1,x2,x3,y1,y2,y3,xfit) Constructing F90 module support for "dipole"... Variables: colat elon vp ctp stp Constructing F90 module support for "fldcomd"... Variables: bx by bz bb Constructing F90 module support for "apxin"... Variables: yapx Constructing F90 module support for "itra"... Variables: nstp sgn ds y yold yp Constructing F90 module support for "igrf"... Variables: datel nepo nght epoch nmxe gyr hyr gt ht getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' Constructing wrapper function "igrf.read_igrf"... read_igrf(filename_in) Constructing F90 module support for "apxshmodule"... Variables: nterm nmax mmax lmax nepoch ntermsh vecflag coeff0 qcoeff0 gcoeff0 xqcoeff yqcoeff zqcoeff dxqdrhocoeff dyqdrhocoeff dzqdrhocoeff xgcoeff ygcoeff zgcoeff sh shgradtheta shgradphi polynomq dpolynomq polynomg pbar vbar wbar epochgrid h reph rho xq yq zq qlat qlon sinqlat cosqlat cosqlon sinqlon xqgrad yqgrad zqgrad qlatgrad qlongrad datafile epoch altlastq altlastg loadflag getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' Constructing F90 module support for "alfbasismodule"... Variables: nmax0 mmax0 anm cm bnm dnm en marr narr getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' getarrdims:warning: assumed shape array, using 0 instead of ':' Wrote C/API module "fortranapex" to file "./fortranapexmodule.c" Fortran 90 wrappers are saved to "./fortranapex-f2pywrappers2.f90" ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/llamarche/venvs/apexpy_test/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 351, in main() File "/home/llamarche/venvs/apexpy_test/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 333, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/llamarche/venvs/apexpy_test/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 249, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 1061, in build_wheel return project.wheel(out).name File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 920, in wheel wheel = self._wheel_builder.build(self._build_dir) File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 502, in build self._project.build() # ensure project is built File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 737, in build self._meson('compile', *self._meson_args['compile'],) File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 657, in _meson return self._proc('meson', *args) File "/tmp/build-env-7e74_pev/lib/python3.9/site-packages/mesonpy/__init__.py", line 652, in _proc subprocess.check_call(list(args), env=self._env) File "/opt/python/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['meson', 'compile']' returned non-zero exit status 1. ERROR Backend subprocess exited when trying to invoke build_wheel ```

This was the error message from pip install apexpy:

      error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ibuild/src.linux-x86_64-3.9/build/src.linux-x86_64-3.9/src/fortranapex -I/tmp/pip-build-env-z8ddhh4b/overlay/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.9/numpy/distutils/include -I/opt/python/include/python3.9 -c build/src.linux-x86_64-3.9/build/src.linux-x86_64-3.9/src/fortranapex/fortranobject.c -o build/temp.linux-x86_64-cpython-39/build/src.linux-x86_64-3.9/build/src.linux-x86_64-3.9/src/fortranapex/fortranobject.o -MMD -MF build/temp.linux-x86_64-cpython-39/build/src.linux-x86_64-3.9/build/src.linux-x86_64-3.9/src/fortranapex/fortranobject.o.d -msse -msse2 -msse3" failed with exit status 1
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: x64
        Compiler    : gcc

      CPU baseline  :
        Requested   : 'min'
        Enabled     : SSE SSE2 SSE3
        Flags       : -msse -msse2 -msse3
        Extra checks: none

      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2
        Generated   : none
      INFO: CCompilerOpt.cache_flush[857] : write cache to path -> /tmp/pip-install-whvregnw/apexpy_997e9cd63fda4c6c980240829cd35f8d/build/temp.linux-x86_64-cpython-39/ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for apexpy
Failed to build apexpy
ERROR: Could not build wheels for apexpy, which is required to install pyproject.toml-based projects

I couldn't understand why it was failing just from that, which is why I started trying to build it.

aburrell commented 2 years ago

just tell users to please not try to use an ancient version of gfortran.

I think this is the way to go. Do you want to put together the PR for that, or shall I?

ljlamarche commented 2 years ago

I can - I had a number of clarifications I was going to request to the installation documentation for unusual cases. Do you know if there's an easy way to figure out when those flags were added? I was trying with google but not having much luck. If nothing else, I'll just write it as "has been tested successfully with gfortran 7, earlier versions may not work."

aburrell commented 2 years ago

I also had no luck googling 😿 I would just say: "has been tested successfully with gfortran 7, earlier versions may not work.", as you suggested.