Jump to content

  • Log In with Google      Sign In   
  • Create Account


Intel C++ compiler optimization flag


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 lride   Members   -  Reputation: 633

Like
0Likes
Like

Posted 05 October 2012 - 06:21 PM

I need to compile a source with full optimization; however, I get the following error

Command line error D8016: '/ZI' and '/Ox' command-line options are incompatible

the source:


[source lang="cpp"]#include <SFML/System.hpp>#include <algorithm> #include <iostream> void func1() { // generate data const unsigned arraySize = 32768; int data[arraySize]; for (unsigned c = 0; c < arraySize; ++c) data[c] = std::rand() % 256; //std::sort(data, data + arraySize); // test long long sum = 0; sf::Clock clock; for (unsigned i = 0; i < 50000; ++i) //just to see the difference { // primary loop for (unsigned c = 0; c < arraySize; ++c) { //int t = (data[c] - 128) >> 31; //sum += ~t & data[c]; if (data[c] >= 128) sum += data[c]; } } float elapsedTime=clock.getElapsedTime().asSeconds(); std::cout << elapsedTime << std::endl; std::cout << "sum = " << sum << std::endl; std::cin.get();}int main(){ func1();}[/source]

Edited by lride, 05 October 2012 - 06:24 PM.

An invisible text.

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 8287

Like
2Likes
Like

Posted 06 October 2012 - 07:04 AM

Nothing to do with the source, you're trying to combine compiler optimization flag Ox with debug flag ZI which is invalid. Go into your project options and uncheck the debug flag.

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#3 lride   Members   -  Reputation: 633

Like
0Likes
Like

Posted 06 October 2012 - 12:03 PM

There are three options. I tried all of them and still get errors

1)C7 compatible(/Z7) 1>cl : Command line error D8016: '/Ox' and '/RTC1' command-line options are incompatible
2)Program Database(/Zi) 1>cl : Command line error D8016: '/Ox' and '/RTC1' command-line options are incompatible
3)Program Database for Edit and Continue(/ZI) 1>cl : Command line error D8016: '/ZI' and '/Ox' command-line options are incompatible

Edited by lride, 06 October 2012 - 12:09 PM.

An invisible text.

#4 lride   Members   -  Reputation: 633

Like
0Likes
Like

Posted 06 October 2012 - 12:37 PM

Never mind, I fixed it.
Thanks for the reply
An invisible text.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS