Working with multiarch shared libraries on Debian - boost

I try to link my program with libboost_thread-mt on a Debian machine. It worked well on Debian 7 (wheezy) but it fails on Debian 8 (Jessie). On Wheezy the library version was 1.49, and on Jessie it is 1.55. The package is now using multi-arch scheme, which means that it used to be under /usr/lib and now it is under /usr/lib/i386-linux-gnu. What do I need to do in order to link it properly without using -L?

Related

Run or use GCC without install

Can I use GCC for e.g GCC4.0.3 without installation
In my macOS I have installed Clang xcode , and GCC from Homebrew
In my Linux they are installed as well
But I want to use GCC (Specially older version) besides most updated version
Like NVM that manage Node version and it lets you install many nodejs with different version on your system
I want to use GCC4 specially for science and compiling Old FORTRAN to make my Source codes run and see the results
In new OS both macOS and Linux when you install gcc it will install most updated and that is not useful for old fortran or old codes.
So In my solution i think its better to use gcc without install or even install gcc to custom directory folder and copy the codes in that directory and compile them but not to install as wide system and make incompatibility with default GCC and CLANG on system
Thanks in advance

full rebuild every time when building by CMake on Linux from Windows shared folder

I'm using a script to build Windows and Linux versions (from Windows). Linux build is done by sshing to Linux VM and running CMake build. Sources are located on Windows folder shared with Ubuntu VM.
CMake does full rebuild everytime, even if there's no changes since the last build. I suppose the problem is that CMake (or GCC?) doesn't get or reads incorrectly Windows NTFS timestamps.
Is there any cure for this?
CMake 3.7.1, GCC 4.9, Windows 10, Ubuntu 16.04 LTS, VirtualBox 5.1

Cross-compile for Windows under Ubuntu with Cmake

I'm trying to compile xc3sprog xc3sprog for Windows under Ubuntu 16.04. According to its README I do:
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake ..
In a result I have cmake_output.
I've installed libftdi with:
sudo apt install libftdi*
Could you help me?
EDIT:
As stated in comments, now I have a problem with #include <libusb/usb.h> which can't be found when make is eecuted. Where does it look for this file? In Linux host system headers or in mingw32 toolchain headers?
For me it seems that in toolchain, because when compiling Linux version there wasn't such an error (the different thing is that I can't find this libusb/usb.h file anywhere in system files, so I don't know how it work for Linux compilation...).

Build GCC 4.8.1 or higher on CentOS 6.5

I want to use GCC 4.8.1 or higher on a HPC machine with CentOS 6.5 which has a very old GCC. I do not have admin rights so everything has to be local. Do I have to really compile everything from source? Isn't there any rpm package that I can only install GCC with its dependencies? I found GCC rpms for CentOS 7 but not 6.5.
Without admin rights, building from source is
likely most reliable means to use gcc-4.8.1.
You can try installing (or extracting) gcc-4.8.1
from the redhat developer tool kit 2.0 described here
https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos
CentOS 7 RPM's are unlikely to work in general on CentOS 6.x.
The developer 2.0 toolkit was built on CentOS6

Installing gcc 4.8 on Debian

I want to start playing around with some of the newer C++11 features and it appears that the best support for this is with gcc 4.8, and Squeeze ships with 4.4.5.
However, I don't want to cause any "damage" to my current setup. What's the best way to get both versions of gcc running side-by-side? I'm concerned mostly at the large number of dependencies and that taking them all in to my current system may render it unstable.
Has anyone managed to do this, and what are the steps involved?
Failing that, I'll probably just create a VM and run an "unstable" Debian under that but it's a less-than-ideal solution.
If you install GCC from source just make sure you don't install it to /usr and it won't mess anything up. If you install it as your own user, not root, then there is zero chance of messing up the system.
See http://gcc.gnu.org/wiki/InstallingGCC for the almost-idiot-proof minimal configuration.
I have various versions built as my user and installed in ~/gcc/4.X for various X.
The only thing to be aware of using that set up is that the shared libraries for the new version aren't in the dynamic linker's default search path, so you need to use LD_LIBRARY_PATH or some other solution to ensure executables find the libs from 4.8, see the libstdc++ FAQ and the page it links to in the manual
I use a wrapper script call g++11 which simply calls the new version of GCC with -std=gnu++11 and passes a flag to the linker telling it to set the path to the 4.8 libs in the executable:
$HOME/gcc/4.8/bin/g++ -Wl,-rpath,$HOME/gcc/4.8/lib64 -std=gnu++11 -Wall -Wextra -g "$#"
I had the same problem, and didn't want to fully upgrade to testing.
Jessie (testing) now contains g++-4.8 which is compliant with C++11.
I used apt-pinning in the following way:
A source to jessie was added to /etc/apt/sources.list:
deb http://ftp.uk.debian.org/debian/ jessie main non-free contrib
/etc/apt/preferences was edited as such:
Package: *
Pin: release n=wheezy
Pin-Priority: 900
Package: gcc*
Pin: release n=jessie
Pin-Priority: 910
Then,
$ sudo aptitude update
$ sudo aptitude install gcc/jessie
At which point I selected the second presented option to resolve dependencies fully.
Debian has the package under the name gcc-4.8 (or for the c++ compiler, g++-4.8). Installing those packages will not mess up your OS, as long as you do not rename it to g++. The package is listed as experimental though.
Information on the package is here.
Update: g++-4.8 is now in testing, but an updated package is in unstable
Quick ones:
Just upgrade to testing, it is rock-solid and offers you several concurrent gcc versions. Similar for Ubuntu, on 12.10 I have gcc/g++ 4.4, 4.5, 4.6 and 4.7 in parallel.
Try the Debian backports archive, it may have a port of gcc 4.8.
Use virtualization: I prefer libvirt / kvm which is incredibly lightweight on Linux as it is kernel based. My amd64 server has two other 32 bit installations for that very reason.
Not really a SO question...
Have you tried chroot to install a newer Debian flavor?
you can play around without fear to break you working system.
install a Debian flavor that support you gcc version desired.
install a gcc version manually without affecting you working system.
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Chroot

Resources