xgboost icon indicating copy to clipboard operation
xgboost copied to clipboard

[jvm-packages] clang: error: no such file or directory: 'NOTFOUND'

Open lee-agi opened this issue 9 years ago • 11 comments

I have make -j8 succeeded, but cd jvm-packages and mvn package. I get the following error.

[INFO] [INFO] --- maven-assembly-plugin:2.6:single (make-assembly) @ xgboost-jvm --- [INFO] Assemblies have been skipped per configuration of the skipAssembly parameter. [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building xgboost4j 0.7 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost4j --- Processed 14 file(s) Found 0 errors Found 0 warnings Found 0 infos Finished in 840 ms [INFO] [INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost4j --- [INFO] [INFO] --- exec-maven-plugin:1.6.0:exec (native) @ xgboost4j --- -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) (found version "1.0") -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) (found version "1.0") -- Configuring done -- Generating done -- Build files have been written to: /Users/clzhang/Documents/IntelliJIDEA_program/xgboost/build [ 1%] Building CXX object CMakeFiles/objxgboost.dir/src/c_api/c_api.cc.o clang: error: no such file or directory: 'NOTFOUND' make[2]: *** [CMakeFiles/objxgboost.dir/src/c_api/c_api.cc.o] Error 1 make[1]: *** [CMakeFiles/objxgboost.dir/all] Error 2 make: *** [all] Error 2 Traceback (most recent call last): building Java wrapper cd .. File "create_jni.py", line 89, in mkdir -p build cd build run("cmake --build . --config Release") File "create_jni.py", line 51, in run subprocess.check_call(command, shell=True, **kwargs) cmake .. -DUSE_S3:BOOL=OFF -DUSE_OPENMP:BOOL=OFF -DPLUGIN_UPDATER_GPU:BOOL=OFF -DUSE_AZURE:BOOL=OFF -DUSE_HDFS:BOOL=OFF -DJVM_BINDINGS:BOOL=ON File "/usr/lib/python2.7/subprocess.py", line 540, in check_call cmake --build . --config Release raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'cmake --build . --config Release' returned non-zero exit status 2 [ERROR] Command execution failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751) at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] xgboost-jvm ........................................ SUCCESS [ 2.427 s] [INFO] xgboost4j .......................................... FAILURE [ 2.333 s] [INFO] xgboost4j-spark .................................... SKIPPED [INFO] xgboost4j-flink .................................... SKIPPED [INFO] xgboost4j-example .................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.881 s [INFO] Finished at: 2017-08-13T11:22:03+08:00 [INFO] Final Memory: 21M/383M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (native) on project xgboost4j: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :xgboost4j

Environment info

Operating System: mac Sierra, version 10.12.6

Compiler: Apple LLVM version 8.1.0 (clang-802.0.42)

It has confused me a long time, but i cannot find related issues and resolutions by google.

Looking forword to a reply. thanks.

lee-agi avatar Aug 13 '17 03:08 lee-agi

I have the same problam, had you installed clang on mac?

ghost avatar Aug 14 '17 02:08 ghost

Yes. First, I brew install clang-omp, but it has an error (seem to hint out-of-date). Then, I install LLVM, which I think it contains clang.

lee-agi avatar Aug 14 '17 15:08 lee-agi

The docs for building the JVM package are a bit out of date. The master version does not use the Makefile mechanism to build the JNI bindings and instead resorts to CMake. The default config for Mac is to build without OMP support, therefore you don't need clang-omp.

Could you try building with default clang?

superbobry avatar Aug 14 '17 17:08 superbobry

so,how should i modify the configuration file?

ghost avatar Aug 15 '17 02:08 ghost

Just follow the link: it's in create_jni.py.

superbobry avatar Aug 16 '17 16:08 superbobry

I was able to get things to compile again if I removed this line. I think what's happening is that find_package (L3) isn't finding OpenMP, and so all OpenMP variables are being set to NOTFOUND. I haven't had a chance to test what I've compiled, but I was able to build the JVM packages once I removed that line.

justinmills avatar Aug 17 '17 19:08 justinmills

Good catch! Can you put this line inside if(OPENMP_FOUND) and submit a PR?

superbobry avatar Aug 17 '17 20:08 superbobry

Sure thing: #2613.

justinmills avatar Aug 17 '17 20:08 justinmills

Thanks for @superbobry and @justinmills resolution. I also package success when remove the line @justinmills mentioned.

lee-agi avatar Aug 22 '17 02:08 lee-agi

I fellowed the solution above and resolved the similar problem I met. But, the warning "OpenMP is not available, project will be compiled into single-thread code" is showing me now. why? Do I need fix this warning?

leeivan avatar Sep 13 '17 06:09 leeivan

I've been running the non-OpenMP build on my Mac for a couple weeks now just fine. My understanding is that it might not be as fast (single-threaded vs multi-threaded I think), but should still work. I did try to get the OpenMP build working too, but it had more build problems and I didn't have time to fix them.

justinmills avatar Sep 13 '17 13:09 justinmills