Skip to content

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

@pescobar

Description

@pescobar

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions