lawmurray / LibBi

Bayesian state-space modelling on high-performance hardware, including multicore, GPUs and distributed clusters.
http://www.libbi.org
Other
96 stars 22 forks source link

compilation error . missing g++ flag `-std=c++11` #47

Open pescobar opened 5 years ago

pescobar commented 5 years ago

I have built a LibBI singularity container for a user in our cluster and she was hitting this error when using it:

$> libbi sample --model-file SIS.bi                                                                                                                                 
Error: make failed with return code 2, see opt/libbifile/.SIS/build_assert_openmp_sm_30/make.log for details

and in the log file I found this:

src/sample_cpu.cpp:713:77:   required from here
/usr/local/cuda/include/thrust/system/detail/generic/extrema.inl:221:89: error: 'lowest' is not a member of 'std::numeric_limits<double>'
Makefile:1016: recipe for target 'src/sample_cpu.o' failed
make: *** [src/sample_cpu.o] Error 1
make: *** Waiting for unfinished jobs....

The error is described here: https://stackoverflow.com/questions/30663869/lowest-is-not-a-member-of-stdnumeric-limits

And the solution is described here ( enable the -std=c++11 compiler flag) https://stackoverflow.com/a/30663908

I could workaround the issue executing libbi like this:

$> CXX="g++ -std=c++11" libbi sample --model-file SIS.bi

I guess the gcc flag -std=c++11 should be used by default? Or is there any better solution?