You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/27 21:07:00 UTC

[jira] [Commented] (METRON-1334) Add C++11 Compliance Check to 'platform-info.sh'

    [ https://issues.apache.org/jira/browse/METRON-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16267548#comment-16267548 ] 

ASF GitHub Bot commented on METRON-1334:
----------------------------------------

Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/849#discussion_r153322627
  
    --- Diff: metron-deployment/scripts/platform-info.sh ---
    @@ -73,6 +73,30 @@ echo "--"
     echo "npm"
     npm --version
     
    +# C++ compiler
    +echo "--"
    +echo "g++"
    +g++ --version
    +
    +# C++11 compliant compiler
    +echo "--"
    +OBJFILE=/tmp/test
    +CPPFILE=/tmp/test.cpp
    +cat > $CPPFILE <<- EOM
    +#include <iostream>
    +using namespace std;
    +int main() {
    +    cout << "Hello World!" << endl;
    +    return 0;
    +}
    +EOM
    +g++ -std=c++11 $CPPFILE -o $OBJFILE
    +if [ $? -eq 0 ]; then
    +    echo "Compiler is C++11 compliant"
    +else
    +    echo "Warning: Compiler is NOT C++11 compliant"
    +fi
    +rm -f $CPPFILE $OBJFILE
     
    --- End diff --
    
    A standard way in the language is to check for the value of __cplusplus
    
    201402L  is CPP 14
    201103L is CPP 11
    
    I don't have a preference, just throwing this out there.


> Add C++11 Compliance Check to 'platform-info.sh'
> ------------------------------------------------
>
>                 Key: METRON-1334
>                 URL: https://issues.apache.org/jira/browse/METRON-1334
>             Project: Metron
>          Issue Type: Sub-task
>            Reporter: Nick Allen
>            Assignee: Nick Allen
>             Fix For: 0.4.1
>
>
> Some of the module dependencies for the Management and Alerts UI must be built natively on the host. This requires a C/C++ compiler. In addition, some of the dependencies require a C++11 compliant compiler. This is causing problems for users who attempt to build Metron on a system with an older version of GCC, like CentOS 6.
> Not having a C++11 compliant compiler can cause some non-obvious error messages when the build fails. This adds a version check for GCC and also a C++11 compliance check. The compiler itself must be on the user's PATH, which is what the Node modules also require.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)