stratux icon indicating copy to clipboard operation
stratux copied to clipboard

fancontrol compilation fails --> fails stratux compilation

Open nachobacanful opened this issue 3 years ago • 10 comments

  1. Stratux version: Latest Source, 7eeb32acf6fa31dc86ac94f95975e573f2619ae4

  2. Stratux config: SDR: single ? IDK
    GPS: no
    AHRS: no

  3. EFB app and version: EFB platform: Raspbian GNU/Linux 10 (buster) armv7l EFB hardware: Pi 4B

  4. Description of your issue: Can't compile the project, see below output, please help :). I want to use this SDR. Though the SDR is not relevant until I can get this to compile.

I have done the following:

  • installed libsdr and libsdr-dev, and added to path
  • Install Go and add to path
  • install wiringPi and add to path
  • fixed compilation dump1090 format truncation and implicit fallthrough issues
    • changed to +CFLAGS+=-O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0
  • fixed the #cgo CFLAGS mentioned here

I have looked everywhere for this error and haven't found a solution. I don't know much about Go or this project to be able to fix this myself. Any help is appreciated.

make output:

make xdump978 xdump1090 xgen_gdl90 fancontrol
make[1]: Entering directory '/home/user1/stratux'
cd dump978 && make lib
make[2]: Entering directory '/home/user1/stratux/dump978'
gcc -c -O2 -g -Wall -Werror -Ifec -fpic -DBUILD_LIB=1 dump978.c fec.c fec/decode_rs_char.c fec/init_rs_char.c
gcc -shared -lm -o ../libdump978.so dump978.o fec.o decode_rs_char.o init_rs_char.o
make[2]: Leaving directory '/home/user1/stratux/dump978'
sudo cp -f ./libdump978.so /usr/lib/libdump978.so
git submodule update --init
cd dump1090 && make
make[2]: Entering directory '/home/user1/stratux/dump1090'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/user1/stratux/dump1090'
go get -t -d -v ./main ./godump978 ./uatparse ./sensors
go build -ldflags "-X main.stratuxVersion=`git describe --tags --abbrev=0` -X main.stratuxBuild=`git log -n 1 --pretty=%H`" -p 4 main/gen_gdl90.go main/traffic.go main/gps.go main/network.go main/managementinterface.go main/sdr.go main/ping.go main/uibroadcast.go main/monotonic.go main/datalog.go main/equations.go main/sensors.go main/cputemp.go main/lowpower_uat.go
go get -t -d -v ./main
go build -ldflags "-extldflags -static -X main.stratuxVersion=`git describe --tags --abbrev=0` -X main.stratuxBuild=`git log -n 1 --pretty=%H`" -p 4 main/fancontrol.go main/equations.go main/cputemp.go
# command-line-arguments
main/fancontrol.go:229:24: not enough arguments in call to daemon.New
        have (string, string, []string...)
        want (string, string, daemon.Kind, ...string)
make[1]: *** [Makefile:22: fancontrol] Error 2
make[1]: Leaving directory '/home/user1/stratux'
make: *** [Makefile:14: all] Error 2

nachobacanful avatar Aug 22 '20 05:08 nachobacanful

I have a fan always on my pi, therefore it seems like I may not need the fancontrol.

I have removed the fancontrol from the all make target and it compiled, not sure if this will have any side effects for the program

nachobacanful avatar Aug 22 '20 06:08 nachobacanful

In our Stratux Europe Edition a fix has recently been committed, maybe you try it with your version:

https://github.com/b3nn0/stratux/commit/7b32f2a82450cfd42c31b4793fb220a8a98ad53a

VirusPilot avatar Aug 22 '20 06:08 VirusPilot

That might of fixed the initial issue. I changed from:

srv, err := daemon.New(name, description, []string{}...)

to (followed what the error wanted):

srv, err := daemon.New(name, description, daemon.SystemDaemon ,[]string{}...)

Now I get a wiringpi error. wiringpi comes preinstalled with raspbian. I would like to uninstall it and compile it from source but I read that this is not recomended.

Any suggestions on how to fix the following?

