O
O
Oleg Smirnov2016-11-11 14:20:53
C++ / C#
Oleg Smirnov, 2016-11-11 14:20:53

How to compile a program so that it works everywhere (g++)?

Hello! The question is: how should a program be compiled so that it can run on any machine (Intel and AMD) with optimizations enabled? Link to the program (my chess engine): https://github.com/sovaz1997/Zevra

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Pozharsky, 2016-11-11
@alex4321

1. separate the optimized functionality into a separate library.
2. compile it with various optimizations
3. in your code - decide on the plug-in version
4. connect it.
But it's probably easier to use source distribution and "in-place" building.

Y
Yuri Chudnovsky, 2016-11-11
@Frankenstine

1) The start module determines the type of processor used
2) Based on the results of the check, a dynamic connection of modules (.so) is called for the detected architecture.

M
Maxim Moseychuk, 2016-11-11
@fshp

Read about scheduling.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question