statgen / savvy

Interface to various variant calling formats.
Mozilla Public License 2.0
26 stars 5 forks source link

error: 'isnan' is not a member of 'std' #8

Closed welchr closed 5 years ago

welchr commented 5 years ago

I can compile savvy@develop on my Mac with no issues, but on our Ubuntu box with gcc 5.4 it fails with:

In file included from /home/welchr/scratch/savvy/src/savvy/site_info.cpp:7:0:
/home/welchr/scratch/savvy/include/savvy/site_info.hpp: In function 'void savvy::update_info_fields(savvy::site_info&, const T&, savvy::fmt)':
/home/welchr/scratch/savvy/include/savvy/site_info.hpp:192:11: error: 'isnan' is not a member of 'std'
       if (std::isnan(*it))

If I add #include <cmath> to that header file, then it compiles successfully. Maybe it's included by default on Mac for some reason.

jonathonl commented 5 years ago

This has been fixed (5cf11170e5d0ba761be6ac2f8a8b347a6d8e56e6). Include trees within the std lib will differ slightly both between compilers and compiler versions (e.g., this built fine on Travis with gcc 4.8).

FYI, you can specify commits instead of branches in the requirements.txt file. This missing include was introduced recently and temporary bugs will pop up in the develop branch from time to time. Freezing the savvy commit within your app will prevent future issues in the develop branch from affecting you.