PySCeS / pysces

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

Fails to build #29

Closed yurivict closed 7 months ago

yurivict commented 6 years ago

I'm getting this error on FreeBSD 11.1 while trying to create a port:

/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61.f:3060:0: Warning: 'lfxm' may be used uninitialized in this function [-Wmaybe-uninitialized]
gfortran6:f77: /usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61w.f
/usr/local/bin/gfortran6 -Wall -g -fstack-protector build/temp.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/pitconmodule.o build/temp.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/fortranobject.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/pcon61subd.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61w.o -L/usr/local/lib/gcc6/gcc/x86_64-portbld-freebsd11.1/6.4.0 -L/usr/local/lib -lpython2.7 -lgfortran -o build/lib.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/pitcon.so
/usr/lib/crt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x17b): undefined reference to `main'
collect2: error: ld returned 1 exit status
/usr/lib/crt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x17b): undefined reference to `main'
collect2: error: ld returned 1 exit status
error: Command "/usr/local/bin/gfortran6 -Wall -g -fstack-protector build/temp.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/pitconmodule.o build/temp.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/build/src.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/fortranobject.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/pcon61subd.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61.o build/temp.freebsd-11.1-STABLE-amd64-2.7/usr/ports/biology/py-PySCeS/work-py27/pysces-0.9.5/pysces/pitcon/dpcon61w.o -L/usr/local/lib/gcc6/gcc/x86_64-portbld-freebsd11.1/6.4.0 -L/usr/local/lib -lpython2.7 -lgfortran -o build/lib.freebsd-11.1-STABLE-amd64-2.7/pysces/pitcon/pitcon.so" failed with exit status 1
bgoli commented 3 years ago

Thanks, I will try replicate this with (edit FreeBSD 13.0)

bgoli commented 3 years ago

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.

yurivict commented 3 years ago

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

bgoli commented 3 years ago

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.

yurivict commented 3 years ago

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.

bgoli commented 3 years ago

Thanks, I will carry on looking into this

yurivict commented 3 years ago

Thanks.

In the meantime I released the FreeBSD port with the above fixes: https://cgit.freebsd.org/ports/commit/?id=1c0e78eb4b2833ec20fb0addbb001e1e99235982

bgoli commented 7 months ago

Closing for now as in the latest release 1.2.0 we have completely changed the build system.