gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
279 stars 62 forks source link

cannot compile with -DEIGEN3=off #1249

Open alaingdl opened 2 years ago

alaingdl commented 2 years ago
 from /home/gdl/src/basic_op_new.cpp:26:
/home/gdl/src/includefirst.hpp: In function ‘int maxNumberOfThreadsForDSFMT()’:
/home/gdl/src/includefirst.hpp:96:15: error: ‘min’ is not a member of ‘std’
   return std::min (DSFMT_MAX_PARALLEL_SEEDS,omp_get_num_procs());
alaingdl commented 2 years ago

Sorry for the quick message, but no time at that time. It seems that just adding #include <algorithm> is enough from my preliminary tests (may be Eigen3 is doing that include ?)

But I have a side effect unclear for me : if -DEIGEN3=off then DSFMT is not activated. Why ? @GillesDuvert

GillesDuvert commented 2 years ago

dSFMT outputs need to be in aligned memory variables. Until now (C++11) this was only ascertained if Eigen:: was used, since in this case only all memory allocations are made with EIGEN_ALIGN16 in the GDL (historical) code and the gdlAlignedMalloc() function. It is now perfectly possible to insure 16 (and, probably better, 32) alignments without resorting to Eigen::, and that would be a great improvement. indeed eigen/core.h includes which should be included directly in includefirst.hpp