Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build #29

Closed
yurivict opened this issue Apr 1, 2018 · 8 comments
Closed

Fails to build #29

yurivict opened this issue Apr 1, 2018 · 8 comments
Assignees

Comments

@yurivict
Copy link

yurivict commented Apr 1, 2018

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 bgoli added this to To do in PyscesDev Aug 24, 2020
@bgoli bgoli added this to To do in Development Aug 24, 2020
@bgoli bgoli self-assigned this Aug 16, 2021
@bgoli bgoli added this to the 0.9.9 milestone Aug 16, 2021
@bgoli
Copy link
Member

bgoli commented Aug 16, 2021

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

@bgoli bgoli moved this from To do to In progress in Development Aug 16, 2021
@bgoli
Copy link
Member

bgoli commented Aug 16, 2021

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
Copy link
Author

yurivict commented Aug 16, 2021

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
Copy link
Member

bgoli commented Aug 17, 2021

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
Copy link
Author

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
Copy link
Member

bgoli commented Aug 17, 2021

Thanks, I will carry on looking into this

@yurivict
Copy link
Author

Thanks.

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

@bgoli bgoli modified the milestones: 1.0, 1.1 Aug 25, 2021
@bgoli
Copy link
Member

bgoli commented Feb 14, 2024

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

@bgoli bgoli closed this as completed Feb 14, 2024
Development automation moved this from In progress to Done Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development
  
Done
PyscesDev
  
To do
Development

No branches or pull requests

2 participants