make xdump978 xdump1090 xgen_gdl90 fancontrol
make[1]: Entering directory '/home/user1/stratux'
cd dump978 && make lib
make[2]: Entering directory '/home/user1/stratux/dump978'
gcc -c -O2 -g -Wall -Werror -Ifec -fpic -DBUILD_LIB=1 dump978.c fec.c fec/decode_rs_char.c fec/init_rs_char.c
gcc -shared -lm -o ../libdump978.so dump978.o fec.o decode_rs_char.o init_rs_char.o
make[2]: Leaving directory '/home/user1/stratux/dump978'
sudo cp -f ./libdump978.so /usr/lib/libdump978.so
git submodule update --init
cd dump1090 && make
make[2]: Entering directory '/home/user1/stratux/dump1090'
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0 `pkg-config --cflags librtlsdr`  -c dump1090.c -o dump1090.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c anet.c -o anet.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c interactive.c -o interactive.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c mode_ac.c -o mode_ac.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c mode_s.c -o mode_s.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c net_io.c -o net_io.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c crc.c -o crc.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c demod_2000.c -o demod_2000.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c demod_2400.c -o demod_2400.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c stats.c -o stats.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c cpr.c -o cpr.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c icao_filter.c -o icao_filter.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c track.c -o track.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c util.c -o util.o
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c convert.c -o convert.o
gcc -g -o dump1090 dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2000.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o -lpthread -lm -lrt `pkg-config --libs librtlsdr`
fatal: No names found, cannot describe anything.
gcc -DMODES_DUMP1090_VERSION=\"\" -O2 -g -Wall -Werror -W -Wno-format-truncation -Wimplicit-fallthrough=0  -c view1090.c -o view1090.o
gcc -g -o view1090 view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o -lpthread -lm -lrt
make[2]: Leaving directory '/home/user1/stratux/dump1090'
go get -t -d -v ./main ./godump978 ./uatparse ./sensors
go build -ldflags "-X main.stratuxVersion=`git describe --tags --abbrev=0` -X main.stratuxBuild=`git log -n 1 --pretty=%H`" -p 4 main/gen_gdl90.go main/traffic.go main/gps.go main/network.go main/managementinterface.go main/sdr.go main/ping.go main/uibroadcast.go main/monotonic.go main/datalog.go main/equations.go main/sensors.go main/cputemp.go main/lowpower_uat.go
go get -t -d -v ./main
go build -ldflags "-extldflags -static -X main.stratuxVersion=`git describe --tags --abbrev=0` -X main.stratuxBuild=`git log -n 1 --pretty=%H`" -p 4 -o fancontrol main/fancontrol.go main/equations.go main/cputemp.go
# command-line-arguments
/usr/local/go/pkg/tool/linux_arm/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lwiringPi
/usr/bin/ld: /tmp/go-link-859737687/000016.o: in function `_cgo_26061493d47f_C2func_getaddrinfo':
/tmp/go-build/cgo-gcc-prolog:57: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status

make[1]: *** [Makefile:22: fancontrol] Error 2
make[1]: Leaving directory '/home/user1/stratux'
make: *** [Makefile:14: all] Error 2

nachobacanful avatar Aug 22 '20 07:08 nachobacanful

Try this from our Europe fork:

Prepare wiringpi for fancontrol and some more tools. Need latest version for pi4 support

wget https://project-downloads.drogon.net/wiringpi-latest.deb dpkg -i wiringpi-latest.deb rm wiringpi-latest.deb ldconfig

VirusPilot avatar Aug 22 '20 07:08 VirusPilot

Hi, I had the same problem with fancontrol, fixed the daemon issue, but now when I run "make" it completes ok but instead of "fancontrol" executable being created the exe is named "equations". I renamed it fancontrol, but when I run "make install" I get the following "Permission Denied" error, thanks in advance for any suggestions...

image

davesimpson99 avatar Dec 04 '20 21:12 davesimpson99

Try changing the Makefile in line 22 as follows (adding "-o fancontrol"), it might be related to your go version:

go build $(BUILDINFO_STATIC) -p 4 -o fancontrol main/fancontrol.go main/equations.go main/cputemp.go

VirusPilot avatar Dec 04 '20 21:12 VirusPilot

Thanks for the quick response! that fixed the file naming issue but I still get the Permission denied error on "make install"

davesimpson99 avatar Dec 04 '20 21:12 davesimpson99

you can solve that by running it with sudo, do:

sudo make install

its because it will install the binaries in your system, as a regular user you dont have enough permissions to write to the locations it will install at

nachobacanful avatar Dec 04 '20 22:12 nachobacanful

I'm running everything as sudo, logged in as root.

davesimpson99 avatar Dec 04 '20 22:12 davesimpson99

SOLVED line 42 of the Makefile is: cp -f fancontrol /usr/bin/fancontrol this copies fancontrol to a folder named /usr/bin/fancontrol changed to: cp -f fancontrol /usr/bin/ and all works now

davesimpson99 avatar Dec 09 '20 21:12 davesimpson99