libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.84k stars 178 forks source link

Error when installing ffcv from ctime. #281

Open Godofnothing opened 1 year ago

Godofnothing commented 1 year ago

When trying to install ffcv following the instructions from the repo README.md, i.e creation of conda environment followed by pip install, I encounter the following issue when doing pip install ffcv:

 /root_dir/miniconda3/envs/pysparse/x86_64-conda-linux-gnu/include/c++/11.2.0/ctime:80:11: error: 'timespec_get' has not been declared in '::'
         80 |   using ::timespec_get;
            |           ^~~~~~~~~~~~
      error: command '/root_dir/miniconda3/envs/pysparse/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1

Having commented these lines

//#if __cplusplus >= 201703L && defined(_GLIBCXX_HAVE_TIMESPEC_GET)
//#undef timespec_get
//namespace std
//{
// using ::timespec;
//  using ::timespec_get;
// } // namespace std
//#endif

I managed to install ffcv and it works fine, but what can be the potential cause of this error? Seems like it is related to compilers.

guigautier commented 1 year ago

Same issue

tavisshore commented 1 year ago

I downgraded compilers from 1.5.2 to 1.5.0 and it seems to have sorted the problem for me

Godofnothing commented 1 year ago

@tavisshore good to know. Anyway, dumb solution with editing ctime works with a newer version of compilers, but it is cleaner solution.