Skip to content

cannot locate symbol "_gfortran_concat_string" Android #1871

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

Closed
jeffmorr opened this issue Nov 15, 2018 · 14 comments
Closed

cannot locate symbol "_gfortran_concat_string" Android #1871

jeffmorr opened this issue Nov 15, 2018 · 14 comments

Comments

@jeffmorr
Copy link

Hello,

I am having issues with the symbol _gfortran_concat_string. I have built OpenBLAS with FORTRAN in order to get Lapack (or at least I think I built it correctly) for ARMV8 arch and when installing I see the openblas.so as well as the headers for OpenBLAS and Lapack. I am also able to successfully build OpenBLAS in my Android Application with the additional flag of -lgfortran. I deploy my Android application to the device, along with a libgfortran.so, but I still get the error above. Does anyone have any ideas as to why this may still be? Should I be using the static library instead of the shared library?

@martin-frbg
Copy link
Collaborator

Could be a version issue - is "a libgfortran.so" that you deployed the same you used to build the application ? Alternatively, did you place this libgfortran.so in whatever standard paths Android searches for libraries (which may not necessarily include the location of the application) ?

@jeffmorr
Copy link
Author

I don't know if it's the same version. I couldn't find the libgfortran.so in the toolchain, when following the android g-fortran tutorial, but I did find one in /usr/lib/gcc/x86_64-linux-gnu/7.3.0.

@martin-frbg
Copy link
Collaborator

That probably is your problem - from the path you found it in, your libgfortran.so is almost certainly x86 code that the ARMV8 arch cannot handle. If there is only a static libgfortran.a in your toolchain, you will need to try static linking, or cross-compile gfortran (i.e.gcc) yourself to get an appropriate libgfortran.so for ARMV8.

@jeffmorr
Copy link
Author

This might be a rudimentary question, but the only thing I have in my toolchain under the gcc folder is libgfortranbegin.a, is that what I should be using if I'm going to be statically linking my OpenBLAS?

@jeffmorr
Copy link
Author

Actually nevermind I found it, thank you! I will try to statically link my library and see what the results are.

@brada4
Copy link
Contributor

brada4 commented Nov 15, 2018

I think HOSTCC should inhibit native fortran detection ?

@vinayak618
Copy link

vinayak618 commented Nov 23, 2018

@brada4 I understood it, and i'm pretty sure that the libopenblas.so while compling used the x86_64 version of libgfortran.so, and this is what comes default with ubuntu packages. How should i explicilty download ARMV7 and ARMV8 version of libgfortran and execute the compilation completely for libopenblas.so?

@martin-frbg
Copy link
Collaborator

I suspect your options are (a) link OpenBLAS statically against the libgfortran.a that seems to be present in the toolchain or (b) see if you can find a Linux distribution for ARM (Linaro ?) that has a suitable libgfortran.so that you could put on your device (assuming that would work in an Android environment as well . (Failing that, you could use the toolchain to cross-compile gcc-gfortran just to get the libgfortran.so)

@jeffmorr
Copy link
Author

Yeah linking OpenBLAS statically is what I did and it worked perfectly. I can close this issue now.

@vinayak618
Copy link

Hi @martin-frbg, i tried searching the gcc-gfortran binary for arm architectures here., But ended up finding nothing, and i cannot link static library due to dependency of multiple shared libs on application.
is there any way again?

@martin-frbg
Copy link
Collaborator

@vinayak618 try googling for "libgfortran.so aarch64", see if you find some package that matches your version of gfortran and extract the libgfortran.so from it. (rpm packages can be unpacked with rpm2cpio package.rpm | cpio -ivd, I assume there will be something similar for extracting files from .deb and other package formats) But this is just a wild guess...

@vinayak618
Copy link

@martin-frbg, i found something`, but how do i make the libopenblas compilation point to this and not default x86_64 one?

@vinayak618
Copy link

@martin-frbg , Trying to link the above package of libgfortran.so for aarch64 and below is the crash error.
undefined reference to 'pipe@GLIBC_2.17'

@brada4
Copy link
Contributor

brada4 commented Nov 26, 2018

Wrong compiler still There are no GLIBC symbol versioning on Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants