Closed yurivict closed 7 months ago
Thanks, I will try replicate this with (edit FreeBSD 13.0)
I've just tested the current source build on FreeBSD 13 (gcc 10 and Python 3.8) and everything seemed to work. Built in a python 3.8 virtualenv using pip installed dependencies and native gcc/gfortran (10.3) so hopefully this was a gcc/gfortran issue that has been resolved.
Now it fails for me this way:
/usr/local/bin/gfortran10 -Wall -g -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10 -B/usr/local/bin -fstack-protector-strong build/temp.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pitconmodule.o build/temp.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/fortranobject.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pcon61subd.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/dpcon61.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/dpcon61w.o -L/usr/local/lib/gcc10/gcc/x86_64-portbld-freebsd13.0/10.3.0 -L/usr/local/lib -lgfortran -o build/lib.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pitcon.cpython-38.so
/usr/local/bin/ld: /usr/lib/crt1.o: in function `_start':
/disk-samsung/freebsd-src/lib/csu/amd64/crt1_c.c:75: undefined reference to `main'
/usr/local/bin/ld: build/temp.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pitconmodule.o: in function `PyInit_pitcon':
pitconmodule.c:(.text+0x18): undefined reference to `PyModule_Create2'
/usr/local/bin/ld: pitconmodule.c:(.text+0x29): undefined reference to `PyType_Type'
/usr/local/bin/ld: pitconmodule.c:(.text+0x40): undefined reference to `PyImport_ImportModule'
/usr/local/bin/ld: pitconmodule.c:(.text+0x5b): undefined reference to `PyObject_GetAttrString'
/usr/local/bin/ld: pitconmodule.c:(.text+0x74): undefined reference to `PyCapsule_Type'
/usr/local/bin/ld: pitconmodule.c:(.text+0x7d): undefined reference to `PyExc_RuntimeError'
/usr/local/bin/ld: pitconmodule.c:(.text+0x8c): undefined reference to `PyErr_SetString'
/usr/local/bin/ld: pitconmodule.c:(.text+0x9e): undefined reference to `_Py_Dealloc'
/usr/local/bin/ld: pitconmodule.c:(.text+0xab): undefined reference to `_Py_Dealloc'
/usr/local/bin/ld: pitconmodule.c:(.text+0xb7): undefined reference to `PyExc_AttributeError'
/usr/local/bin/ld: pitconmodule.c:(.text+0xc6): undefined reference to `PyErr_SetString'
0.9.8post1-31-g28dd259
I've tried both 0.9.8post1 and 0.9.9 (upcoming release) and in both cases I could not reproduce this error. However, in this case it looks like you may be missing the Python development libraries/packages.
Adding -lpython3.8
helps but then it breaks with:
/usr/local/bin/gfortran10 -Wall -g -lpython3.8 -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10 -B/usr/local/bin -fstack-protector-strong build/temp.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pitconmodule.o build/temp.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/build/src.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/fortranobject.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pcon61subd.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/dpcon61.o build/temp.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/dpcon61w.o -L/usr/local/lib/gcc10/gcc/x86_64-portbld-freebsd13.0/10.3.0 -L/usr/local/lib -lgfortran -o build/lib.freebsd-13.0-STABLE-amd64-3.8/pysces/pitcon/pitcon.cpython-38.so
/usr/local/bin/ld: /usr/lib/crt1.o: in function `_start':
/disk-samsung/freebsd-src/lib/csu/amd64/crt1_c.c:75: undefined reference to `main'
collect2: error: ld returned 1 exit status
This is because the flag -shared
is missing. Adding LDFLAGS=-shared
helps.
Thanks, I will carry on looking into this
Thanks.
In the meantime I released the FreeBSD port with the above fixes: https://cgit.freebsd.org/ports/commit/?id=1c0e78eb4b2833ec20fb0addbb001e1e99235982
Closing for now as in the latest release 1.2.0 we have completely changed the build system.
I'm getting this error on FreeBSD 11.1 while trying to create a port: