-
Notifications
You must be signed in to change notification settings - Fork 10
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
Building gets stuck while compiling AudioBank.cpp (Linux aarch64) #114
Comments
Hello @jasaldivara. You are correct, compiling AudioBank requires relatively high amount of RAM and this happened to me when compiling directly on a Raspberry Pi. As a workaround, you can either add_library(Audio STATIC
include/AudioBank.hpp
interface/audio/Audio.hpp
interface/audio/SFXType.hpp
interface/audio/MusicType.hpp
# Compile AudioBank only when it is actually utilized on target platform:
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_PSP}>,src/AudioBank.cpp,>
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_WINDOWS}>,src/AudioBank.cpp,>
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_LINUX}>,src/AudioBank.cpp,>
# Compile audio backend (dummy when audio is not supported):
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_PSP}>,src/Audio_SDL_mixer.cpp,>
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_WINDOWS}>,src/Audio_SDL_mixer.cpp,>
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_LINUX}>,src/Audio_SDL_mixer.cpp,>
$<IF:$<BOOL:${SPELUNKY_PSP_PLATFORM_ANDROID}>,src/Audio_Dummy.cpp,>
) with: add_library(Audio STATIC
include/AudioBank.hpp
interface/audio/Audio.hpp
interface/audio/SFXType.hpp
interface/audio/MusicType.hpp
src/Audio_Dummy.cpp
) Regarding the asm, I think it would be possible without |
Also what came to my mind - try creating/increasing a swap file. |
How much RAM would be required for compiling AudioBank? I have 4 GB of RAM, and 4 GB of swap, but cc1plus is only taking 1.3GB. Maybe there are some parameter I could pass to GCC to use more RAM? |
Weird, I would expect it to work given the swap. |
When I disable audio on
Changed |
I spent some time today on this and made a working solution - I pushed it to I re-worked resource-compiler to output .asm files in the following manner: dbeef@dbeefstation-big:~/Desktop/spelunky-psp/cmake-build-debug/tools/resource-compiler$ cat test.txt
This is an arbitrary file
dbeef@dbeefstation-big:~/Desktop/spelunky-psp/cmake-build-debug/tools/resource-compiler$ ./resource-compiler test.txt test.txt.asm
Finished successfuly.
dbeef@dbeefstation-big:~/Desktop/spelunky-psp/cmake-build-debug/tools/resource-compiler$ cat test.txt.asm
.section .rodata
.align 1
.global test_txt
.hidden test_txt
test_txt:
.byte 84,104,105,115,32,105,115,32,97,110,32,97,114,98,105,116,114,97,114,121,32,102,105,108,101,10
.align 4
.global test_txt_length
.hidden test_txt_length
test_txt_length:
.4byte 26 Instead of outputting a header file, as in current master: #pragma once
// Generated from: test.txt, at: Sun Aug 1 16:43:38 2021
char data[] =
{
84,104,105,115,32,105,115,32,97,110,32,97,114,98,105,116,114,
97,114,121,32,102,105,108,101,10,
}; It is less accessible than the header-file version - you can't just include it and use the char*, now you need to define an extern symbol and know its name, that corresponds to the resource-compiled filename - in the end doesn't matter much as I encapsulate access to it in As I guessed, this removed a significant amount of work from the compiler - not only peak memory usage is smaller, but build is much faster:
I did the final verification by setting up a VM with 1 GB of RAM + 2 GB of swap. I used all 8 CPU cores. It froze building master, as in your case, but did finish successfully when building the .asm version. I leave the issue opened untill #115 is merged (so far only Windows is failing with these changes). |
Hi @dbeef I tried building your Now I have a working Spelunky_PSP with audio enabled. |
I'm trying to build Spelunky-PSP on Linux aarch64
My OS is Fedora 34 AArch64
My CPU is RK3399 (6 cores ARM 64 bits) and have 4 GB of RAM
I have followed the instructions, running first
./scripts/config-linux.sh
, and then./scripts/build-linux.sh
Building process starts fast, but then gets stuck on 20%, after:
It stays there for hours without making any progress. One of the CPU cores stays working at 100% while the other ones are not doing any hard work.
On the system monitor I see the process cc1plus (gcc c++ compiler?) is the one using 100% of one core and 1.3 GB of RAM. After examining it's command line I see it's trying to compile
src/audio/src/AudioBank.cpp
. When viewing it's opened files, the last one is 'src/audio/include/generated/title.wav.hpp', which is a 13MB source file containing raw data in the form of a char array.It has been there by 5 hours without making any progress.
Maybe 13 MB is too heavy for being parsed and compiled by g++? Is there any way to import the WAV binary files without compiling them as sources? I know in some ASM dialects there is an
incbin
command which just import a a binary raw file, but I don't know if c++ has something similar.The text was updated successfully, but these errors were encountered: