LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-08-2017, 01:56 AM   #1
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Rep: Reputation: 25
Linker finds earlier versions of Armadillo package


I am using the Armadillo linear algebra package with C++ and it is the GREATEST THING EVER! However some of the functions are not working and I think the problem is that the compiler/linker is finding the old version 4 .so files instead of the newer version 8. I need to know how to fix the path or force the usage of the newer version. Please help.
 
Old 09-08-2017, 10:07 AM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I had the latest armadillo version from the Debian repos "7.960.1 (Northern Banana Republic Deluxe)" installed on my machine.

I downloaded version 8.100.1 from here: http://arma.sourceforge.net/download.html
Compiled and installed it and voila:
Code:
#include <iostream>
#include <armadillo>

using namespace arma;

int main() {
  std::cout << "Armadillo version: " << arma_version::as_string() << "\n";
}
Output:
Code:
$ g++ -o version version.cpp -larmadillo
$ ./version
Armadillo version: 8.100.1 (Feral Pursuits)
If you have both versions installed, i.e. ver. 8 in a non standard location, you can handle it when you compile:
Code:
g++ main.cpp -I/path/to/ver8_headers -L/path/to/ver8_lib -Wl,-rpath,/path/to/ver8_lib
HTH
 
1 members found this post helpful.
Old 09-08-2017, 11:16 AM   #3
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Original Poster
Rep: Reputation: 25
confirmed the compiler finds 4.320

The version routine confirms that the old 4.320 version is being used. Running 'find' I located 4 versions whose libs are extant, 4.320, two version 7 and the 8.100.1, all found their way to /usr/lib64 (hp Pavilion computer).

I used the install instruction in the README, i.e., "cmake . ; make ; make install" all as root. I expected that the new packages would replace the old. But even when I go into the dir created when I opened the 8.100.1 tarball and run the example1 program there, it finds the 4.320 files.

I am still looking at the various flags suggested and I may yet find a combo that works. Ideally I would probably like to switch versions based on the program I'm compiling, since some of the old functions seem to have gone away.
Thanks for the advice though, it is a big step in the right direction.
 
Old 09-08-2017, 03:30 PM   #4
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by rdx View Post
Ideally I would probably like to switch versions based on the program I'm compiling, ...
I now have versions 7 & 8 on my machine:
Code:
$ ll /usr/lib/libarma*
lrwxrwxrwx 1 root root    17 Aug 23 12:08 /usr/lib/libarmadillo.so -> libarmadillo.so.7
lrwxrwxrwx 1 root root    23 Aug 23 12:08 /usr/lib/libarmadillo.so.7 -> libarmadillo.so.7.960.1
-rw-r--r-- 1 root root 36136 Aug 23 12:08 /usr/lib/libarmadillo.so.7.960.1
lrwxrwxrwx 1 root root    23 Sep  8 14:56 /usr/lib/libarmadillo.so.8 -> libarmadillo.so.8.100.1
-rwxrwxr-x 1 root root 56800 Sep  8 08:47 /usr/lib/libarmadillo.so.8.100.1
To link against version 7:
Code:
$ g++ -o version version.cpp -larmadillo  # note the symlink libarmadillo.so above
$ ./version
Armadillo version: 7.960.1 (Northern Banana Republic Deluxe)
To link against version 8:
Code:
$ g++ -o version version.cpp -l:libarmadillo.so.8
$ ./version
Armadillo version: 8.100.1 (Feral Pursuits)

Last edited by norobro; 09-08-2017 at 03:31 PM.
 
Old 09-08-2017, 09:42 PM   #5
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 283

Original Poster
Rep: Reputation: 25
Possible progress

I finally succeeded in getting version to report 8.100.1 instead of 4.320. What I did was go to the /usr/local/include dir, where I found a file "armadillo" and a dir "armadillo_bits" and move them to respective files with a suffix '-4.320', then I copied the corresponding files from the version 8 set to files with a suffix of '-8.100.1', then I created a symbolic link "armadillo" pointing to "armadillo-8.100.1" and similar to the "_bits" dir. I haven't tested it beyond running your version program so I don't know if I created incompatibilities with the libs but I will find out soon. Wish me luck, lol.
 
  


Reply

Tags
armadillo c++_compiler


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to downgrade certain features to earlier versions? Sea Monster Linux Deepin 1 05-10-2017 08:49 AM
LXer: Ubuntu 14.04: Smoother than earlier versions (Gallery) LXer Syndicated Linux News 0 04-19-2014 12:11 AM
Mutt-1.5.21 configuration changes from earlier versions ? Terminator3000 Linux - Software 8 09-24-2012 02:56 AM
[SOLVED] Package requires earlier version of an installed package Doug Hutcheson Linux - Software 3 12-30-2010 09:55 PM
Earlier versions of gramps rpms marlaina1 Linux - Software 0 05-01-2002 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration