PySCeS / pysces

The official PySCeS project source code repository.
https://pysces.github.io
Other
34 stars 10 forks source link

Build fails: ../meson.build:1:0: ERROR: Compiler gfortran13 cannot compile programs. #97

Closed yurivict closed 6 months ago

yurivict commented 7 months ago

It looks like the build process was changed in 1.2.0, and it fails:

===>  Building for py39-PySCeS-1.2.0
* Getting build dependencies for wheel...
* Building wheel...
+ meson setup /usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0 /usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0/.mesonpy-vv_p5jsp -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0/.mesonpy-vv_p5jsp/meson-python-native-file.ini
The Meson build system
Version: 1.4.0
Source dir: /usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0
Build dir: /usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0/.mesonpy-vv_p5jsp
Build type: native build
Project name: pysces
Project version: 1.2.0

../meson.build:1:0: ERROR: Compiler gfortran13 cannot compile programs.

A full log can be found at /usr/ports/biology/py-PySCeS/work-py39/pysces-1.2.0/.mesonpy-vv_p5jsp/meson-logs/meson-log.txt

ERROR Backend subprocess exited when trying to invoke build_wheel
*** Error code 1

The .mesonpy-vv_p5jsp directory gets deleted, but from the kernel log I got the command:

       "Sanity check compiler command line: gfortran13 sanitycheckf.f90 -o sanitycheckf.exe -O -Wl,-rpath=/usr/local/lib/gcc13 -lpython3.9 -shared -Wl,-rpath=/usr/local/lib/gcc13 -L/usr/l\
        ocal/lib/gcc13 -fstack-protector-strong -L/usr/local/lib -O -Wl,-rpath=/usr/local/lib/gcc13
       "

and the error message:

       "/usr/local/bin/ld: /tmp//cc5eqbGG.o: relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
        /usr/local/bin/ld: failed to set dynamic section sizes: bad value
        collect2: error: ld returned 1 exit status

       "

The offending flag is "-shared". It should not be used when executables are created.

I am sure that it's not PySCeS's fault, but you are using meson and meson-py, and one of them adds this flag.

Do you know what is going on?

Version: 1.2.0 Python-3.9 meson-1.4.0 py39-meson-python-0.14.0 FreeBSD 14.0

jmrohwer commented 7 months ago

This is indeed not an issue with PySCeS but with meson-python. It fails on the sanity check - meson first tries to compile a small fortran file to check that the compiler is working. I have never seen this before, and on my box (linux) this compiles without problems with gcc13. What I did notice though is that I'm using meson-python 0.15.0 (latest version), you might try upgrading and see if that solves the problem. Alternatively report at meson-python.

I have never used FreeBSD myself.