Forums › BB Series Discussions › Error compiling Linux sample code
- This topic has 13 replies, 4 voices, and was last updated 6 years, 1 month ago by
kaiser.
- AuthorPosts
ray62202ParticipantI have been getting an error building the linux sample code:
Linker Error for sample project – device_info
…signal_hound_sdk_10_25_18/device_apis/bb_series/linux/sample_projects/device_infoI installed the .so library per BB instructions:
…signal_hound_sdk_10_25_18/device_apis/bb_series/linux/lib/Ubuntu 18.04/libbb_api.so.4.0.2The build stops with a linker error:
g++ -Wall main.cpp -o dev_info -Wl,-rpath /usr/local/lib -lbb_api/usr/bin/ld: out of memory allocating 30374008975618 bytes after a total of 282624 bytes
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target ‘all’ failed
make: *** [all] Error 1I have tried building on Linux Mint 19 (from Ubuntu 18.04) and on a real Ubuntu 18.04 LTE installation with the same results.
What am I missing? Any suggestions on what to check, since I assume your sample programs build an work fine.
– Ray
Linux info
>cat /proc/version
Linux version 4.15.0-38-generic (buildd@lcy01-amd64-023) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018>uname -a
Linux WE31900 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v –with-pkgversion=’Ubuntu 7.3.0-27ubuntu1~18.04′ –with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs –enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ –prefix=/usr –with-gcc-major-version-only –program-suffix=-7 –program-prefix=x86_64-linux-gnu- –enable-shared –enable-linker-build-id –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –libdir=/usr/lib –enable-nls –with-sysroot=/ –enable-clocale=gnu –enable-libstdcxx-debug –enable-libstdcxx-time=yes –with-default-libstdcxx-abi=new –enable-gnu-unique-object –disable-vtable-verify –enable-libmpx –enable-plugin –enable-default-pie –with-system-zlib –with-target-system-zlib –enable-objc-gc=auto –enable-multiarch –disable-werror –with-arch-32=i686 –with-abi=m64 –with-multilib-list=m32,m64,mx32 –enable-multilib –with-tune=generic –enable-offload-targets=nvptx-none –without-cuda-driver –enable-checking=release –build=x86_64-linux-gnu –host=x86_64-linux-gnu –target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
RogerModeratorHi Ray,
Unfortunately I have not been able to reproduce the issue you are having, and the debug message is too general to point me to anything specific.
The fact that you are receiving the exact same error message on two completely different systems, one of which is the same that we test on (18.04 LTS), suggests to me that the issue lies somewhere in your configuration or installation process. In debugging I would focus on peculiar commonalities shared by your two environments.
Let me know if you get any more specific debugging feedback, or if you want to share output that shows your exact process / command sequence.
Regards,
Roger
ray62202ParticipantI installed a fresh copy of Ubuntu LTS (downloaded ISO image yesterday from Ubuntu) for testing, so it is ‘factory new’.
Yeah, that linker message was so vague as to be useless (typical).The only other thing I had to do was to install g++ in the standard manner – $sudo apt install g++.
I listed the details of the compiler config in the forum post.I deleted everything and extracted the SDK from a new download, and captured the installation sequence below:
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$ ldconfig -v -n .
.:
libbb_api.so.4 -> libbb_api.so.4.0.2 (changed)
libftd2xx.so -> libftd2xx.so
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$ ln -sf libbb_api.so.4 libbb_api.so
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$ sudo cp libbb_api.* /usr/local/lib
[sudo] password for dunn874:This is the (SDK) library after the install, with libbb_api.so and libbb_api.so.4 as a soft links.
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$ ls -la
total 14836
drwxr-xr-x 2 dunn874 riocdev 4096 Nov 1 10:49 .
drwxr-xr-x 5 dunn874 riocdev 4096 Oct 18 08:53 ..
lrwxrwxrwx 1 dunn874 riocdev 14 Nov 1 10:49 libbb_api.so -> libbb_api.so.4
lrwxrwxrwx 1 dunn874 riocdev 18 Nov 1 10:49 libbb_api.so.4 -> libbb_api.so.4.0.2
-rw-r–r– 1 dunn874 riocdev 14957792 Oct 17 16:21 libbb_api.so.4.0.2
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$This is the /usr/local/lib after the install
NOTE! the soft-link libbb_api.so is NO LONGER A LINK, BUT A COPY OF THE FILEdunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$ ls -la /usr/local/lib
total 43840
drwxr-xr-x 4 root root 4096 Nov 1 10:50 .
drwxr-xr-x 10 root root 4096 Jul 17 06:23 ..
-rw-r–r– 1 root root 14957792 Nov 1 10:50 libbb_api.so
-rw-r–r– 1 root root 14957792 Nov 1 10:50 libbb_api.so.4
-rw-r–r– 1 root root 14957792 Nov 1 10:50 libbb_api.so.4.0.2
drwxrwsr-x 4 root staff 4096 Jul 17 06:46 python2.7
drwxrwsr-x 3 root staff 4096 Jul 17 06:24 python3.6
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/lib/Ubuntu 18.04$Build the device_info project:
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/sample_projects/device_info$ make
g++ -Wall main.cpp -o dev_info -Wl,-rpath /usr/local/lib -lbb_api/usr/bin/ld: out of memory allocating 30374008975618 bytes after a total of 282624 bytes
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target ‘all’ failed
make: *** [all] Error 1
dunn874@WE31900:~/Projects/signal_hound_sdk/device_apis/bb_series/linux/sample_projects/device_info$Same problems
Please advise asap, we are on a tight schedule for a demonstration.
– Ray
AndrewModeratorRay,
Some other ideas,
1) Are you using a 32-bit OS? Our Linux APIs are compatible only for 64-bit OS’s.
2) Maybe try getting rid of all the soft links? Rename the main library to libbb_api.so and see if that resolves the issue.Regards
AndrewModeratorFor anyone who is seeing this same issue, the Ubuntu 18.04 BB60C .so file was corrupted. The .so file was re-uploaded in the SDK on 11-6-2018.
kaiserParticipantIs it possible that we’re seeing something like that also in the sm_api.so file in the downloads? Getting a very similar linker error
“/usr/bin/ld: out of memory allocating 1189565853043737155 bytes after a total of 186720 bytes”
when trying to compile a very basic program (just trying to open the device), and I just earlier today used wget to get the file, unzip it and grab the .so file.
Thoughts?
AndrewModeratorKaiser,
I will look into this.
Which build of the SM API are you using and on which OS?Thanks,
Andrew
kaiserParticipantUbuntu 18.04.1 LTS x86_64
Fresh install.
ray62202ParticipantKaiser, I was able to find out that the library image was corrupted with the following command:
$ readelf –a libbb_api.so.4.0.2
The output of readelf will tell you about the different pieces of the library, and if they are corrupted. Substitute the file name of the library you are using in the command.
Andrew updated the library for me, and I’ve been cruising along just fine ever since.
– Ray
kaiserParticipantThanks ray, I get essentially the same error that the link gives me “Error: Reading 1189565853043737155 bytes extends past end of file for string table” among a bunch of other errors.
So I assume that the file is corrupted, or I did something really wrong 🙂
kaiserParticipantAny movement on this front? Should I try to download again, or try something else?
AndrewModeratorHi Kaiser,
Thanks for your patience.
I just returned from a 4 day weekend. I should be able to look into this in the next day or two.
Regards,
Andrew
AndrewModeratorHi Kaiser,
I updated the SDK with a rebuilt SM API 1.1.7. I tested it on Ubuntu 18.04 before uploading. I’m not sure where it got corrupted before. Thanks for your patience.
Regards,
Andrew
kaiserParticipantLooks good and working on this end. Thanks all!
- AuthorPosts
You must be logged in to reply to this topic.