Windos portability
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -57,3 +57,4 @@ out/x86
|
|||||||
out/x64
|
out/x64
|
||||||
src/Makefile.package-e
|
src/Makefile.package-e
|
||||||
src/Makefile.package.settings-e
|
src/Makefile.package.settings-e
|
||||||
|
/cmake/build/x64-Debug-Clang
|
||||||
|
|||||||
@ -69,7 +69,13 @@ LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
|||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
// use maximum number of available threads unless OMP_NUM_THREADS was set
|
// use maximum number of available threads unless OMP_NUM_THREADS was set
|
||||||
auto nthreads = std::to_string(omp_get_max_threads());
|
auto nthreads = std::to_string(omp_get_max_threads());
|
||||||
|
#if _WIN32
|
||||||
|
if (!getenv("OMP_NUM_THREADS")) {
|
||||||
|
_putenv_s("OMP_NUM_THREADS", nthreads.c_str());
|
||||||
|
}
|
||||||
|
#else
|
||||||
setenv("OMP_NUM_THREADS", nthreads.c_str(), 0);
|
setenv("OMP_NUM_THREADS", nthreads.c_str(), 0);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lammps_args.clear();
|
lammps_args.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user