Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added <limits> include to mathinline.h #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwhendy
Copy link

@jwhendy jwhendy commented Nov 5, 2021

I ran into a problem compiling... not sure if it's my C++ version or something else. The fix was simple, found by googling the error finding this.

As is, I get this error:

> library(devtools)
Loading required package: usethis
> devtools::install_github("tylermorganwall/rayrender")
Downloading GitHub repo tylermorganwall/rayrender@HEAD
SSL_INIT
SSL_INIT
SSL_INIT
Skipping 1 packages ahead of CRAN: spacefillr
   checking for file ‘/tmp/Rtmp0omYxD/remotes1598d525a9c3f0/tylermorganwall-rayrender-c27✔  checking for file ‘/tmp/Rtmp0omYxD/remotes1598d525a9c3f0/tylermorganwall-rayrender-c27e72f/DESCRIPTION’
─  preparing ‘rayrender’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘rayrender_0.23.4.tar.gz’
   
Installing package into ‘/home/jwhendy/.R’
(as ‘lib’ is unspecified)
* installing *source* package ‘rayrender’ ...
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/include/R/" -DNDEBUG  -I'/home/jwhendy/.R/Rcpp/include' -I'/home/jwhendy/.R/RcppThread/include' -I'/home/jwhendy/.R/progress/include' -I'/home/jwhendy/.R/spacefillr/include' -D_FORTIFY_SOURCE=2  -D RAY_REPRODUCE_PERLIN -DSTRICT_R_HEADERS -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/include/R/" -DNDEBUG  -I'/home/jwhendy/.R/Rcpp/include' -I'/home/jwhendy/.R/RcppThread/include' -I'/home/jwhendy/.R/progress/include' -I'/home/jwhendy/.R/spacefillr/include' -D_FORTIFY_SOURCE=2  -D RAY_REPRODUCE_PERLIN -DSTRICT_R_HEADERS -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt  -c aabb.cpp -o aabb.o
In file included from ray.h:7,
                 from aabb.h:4,
                 from aabb.cpp:1:
mathinline.h:29:46: error: ‘numeric_limits’ is not a member of ‘std’
   29 | static constexpr Float MachineEpsilon = std::numeric_limits<Float>::epsilon() * 0.5;
      |                                              ^~~~~~~~~~~~~~
mathinline.h:29:66: error: expected primary-expression before ‘>’ token
   29 | static constexpr Float MachineEpsilon = std::numeric_limits<Float>::epsilon() * 0.5;
      |                                                                  ^
mathinline.h:29:69: error: ‘::epsilon’ has not been declared
   29 | static constexpr Float MachineEpsilon = std::numeric_limits<Float>::epsilon() * 0.5;
      |                                                                     ^~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:177: aabb.o] Error 1
ERROR: compilation failed for package ‘rayrender’

With the fix here, it built successfully.

Note: I don't know where you'd want that include line. I just added it wherever. Please fix if those are grouped or ordered in a meaningful way you'd like to maintain.

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.

1 participant