Skip to content

ADD: EIGEN: check using /openmp#36

Closed
danil-kalina wants to merge 2 commits intoKvanTTT:masterfrom
danil-kalina:master
Closed

ADD: EIGEN: check using /openmp#36
danil-kalina wants to merge 2 commits intoKvanTTT:masterfrom
danil-kalina:master

Conversation

@danil-kalina
Copy link

No description provided.

Comment on lines +197 to +204
#ifdef USE_EIGEN_BACKEND
if(Eigen::nbThreads() <= 1) {
cout << "Too Few Eigen Threads: " << Eigen::nbThreads() << endl;
cout << "Open «Project Properties»" << endl;
cout << "Go To «Configuration Properties» → «C/C++» → «Language»" << endl;
cout << "Set «Open MP Support» = «Yes(/openmp)»" << endl;
}
#endif // USE_EIGEN_BACKEND
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the intrusction is relevant only for Windows when using Visual Studio (I don't have projects when I use CLion). The check should be extended to cover it.

Also, I suppose a single thread is a valid option (it can be used for testing).

Consider the following fix:

#ifdef USE_EIGEN_BACKEND
  if(Eigen::nbThreads() == 0) {
    cout << "There is no Eigen threads." << endl;
#ifdef MSVC
    cout << "If you use Visual Studio try the following:" << endl;
    cout << "Open «Project Properties»" << endl;
    cout << "Go To «Configuration Properties» → «C/C++» → «Language»" << endl;
    cout << "Set «Open MP Support» = «Yes(/openmp)»" << endl;
#else
    cout << "Enable Open MP support or increase the number of Eigen threads" << endl;
#endif
  }
#endif

@KvanTTT
Copy link
Owner

KvanTTT commented Feb 2, 2026

fixed by #41

@KvanTTT KvanTTT closed this Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants