indigo-astronomy / indigo

INDIGO is a system of standards and frameworks for multiplatform and distributed astronomy software development designed to scale with your needs.
http://www.indigo-astronomy.org
Other
142 stars 63 forks source link

dsusb.a is 'incompatible' #432

Closed RusDavies closed 2 years ago

RusDavies commented 2 years ago

On a fresh build of Indigo, following the instructions in README.md for Fedora, results in this error:

/usr/bin/ld: skipping incompatible bin_externals/libdsusb/lib/Linux/x86//libdsusb.a when searching for -ldsusb
/usr/bin/ld: cannot find -ldsusb
collect2: error: ld returned 1 exit status
make[2]: *** [../../Makefile.drv:123: /home/russell/Development/indigo-astronomy/indigo/build/drivers/indigo_aux_dsusb] Error 1
make[2]: Leaving directory '/home/russell/Development/indigo-astronomy/indigo/indigo_drivers/aux_dsusb'
make[1]: *** [../Makefile.drvs:66: aux_dsusb/] Error 2
make[1]: Leaving directory '/home/russell/Development/indigo-astronomy/indigo/indigo_drivers'
make: *** [Makefile:148: all] Error 2

For reference:

[...]$ tree indigo_drivers/aux_dsusb/bin_externals/libdsusb/lib/Linux/x86/
indigo_drivers/aux_dsusb/bin_externals/libdsusb/lib/Linux/x86/
└── libdsusb.a

And also:

[...] $ uname -a
Linux fedora 5.15.12-200.fc35.x86_64 #1 SMP Wed Dec 29 15:03:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Since -Lbin_externals/libdsusb/lib/Linux/x86/ seems correct for my OS and architecture, and given libdssusb.a is the only library in that directory, and yet yet that library is apparently 'incompatible', then what am I missing?

RusDavies commented 2 years ago

Just tried on Ubuntu. Builds without issues.

RusDavies commented 2 years ago

And now I double-check myself, I see that I read too fast and that in fact it's picking up the wrong architecture. Will investigate that.

RusDavies commented 2 years ago

The issue is with the detection logic for ARCH_DETECTED in line 110 of the Makefile.

I'm working on a patch. However, I'm slowed because even having fixed that, other issues are preventing build on Fedora. Working on it.

rumengb commented 2 years ago

Actually this is a hack. We added this because need to distinguish x64 vs x32 in docker as we use docker to build it on different architectures. So if you know how can we distinguish those architectures in docker in a better way we will be glad...

RusDavies commented 2 years ago

Ah, docker. I'd have to look at that.

For now, I've created a pull request, that at least allows building for Fedora x86_64. Given this builds on a hack, perhaps it should be rejected in favour of a proper solution.

https://github.com/indigo-astronomy/indigo/pull/433

rumengb commented 2 years ago

fixed with commit f461784e8324fae812981414b74abcd97524be73

rumengb commented 2 years ago

hey Russell, Maybe it is a good idea to provide RPM build. Since you are Fedora user, Can you help us with this?

RusDavies commented 2 years ago

Funnily enough, getting this packaged and into the Fedora repos was one of the outcomes I'm seeking to achieve. Let's see how far I can progress, with time available.