Compiling boost without AVX - c++

What is the correct way to compile Boost without AVX/AVX2 on a machine that supports AVX?
OS: Ubuntu
Compiler GCC 5.4
Boost version: 1.66

By default the compiler will generate code that does not require AVX/AVX2, and Boost does not require AVX/AVX2 by default either. So, you don't need to do anything to make the compiled code compatible with CPUs lacking AVX.
Note that this doesn't mean that AVX instructions won't be generated at all. In some places Boost libraries perform runtime detection of CPU features and use AVX only if available. For example, Boost.Log does that.

Related

How to bypass runtime flag check in DPDK

ERROR: This system does not support SSE4_1
Please check that RTE_MACHINE is set correctly.
Is there any way to bypass this flag in DPDK?
DPDK version 17.08.1
OS : fedora 20
Is there any way to bypass this flag in DPDK?
Sure, the DPDK needs to be compiled without SSE4.1, so it will not require SSE to be present at runtime.
If we do not care about portability, the best way to deal with the issue is to compile DPDK with RTE_MACHINE="native", i.e. using x86_64-native-linuxapp-gcc config (or similar).
This will use the most CPU capabilities your local host supports, but might somewhat limit the portability to other CPUs.
To make it more portable, set RTE_MACHINE="snb" to compile DPDK for SandyBridge CPUs and newer.
The full list of supported machines are listed here:
http://dpdk.org/browse/dpdk/tree/mk/machine
EDIT:
According to DPDK 17.08 Release Notes:
Starting with version 17.08, DPDK requires SSE4.2 to run on x86. Previous versions required SSE3.
That was due to the new vPMD functionality, as described in the patch discussion.
dpdk-stable-XX\mk\machine\native\rte.vars.mk
--ifeq ($(SSE42_SUPPORT),)
++ifneq ($(SSE42_SUPPORT),)

C++11 (std=c++0x) support on Vortex86DX i486 hardware and gcc

I´m building a project that I need to run in a Vortex86DX i486 embedded system. It comes with a so called D&P XLinux (http://www.dmp.com.tw/tech/os-xlinux/).
There I need support for C++11 (std=c++0x), where the compiler that comes with the board does not support - gcc version 3.2.3.
I was checking the GCC page to check how shall I upgrade my current compiler and I have my doubts about how to upgrade the compiler and choose the correct version:
a) Which is the first GCC version that supported C++11 ?
b) Does that version has support for i486 ? Can I built it for my Vortex hardware ?
c) Is there a better approach to support C++11 on this hardaware ?
In fact, my other alternative is to change the code not to use C++11. That will be a huge effort and some libraries (like cryptopp) may make this very problematic.
Thanks for hints and help.

Compiling OpenCV3.0.0 with mingw32-builds

I've built OpenCV 2.4.8 in the past with the regularly distributed mingw32, but since I'm migrating to use newer C++11 standard functions and OpenCV3 formats and functionalities, I had to change my compiler to mingw32-builds.
It certainly supports the C++11 functions I want to use, but I can't compile OpenCV3 properly.
Some other questions suggested two approaches
Disabling WITH_IPP during CMake
Commenting out add_extra_compiler_option(-Werror=non-virtual-dtor) in the CMake configuration file
Although making these modifications made it compile, IPP is a performance enhancing library and that warning message is a high level warning which may lead to future bugs.
Is there anyway to compile OpenCV3.0.0 without these quirks?
Additional information:
I've already compiled the exact same build on Ubuntu and everything (from c++11 to opencv3) went fine, no errors, no high level warnings, no quirks
I am now working under Windows 8.1 64-bit, but focused on compiling 32-bit binaries (for compatibility)

Binary compatibility (using C++11) on older distro versions

I am using GCC to compile a C++ application on Ubuntu 13. I want to be able to use C++11 features in my code, but at the same time still be able to produce a binary that my users can run on older versions of Ubuntu.
If I compile on Ubuntu 13 with the latest version of GCC my binary will not run on Ubuntu 12 since glibc is not forward compatible:
(How compatible are different versions of glibc?)
What are my options?
Is this even possible without requiring my users to jump through massive hoops?
If not, what do my users have to do to be able to run the binary (i.e. can they install the newer glibc on the older version of Ubuntu)?
Note: I don't not want to consider statically linking glibc since:
I've read that this is a very bad idea
Licensing issues
Cross-distribution compatibility issues
Currently my application does not use any C++11 features and I compile on an older version of Ubuntu with an older version of GCC to avoid this problem. But it makes me sad not being able to use the latest and greatest language features :(
You can try to use Boost Libraries which have quite the same features as C++11 and is "more retro-compatible" than C++11 : it will easily compile on older version of Ubuntu.
Otherwise the best option might be to ask to the users of Ubuntu 12.04 to upgrade there GCC from 4.6 to 4.7 or more recent :
http://www.swiftsoftwaregroup.com/upgrade-gcc-4-7-ubuntu-12-04/
You are asking "how do I use code that isn't on older systems".
The answer is of course, "Include the code with your project".
If you think through what you're asking, you'll realize that in any case, you'll need the code for the c++11 functions in libstdc++. So if they aren't on ubuntu 12, YOU have to add them. Therefore, you'd have to have it statically linked. it's the only way to ensure it will run on an arbitrary ubuntu12 system.
Well you could make a fancy installation, but in the end, it'd just be your apps "dynamically linking" to the libstdc++, so it may as well be statically linked, since no other program is going to be looking for it on ubuntu12
In general, a c++ library is compatible only if the same compiler is used and (!) the versions of the compilers are matching (you might be lucky, though). There is no way to be portable in this sense, besides writing C-code.

How to install a simple Intel C/C++ compiler on a 64-bit Ubuntu system?

I need to compile c/c++ code, by running a build.sh file.
The instruction on the program (that i want to run) says it needs to be compiled by a Intel's compiler1.
After searching on the net I came across information on what to do.
Some people said that we must install first a 32-bit libraries:
https://help.ubuntu.com/community/InstallingCompilers
Others said that we must, first of any installation, change some things:
http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu
In the other hand, Intel's page show many suites:
http://software.intel.com/en-us/c-compilers
while the only thing that I want is simply Intel's C/C++ compiler.
Can somebody be so gentle to give me the directions on how to install a Intel's compiler on a 64-bit Ubuntu system?
Footnote 1 / Editor's note: other x86 compilers including GCC and clang (and MSVC on Windows), support Intel's SSE/AVX intrinsic functions, but Intel's compiler comes with some libraries such as SVML (e.g. SIMD sin and exp) and MKL which some code might need. Other compilers can be used with SVML if you have it installed separately.
In short, it's worth trying with other compilers, especially if you understand why something says it needs to be compiled by ICC, if getting ICC would be inconvenient. But you might (or might not) be missing out on performance for packages that detect what's available instead of just erroring.
for non commercial use you can download it from Intel
EDIT:
the Intel® System Studio 2016 includes a c++ compiler.
I've tried the 32-bit version of it, the non-commecial one. I don't think it differ from the 32-bit on basic stuff related to installation. Open this and go to compilers and libraries section and you will see the C/C++ compiler. After download it read the files in doc folder; it includes how to install/use/get a key to compiler etc.
You need to install gcc compiler through apt-get install gcc
Look on example here: Install GCC