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

Fix build error. #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix build error. #2

wants to merge 3 commits into from

Conversation

haosdent
Copy link

@haosdent haosdent commented Jun 6, 2014

I build error both Linux and OS X. After this changes, I build it successfully. Fix #1

@adityakishore
Copy link
Member

Does this resolve the issue that you reported as #1?

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

Yeah, because this option "-Werror", any warning would become error and abort build.

@pwong-mapr
Copy link
Contributor

Which version of OSX are you using? This may be helpful to others, due to Apple changing the structure of its JDK frequently.

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

And for this, include <unistd.h> If gcc version > 4.7, gcc couldn't find getpid.

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

My OS X environment:

  • Operate System: 10.9.2
  • Oracle JDK: 1.6.0_65
  • gcc version: 4.8.3 (Install through brew, not Apple Xcode Clang, because of build.gradle use cpp)

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

My Linux environment:

  • Operate System: 2.6.18-164.el5
  • OpenJDK: 1.6.0_32
  • gcc verson: 4.1.2

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

     [exec] 02:15:37.676 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :compilePerftestExecutablePerftestCpp
     [exec] 02:15:37.676 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':compilePerftestExecutablePerftestCpp'
     [exec] 02:15:37.676 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':compilePerftestExecutablePerftestCpp' is up-to-date
     [exec] 02:15:37.760 [ERROR] [system.err] cc1plus: warnings being treated as errors
     [exec] 02:15:37.760 [ERROR] [system.err] /home/haosong.hhs/develop/code/libhbase/src/test/native/perftest/ops_runner.h: In constructor ‘hbase::test::OpsRunner::OpsRunner(void*, bytebuffer_*, uint32_t
, uint64_t, uint64_t, bytebuffer_*, bytebuffer_*, const char*, int, bool, bool, bool, int32_t, bool, hbase::test::StatKeeper*)’:
     [exec] 02:15:37.760 [ERROR] [system.err] /home/haosong.hhs/develop/code/libhbase/src/test/native/perftest/ops_runner.h:68: warning: converting to ‘uint64_t’ from ‘double’     [exec] 02:15:37.771 [ERROR] [org.gradle.BuildExceptionReporter]
     [exec] 02:15:37.772 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.     [exec] 02:15:37.772 [ERROR] [org.gradle.BuildExceptionReporter]
     [exec] 02:15:37.773 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:     [exec] 02:15:37.773 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compilePerftestExecutablePerftestCpp'.
     [exec] 02:15:37.773 [ERROR] [org.gradle.BuildExceptionReporter] > C++ compiler failed; see the error output for details.     [exec] 02:15:37.697 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':compilePerftestExecutablePerftestCpp' (up-to-date check took 0.02 secs) due to:
     [exec]   Value of input property 'compilerArgs' has changed for task ':compilePerftestExecutablePerftestCpp'     [exec] 02:15:37.697

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

ping @adityakishore the type convert warn in perftest.

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

In OSX, if don't use -fpermissive,

     [exec] 02:19:47.834 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :compilePerftestExecutablePerftestCpp FAILED
     [exec] 02:19:47.835 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :compilePerftestExecutablePerftestCpp (Thread[main,5,main]) completed. Took 0.783 secs.
     [exec] 02:19:47.835 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 4.119 secs, idle: 0.0050 secs
     [exec] 02:19:47.829 [ERROR] [system.err] test_types.cc: In static member function 'static void* hbase::test::TaskRunner::ThreadFunction(void*)':
     [exec] 02:19:47.830 [ERROR] [system.err] test_types.cc:54:44: error: cast from 'pthread_t {aka _opaque_pthread_t*}' to 'uint32_t {aka unsigned int}' loses precision [-fpermissive]
     [exec] 02:19:47.841 [ERROR] [org.gradle.BuildExceptionReporter]
     [exec] 02:19:47.841 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
     [exec] 02:19:47.841 [ERROR] [org.gradle.BuildExceptionReporter]
     [exec] 02:19:47.842 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
     [exec] 02:19:47.842 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':compilePerftestExecutablePerftestCpp'.
     [exec] 02:19:47.842 [ERROR] [org.gradle.BuildExceptionReporter] > C++ compiler failed; see the error output for details.

@adityakishore
Copy link
Member

Can you update the pull request with the fixes for these warnings?

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

Do you mean don't ignore warnings and directly fix them?

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

The cause is these two line code in OpsRunner

maxGets_(numOps_*(1.0-(putPercent/100.0))),

and

putWeight_(putPercent/100.0),

@haosdent
Copy link
Author

haosdent commented Jun 6, 2014

I would update tomorrow. :-) Good night, it is 3:13 am now.

@haosdent
Copy link
Author

haosdent commented Jun 7, 2014

We have to disable "-Werror", becuase of

     [exec] 13:06:14.067 [ERROR] [system.err] jnihelper.cc: In static member function 'static JNIEnv* hbase::JniHelper::GetJNIEnv()':     [exec] 13:06:14.068 [ERROR] [system.err] jnihelper.cc:619:13: error: 'jint JNI_GetCreatedJavaVMs(JavaVM**, jsize, jsize*)' is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h:1940) [-Werror=deprecated-declarations]     [exec] 13:06:14.068 [ERROR] [system.err] jnihelper.cc:619:67: error: 'jint JNI_GetCreatedJavaVMs(JavaVM**, jsize, jsize*)' is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h:1940) [-Werror=deprecated-declarations]     [exec] 13:06:14.068 [ERROR] [system.err] jnihelper.cc:690:10: error: 'jint JNI_CreateJavaVM(JavaVM**, void**, void*)' is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h:1937) [-Werror=deprecated-declarations]     [exec] 13:06:14.068 [ERROR] [system.err] jnihelper.cc:690:61: error: 'jint JNI_CreateJavaVM(JavaVM**, void**, void*)' is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h:1937) [-Werror=deprecated-declarations]
     [exec] 13:06:14.078 [ERROR] [system.err] cc1plus: all warnings being treated as errors
     [exec] 13:06:14.087 [ERROR] [org.gradle.BuildExceptionReporter]
     [exec] 13:06:14.088 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.

@haosdent
Copy link
Author

haosdent commented Jun 7, 2014

Or

    cCompiler.args "-Wall", "-Wno-deprecated-declarations", "-Werror", "-fvisibility=hidden", "-std=gnu99"
    cppCompiler.args "-Wall", "-Wno-deprecated-declarations", "-Werror", "-fvisibility=hidden", "-fvisibility-inlines-hidden"

@haosdent
Copy link
Author

haosdent commented Jun 7, 2014

I have updated the pull request. ping @adityakishore

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.

Build failed.
3 participants