bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.63k stars 731 forks source link

Building ffmpeg preset - bzip2: Cannot exec: No such file or directory #1353

Closed streamingdv closed 1 year ago

streamingdv commented 1 year ago

For further ffmpeg enhancements and tests I try to compile the ffmpeg preset on my x64 Windows 11 machine but I run into some issues which I can't solve. This might be an obvious thing but I'm a bit lost. I was able to build the javacpp part successfully. I followed the instructions for Windows x64 here . Whenever I execute the mvn clean install -Djavacpp.platform=windows-x86-64 inside the ffmpeg preset command I get following error on my machine

Building platform "windows-x86_64"
Installing "ffmpeg"
/mnt/d/GIT/javacv_test_build/x64/javacpp-presets/ffmpeg/cppbuild /mnt/d/GIT/javacv_test_build/x64/javacpp-presets
Decompressing archives...
Total bytes read: 8273920 (7.9MiB, 4.6MiB/s)
Total bytes read: 4392960 (4.2MiB, 3.8MiB/s)
Total bytes read: 6410240 (6.2MiB, 4.5MiB/s)
Total bytes read: 3665920 (3.5MiB, 2.8MiB/s)
Total bytes read: 5365760 (5.2MiB, 2.5MiB/s)
Total bytes read: 5908480 (5.7MiB, 1.9MiB/s)
Total bytes read: 2426880 (2.4MiB, 4.5MiB/s)
Total bytes read: 57804800 (56MiB, 2.5MiB/s)
Total bytes read: 4884480 (4.7MiB, 4.6MiB/s)
Total bytes read: 73205760 (70MiB, 15MiB/s)
Total bytes read: 5253120 (5.1MiB, 6.3MiB/s)
Total bytes read: 13281280 (13MiB, 11MiB/s)
Total bytes read: 24780800 (24MiB, 5.5MiB/s)
Total bytes read: 18923520 (19MiB, 4.7MiB/s)
Total bytes read: 911360 (890KiB, 3.8MiB/s)
Total bytes read: 389120 (380KiB, 11MiB/s)
Total bytes read: 41963520 (41MiB, 2.7MiB/s)
Total bytes read: 7598080 (7.3MiB, 4.6MiB/s)
Total bytes read: 29931520 (29MiB, 6.0MiB/s)
Total bytes read: 34918400 (34MiB, 4.7MiB/s)
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:42 min
[INFO] Finished at: 2023-05-12T01:19:46+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.5.9-SNAPSHOT:build (javacpp-cppbuild-install) on project ffmpeg: Execution javacpp-cppbuild-install of goal org.bytedeco:javacpp:1.5.9-SNAPSHOT:build failed: Process exited with an error: 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I tried to install bzip2 already manaully and I checked that C:\msys64\mingw64\bin and C:\msys64\usr\bin is on my path. So what exactly is the problem with bzip2? Could anyone help or is there a known workaround?

saudet commented 1 year ago

That probably just means you forgot to run c:\msys64\mingw64.exe

saudet commented 1 year ago

Or maybe that means we need to run pacman -S bzip2 ?

saudet commented 1 year ago

You need to make sure there's not another tar.exe somewhere on your system. If it picks up some version somewhere that doesn't have bzip2, that could cause that. Check what where tar and which tar tell you and make sure there are no other version of tar than the one that comes from MSYS2 anywhere on your system.

streamingdv commented 1 year ago

@saudet thanks you were right somehow there was a tar file in my sytem32 folder. Anyway during the compilation I get an error, do you know immediately what this is related to?

asm/nasm.c(1586): warning C4061: enumerator 'I_CMOVcc' in switch of enum 'opcode' is not explicitly handled by a case label
./x86\insnsi.h(10): note: see declaration of 'opcode'
asm/nasm.c(1586): warning C4061: enumerator 'I_Jcc' in switch of enum 'opcode' is not explicitly handled by a case label
./x86\insnsi.h(10): note: see declaration of 'opcode'
asm/nasm.c(1586): warning C4061: enumerator 'I_SETcc' in switch of enum 'opcode' is not explicitly handled by a case label
./x86\insnsi.h(10): note: see declaration of 'opcode'
asm/nasm.c(1586): warning C4061: enumerator 'I_none' in switch of enum 'opcode' is not explicitly handled by a case label
**./x86\insnsi.h(10): note: see declaration of 'opcode'
make: *** [Makefile:77: asm/nasm.obj] Error 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  55.427 s
[INFO] Finished at: 2023-05-12T02:08:47+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.5.9-SNAPSHOT:build (javacpp-cppbuild-install) on project ffmpeg: Execution javacpp-cppbuild-install of goal org.bytedeco:javacpp:1.5.9-SNAPSHOT:build failed: Process exited with an error: 2 -> [Help 1]
streamingdv commented 1 year ago

Edit: last problem seems to be related to the make command, I played around a bit as it seems it was using a different make executable but now I get

configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating config/config.h
config.status: config/config.h is unchanged
config.status: executing default-1 commands
../cppbuild.sh: line 107: make: command not found

Of course that's an obvious problem but I can execute the make command on the command line and which make prints out

/usr/bin/make

streamingdv commented 1 year ago

@saudet I close the issue now, I got all kind of different weird problems on my development machine for whatever reason. Probably because I have a lot of stuff installed on my PC because I use it for many different projects. I decided to setup a build Windows 10 VM and after following the instructions here and here it works completely fine and the build was successful. Thanks anyway for the useful inputs :)