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

Can't build the .so files #9

Closed
catalin-florescu opened this issue Sep 9, 2019 · 18 comments
Closed

Can't build the .so files #9

catalin-florescu opened this issue Sep 9, 2019 · 18 comments

Comments

@catalin-florescu
Copy link

Hello,
I've tried to build the .so files using terminal, but i get some errors. I'm not so sure where is the problem, but i think is from my NDK.
The NDK comes from Android Studio.
Here is the logs (can't format logs, sorry):


Using FFmpeg 4.2
/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi16-clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target /tests/Makefile'. Stop. Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:94: /libavutil/Makefile: No such file or directory Makefile:94: /ffbuild/library.mak: No such file or directory Makefile:96: /fftools/Makefile: No such file or directory Makefile:97: /doc/Makefile: No such file or directory Makefile:98: /doc/examples/Makefile: No such file or directory Makefile:163: /tests/Makefile: No such file or directory make: *** No rule to make target /tests/Makefile'. Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
./ffmpeg-android-maker.sh: line 197: /toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-readelf: No such file or directory
cp: /Users/catalin/Downloads/ffmpeg-android-maker-master/build/armeabi-v7a/lib/*.so: No such file or directory
/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target /tests/Makefile'. Stop. Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:94: /libavutil/Makefile: No such file or directory Makefile:94: /ffbuild/library.mak: No such file or directory Makefile:96: /fftools/Makefile: No such file or directory Makefile:97: /doc/Makefile: No such file or directory Makefile:98: /doc/examples/Makefile: No such file or directory Makefile:163: /tests/Makefile: No such file or directory make: *** No rule to make target /tests/Makefile'. Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
./ffmpeg-android-maker.sh: line 197: /toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf: No such file or directory
cp: /Users/catalin/Downloads/ffmpeg-android-maker-master/build/arm64-v8a/lib/*.so: No such file or directory
/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android16-clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target /tests/Makefile'. Stop. Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:94: /libavutil/Makefile: No such file or directory Makefile:94: /ffbuild/library.mak: No such file or directory Makefile:96: /fftools/Makefile: No such file or directory Makefile:97: /doc/Makefile: No such file or directory Makefile:98: /doc/examples/Makefile: No such file or directory Makefile:163: /tests/Makefile: No such file or directory make: *** No rule to make target /tests/Makefile'. Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
./ffmpeg-android-maker.sh: line 197: /toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-readelf: No such file or directory
cp: /Users/catalin/Downloads/ffmpeg-android-maker-master/build/x86/lib/*.so: No such file or directory
/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android21-clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target /tests/Makefile'. Stop. Makefile:2: ffbuild/config.mak: No such file or directory Makefile:40: /tools/Makefile: No such file or directory Makefile:41: /ffbuild/common.mak: No such file or directory Makefile:94: /libavutil/Makefile: No such file or directory Makefile:94: /ffbuild/library.mak: No such file or directory Makefile:96: /fftools/Makefile: No such file or directory Makefile:97: /doc/Makefile: No such file or directory Makefile:98: /doc/examples/Makefile: No such file or directory Makefile:163: /tests/Makefile: No such file or directory make: *** No rule to make target /tests/Makefile'. Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:94: /libavutil/Makefile: No such file or directory
Makefile:94: /ffbuild/library.mak: No such file or directory
Makefile:96: /fftools/Makefile: No such file or directory
Makefile:97: /doc/Makefile: No such file or directory
Makefile:98: /doc/examples/Makefile: No such file or directory
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
./ffmpeg-android-maker.sh: line 197: /toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android-readelf: No such file or directory
cp: /Users/catalin/Downloads/ffmpeg-android-maker-master/build/x86_64/lib/*.so: No such file or directory
./ffmpeg-android-maker.sh: line 225: cd: /Users/catalin/Downloads/ffmpeg-android-maker-master/build: No such file or directory
./ffmpeg-android-maker.sh: line 226: cd: .DS_Store: Not a directory
cp: include: No such file or directory

Thanks.

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

Hello @catalin-florescu ,

Using FFmpeg 4.2
/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi16-clang is unable to create an executable file.
C compiler test failed.

I don't see any path before /toolchains, so I guess you didn't define the ANDROID_NDK_HOME environment variable. Please make sure you have defined it with the value of the actual path to your Android NDK.

@catalin-florescu
Copy link
Author

catalin-florescu commented Sep 9, 2019

Thanks for this quick reply.
If i replace the path in your executable file should work?

Update
I've set the NDK. Calling echo $ANDROID_NDK_HOME returns the path, but the same error.

@Javernaut
Copy link
Owner

@catalin-florescu , well, you can do this and it should work.
However, you will loose the possibility to check your script on Travis CI, as your version of the script will overwrite the value of ANDROID_NDK_HOME set by Travis CI itself.

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

@catalin-florescu Could you please check the path to your NDK? I mean there is a 'ndk' directory in Android SDK, but it isn't the NDK itself. In my case, for example, the actual path to NDK is '/Users/javernaut/Library/Android/sdk/ndk/20.0.5594570'.
You may use a different version of NDK, so be sure your path is correct.

When it is done and you still have the error, please post the log again. Just want to see the path used for the C compiler.

Update
I have just tested your case on a fresh machine. I downloaded a zip archive of the repo as you and executed the script without the environment variable being defined. And I've got error logs just as you posted above. Then I just defined the variable with
export ANDROID_NDK_HOME=/Users/javernaut/Library/Android/sdk/ndk/20.0.5594570
command and executed the script again. The script works fine now.

So I'm 99% sure your problem is in the ANDROID_NDK_HOME. You either set it to the wrong directory or the script doesn't see it for some reason.

@catalin-florescu
Copy link
Author

catalin-florescu commented Sep 9, 2019

Yes, it is. Is from Android Studio. My path is ‎⁨/Users/⁨catalin/Library/Android⁩/sdk⁩/ndk-bundle.
Echo path:
catalin:~ catalin$ echo $ANDROID_NDK_HOME /Users/catalin/Library/Android/sdk/ndk-bundle

The logs are the same from above. Nothing changed. Should display the full path instead of /toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf: No such file or director as example?

Did you downloaded separately or comes with Android Studio?

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

Did you downloaded separately or comes with Android Studio?

I've installed it from Android Studio, but not the 'NDK bundle' version. I installed the 'NDK (Side-by-side)'

@catalin-florescu
Copy link
Author

I've downloaded the NDK separately. Now it works! You can specify in documentation to have the NDK Side-by-side version or separately, not the bundle.
Thank you!

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

@catalin-florescu , actually long ago I used the NDK bundle installed from Android Studio and it worked fine.

However, nice that you managed to setup everything correctly.

I consider this issue is resolved.

@catalin-florescu
Copy link
Author

Well, libswscale.so is not generated in all architectures.. Could be a problem from me? I don't get any errors during build.

@Javernaut
Copy link
Owner

@catalin-florescu , interesting. Let me check it out.
Meanwhile, please tell me for what arch's the libswsacle.so is generated.

@catalin-florescu
Copy link
Author

None of them

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

  1. Have you changed the script anyhow?

  2. Here is a link to Travis CI build log when I set the script to use FFmpeg 4.2.
    https://travis-ci.org/Javernaut/ffmpeg-android-maker/builds/568848418#L7978
    The link points to a specific line that lists enabled libraries (parts) of the FFmpeg to build. Can you check what libraries are listed there in your case?

  3. Also if you scroll this Travis CI build log to the very bottom you will see the content of the stats/text-relocations.txt. In my case it lists all *.so libraries that were build and libswscale is listed there.
    Could you please also post the content of your text-relocations.txt?

@Javernaut
Copy link
Owner

Javernaut commented Sep 9, 2019

@catalin-florescu , FYI you can save some time building the FFmpeg only for 1 architecture (for testing purposes). For that you can temporary comment 3 of 4 lines that call build function like this:

build armeabi-v7a 16
#build arm64-v8a 21
#build x86 16
#build x86_64 21

You can find it in the very bottom of the ffmpeg-android-maker.sh file.

@Javernaut Javernaut reopened this Sep 9, 2019
@catalin-florescu
Copy link
Author

I haven't changed other things than NDK_HOME.
I've manage to make all files after downloaded again NDK.
You can close the issue.
Thanks again for your help!

@lectricas
Copy link

user1@NOTEBOOK-TOxLEc:.../StudioProjects/WhatTheCodec/ffmpeg-android-maker$ ./ffmpeg-android-maker.sh -dav1d
Getting source code of the component: libdav1d
Ensuring sources of libdav1d in dav1d-0.7.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 801k 100 801k 0 0 500k 0 0:00:01 0:00:01 --:--:-- 500k
Getting source code of the component: ffmpeg
Using FFmpeg source archive: 4.3.1
Ensuring sources of ffmpeg in ffmpeg-4.3.1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.7M 100 10.7M 0 0 2920k 0 0:00:03 0:00:03 --:--:-- 2919k
Building the component: libdav1d
rm: cannot remove 'crossfile-x86.meson': No such file or directory
/mnt/c/Users/user1/StudioProjects/WhatTheCodec/ffmpeg-android-maker/scripts/libdav1d/build.sh: line 33: build/x86: No such file or directory
/mnt/c/Users/user1/StudioProjects/WhatTheCodec/ffmpeg-android-maker/scripts/libdav1d/build.sh: line 42: cd: build/x86: No such file or directory
/mnt/c/Users/user1/StudioProjects/WhatTheCodec/ffmpeg-android-maker/scripts/libdav1d/build.sh: line 44: -j: command not found
install: missing file operand
Try 'install --help' for more information.
user1@NOTEBOOK-TOxLEc:.../StudioProjects/WhatTheCodec/ffmpeg-android-maker$ echo $ANDROID_NDK_PATH

user1@NOTEBOOK-TOxLEc:.../StudioProjects/WhatTheCodec/ffmpeg-android-maker$ echo $ANDROID_NDK_HOME
/mnt/c/Users/user1/AppData/Local/Android/Sdk/ndk/22.0.7026061
user1@NOTEBOOK-TOxLEc:.../StudioProjects/WhatTheCodec/ffmpeg-android-maker$ echo $ANDROID_SDK_HOME
/mnt/c/Users/user1/AppData/Local/Android/Sdk

this is done with wsl windows

@Javernaut
Copy link
Owner

@lectricas , seems like you don't have make tool installed. And please use NDK prior to 22. It can have issues with this script.

@lectricas
Copy link

thanks for such a quick reply. I've just manage to successuly build and run WhatThatCodec using docker. Seems like everything is working fine. Thank you

@Javernaut
Copy link
Owner

@lectricas you are welcome. Also nice to hear the Docker image is useful :)

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

3 participants