Skip to content
New issue

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

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

Already on GitHub? # to your account

Compile error on RHEL 7.6 and Ubuntu 18.04 #60

Open
qili93 opened this issue Aug 14, 2019 · 1 comment
Open

Compile error on RHEL 7.6 and Ubuntu 18.04 #60

qili93 opened this issue Aug 14, 2019 · 1 comment

Comments

@qili93
Copy link

qili93 commented Aug 14, 2019

Found some build error in RHEL 7.5 and Ubuntu 18.04 and append the code diff here

  1. RHEL 7.6
$ git diff --ignore-all-space
diff --git a/eval.cpp b/eval.cpp
index c196fc8..daa9e17 100755
--- a/eval.cpp
+++ b/eval.cpp
@@ -151,7 +151,7 @@ namespace Tn
             precision[i] = TP / total;

             //compute AP:
-            sort(checkPRBoxs.begin(),checkPRBoxs.end(),[](CheckPair& left,CheckPair& right){
+            sort(checkPRBoxs.begin(),checkPRBoxs.end(),[](const CheckPair& left, const CheckPair& right){
                 return left.first.score > right.first.score;
                 }
             );
diff --git a/include/dataReader.h b/include/dataReader.h
index 39b47bb..17bf20b 100644
--- a/include/dataReader.h
+++ b/include/dataReader.h
@@ -4,6 +4,7 @@
 #include <vector>
 #include <list>
 #include <string>
+#include <tuple>

 namespace Tn
 {
  1. Ubuntu 18.04
$ git diff --ignore-all-space
diff --git a/eval.cpp b/eval.cpp
index c196fc8..a21f5d2 100755
--- a/eval.cpp
+++ b/eval.cpp
@@ -3,6 +3,7 @@
 #include <assert.h>
 #include <iostream>
 #include <iomanip>
+#include <cmath>

 using namespace std;

@@ -146,7 +147,7 @@ namespace Tn
             }

             //recall:
-            recall[i] = (abs(TP + FN) < 1e-5) ? 1 : TP / (TP + FN);
+            recall[i] = (std::fabs(TP + FN) < 1e-5) ? 1 : TP / (TP + FN);
             //precision
             precision[i] = TP / total;
lewes6369 added a commit that referenced this issue Sep 13, 2019
@lewes6369
Copy link
Owner

Thanks, I modified as your suggestion.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants