F5OEO / rpitx

RF transmitter for Raspberry Pi
GNU General Public License v3.0
3.93k stars 515 forks source link

Install for Alpine Linux #295

Open AlexCzar opened 1 year ago

AlexCzar commented 1 year ago

I'm running Alpine on my rpi 2B, can rpitx be installed there? Search came up empty. I inspected the installation script and it's a bit tricky, clones several repos, compiles stuff, requires dependencies which are either missing or maybe named differently on Alpine :| Edit: I've identified and installed appropriate dependencies, unfortunately compilation fails, see the comment below.

mfalkvidd commented 1 year ago

What happened when you tried?

AlexCzar commented 1 year ago

I haven't, it wouldn't have worked if I did, the first thing the installation script does is installing packages with apt, which isn't present on Alpine. I could've followed the script manually, but there are some packages needed which I'm unfamiliar with and which aren't present in Alpine, at least by the name in the installation script.

mfalkvidd commented 1 year ago

Could you list the missing packages? Maybe someone knows more about them.

AlexCzar commented 1 year ago

While writing an answer to your question, I did some more investigating and found the corresponding packages and installed them. Unfortunately, now I'm having issue compiling the components, starting with the csdr

; git clone https://github.com/F5OEO/csdr
; cd csdr
; make
Output ``` g++ -O3 -ffast-math -fdump-tree-vect-details -dumpbase dumpvect -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -funsafe-math-optimizations -Wformat=0 nmux.cpp tsmpool.cpp -g -lm -lrt -lfftw3f -DUSE_FFTW -DLIBCSDR_GPL -DUSE_IMA_ADPCM -L. -lcsdr -lpthread -Wno-unused-result -o nmux nmux.cpp: In function 'int main(int, char**)': nmux.cpp:155:9: error: 'fd_set' was not declared in this scope 155 | fd_set select_fds; | ^~~~~~ nmux.cpp:179:26: error: 'select_fds' was not declared in this scope 179 | FD_ZERO(&select_fds); | ^~~~~~~~~~ nmux.cpp:179:17: error: 'FD_ZERO' was not declared in this scope 179 | FD_ZERO(&select_fds); | ^~~~~~~ nmux.cpp:180:17: error: 'FD_SET' was not declared in this scope; did you mean 'L_SET'? 180 | FD_SET(listen_socket, &select_fds); | ^~~~~~ | L_SET nmux.cpp:185:34: error: 'select' was not declared in this scope 185 | int select_ret = select(highfd, &select_fds, NULL, NULL, NULL); | ^~~~~~ nmux.cpp:190:21: error: 'FD_ISSET' was not declared in this scope; did you mean 'CPU_ISSET'? 190 | if( FD_ISSET(listen_socket, &select_fds) && ((new_socket = accept(listen_socket, (struct sockaddr*)&addr_cli, &addr_cli_len)) != -1) ) | ^~~~~~~~ | CPU_ISSET nmux.cpp:246:21: error: 'FD_ISSET' was not declared in this scope; did you mean 'CPU_ISSET'? 246 | if( FD_ISSET(STDIN_FILENO, &select_fds) ) | ^~~~~~~~ | CPU_ISSET make: *** [Makefile:60: nmux] Error 1 ```

and librpitx

; git clone https://github.com/F5OEO/librpitx
; cd librpitx/src
; make
Output ```text -- snip -- g++ -std=c++11 -Wall -O3 -Wno-unused-variable -I /opt/vc/include -std=c++11 -Wall -O3 -Wno-unused-variable -fPIC -c gpio.cpp gpio.cpp: In member function 'void clkgpio::SetppmFromNTP()': gpio.cpp:719:18: error: 'ntp_adjtime' was not declared in this scope; did you mean 'adjtime'? 719 | status = ntp_adjtime(&ntx); | ^~~~~~~~~~~ | adjtime make: *** [Makefile:21: gpio.o] Error 1 ```
AlexCzar commented 1 year ago

Looks like the problems are either caused by incompatibilities with musl, or maybe missing a dependency which isn't mentioned in the install.sh script, I don't know enough about C/C++/libc ecosystem to figure it out further.