Closed zig-kwin-hu closed 8 years ago
have you build the library successfully by running mvn package
?
After running mvn package under ivm-packages, it shows error information as follows: ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xgboost4j: There are test failures. [ERROR]
So I run mvn -DskipTests=true package. And get xgboos4j-0.5.jar file in jam-package/x4jboost/target. I use it in my DEMO.java's lib. But it doesn't work.
you have to ensure that you can pass the unit test before you use it in your proj.....so when you found some error in your local side, you'd find out the reason such as native lib did not get compiled successfully instead of skipping
Set my JAVA_HOME as /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home. So I suppose I have set it correctly. I couldn't find out why I can run mvn package successfully. Is there any guide to follow under such situation?
sorry....I didn't understand your comments....
I'm sorry that I didn't make it clear. After running mvn package under jam-packages, I see error information below: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xgboost4j: I don't know what does this error information means.
would you post complete output in your screen?
The complete output after running mvn package is as follow:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ml.dmlc:xgboost4j:jar:0.5
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 32, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] xgboost-jvm
[INFO] xgboost4j
[INFO] xgboost4j-spark
[INFO] xgboost4j-flink
[INFO] xgboost4j-example
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xgboost-jvm 0.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost-jvm ---
[WARNING] sourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/main/scala
[WARNING] testSourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/test/scala
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 68 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost-jvm ---
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost-jvm ---
Discovery starting.
Discovery completed in 39 milliseconds.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 97 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
[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.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost4j ---
Processed 7 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 448 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost4j ---
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (native) @ xgboost4j ---
build java wrapper
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I./java -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -shared -o jvm-packages/lib/libxgboost4j.so jvm-packages/xgboost4j/src/native/xgboost4j.cpp build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
In file included from jvm-packages/xgboost4j/src/native/xgboost4j.cpp:16:
In file included from include/xgboost/base.h:10:
dmlc-core/include/dmlc/omp.h:13:9: warning: Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of multi-threading. [-W#pragma-messages]
^
1 warning generated. ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [jvm-packages/lib/libxgboost4j.so] Error 1 move native lib mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory complete [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xgboost4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ xgboost4j --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ xgboost4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/huzikun/xgboost/jvm-packages/xgboost4j/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ xgboost4j --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ xgboost4j ---
Running TestSuite [ERROR]: No test suite found. Nothing to run org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.BoosterImplTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.DMatrixTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.281 sec - in TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost4j ---
Discovery starting.
Discovery completed in 98 milliseconds.
Run starting. Expected test count is: 7
ScalaBoosterImplSuite:
七月 07, 2016 12:09:29 上午 ml.dmlc.xgboost4j.java.NativeLibLoader smartLoad
严重: failed to load library from both native path and jar
七月 07, 2016 12:09:29 上午 ml.dmlc.xgboost4j.java.DMatrix
so, it says
ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation)
run export CXX=clang-omp++
then compile
Thanks for advice.
After run export CXX=clang-omp++, I run mvn compile, it succeed.
But then I run mvn package, it still failed, the error information is as follows:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ml.dmlc:xgboost4j:jar:0.5
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 32, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] xgboost-jvm
[INFO] xgboost4j
[INFO] xgboost4j-spark
[INFO] xgboost4j-flink
[INFO] xgboost4j-example
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xgboost-jvm 0.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost-jvm ---
[WARNING] sourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/main/scala
[WARNING] testSourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/test/scala
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 67 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost-jvm ---
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost-jvm ---
Discovery starting.
Discovery completed in 35 milliseconds.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 97 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
[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.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost4j ---
Processed 7 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 488 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost4j ---
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (native) @ xgboost4j ---
build java wrapper
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I./java -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -shared -o jvm-packages/lib/libxgboost4j.so jvm-packages/xgboost4j/src/native/xgboost4j.cpp build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
make: clang-omp++: No such file or directory
make: *\ [jvm-packages/lib/libxgboost4j.so] Error 1
move native lib
mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory
complete
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xgboost4j ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost4j ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ xgboost4j ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost4j ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ xgboost4j ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/huzikun/xgboost/jvm-packages/xgboost4j/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ xgboost4j ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost4j ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ xgboost4j ---
Running TestSuite [ERROR]: No test suite found. Nothing to run org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.BoosterImplTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.DMatrixTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.261 sec - in TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost4j ---
Discovery starting.
Discovery completed in 96 milliseconds.
Run starting. Expected test count is: 7
ScalaBoosterImplSuite:
七月 07, 2016 12:29:26 上午 ml.dmlc.xgboost4j.java.NativeLibLoader smartLoad
严重: failed to load library from both native path and jar
七月 07, 2016 12:29:26 上午 ml.dmlc.xgboost4j.java.DMatrix
so, when you met error, go back to the output log, you will find the reason
make: clang-omp++: No such file or directory
your system does not have a complete compiler tool chain, would you install that before you install xgboost?
I'm totally new to java and mvn. Could you suggest which complier tool chain should I install? Actually, I don't know what is complier tool chain. Thanks a lot.
you can install clang (http://llvm.org/releases/download.html#3.8.0)
I installed clang-mop by running brew install clang-omp. But there is still an error:
1 error generated. make: *\ [jvm-packages/lib/libxgboost4j.so] Error 1 move native lib mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory complete
Why does this this error happen? Here is the full report below:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ml.dmlc:xgboost4j:jar:0.5
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 32, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] xgboost-jvm
[INFO] xgboost4j
[INFO] xgboost4j-spark
[INFO] xgboost4j-flink
[INFO] xgboost4j-example
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xgboost-jvm 0.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost-jvm ---
[WARNING] sourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/main/scala
[WARNING] testSourceDirectory is not specified or does not exist value=/Users/huzikun/xgboost/jvm-packages/src/test/scala
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 76 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost-jvm ---
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost-jvm ---
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5
[WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5
[WARNING] ml.dmlc:xgboost-jvm:0.5 requires scala version: 2.10.5
[WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6
[WARNING] Multiple versions of scala libraries detected!
[INFO] No sources to compile
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost-jvm ---
Discovery starting.
Discovery completed in 36 milliseconds.
Run starting. Expected test count is: 0
DiscoverySuite:
Run completed in 100 milliseconds.
Total number of tests run: 0
Suites: completed 1, aborted 0
Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
No tests were executed.
[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.5
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scalastyle-maven-plugin:0.8.0:check (checkstyle) @ xgboost4j ---
Processed 7 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 489 ms
[INFO]
[INFO] --- maven-checkstyle-plugin:2.17:check (checkstyle) @ xgboost4j ---
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (native) @ xgboost4j ---
build java wrapper
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include -I./java -I/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/include/darwin -shared -o jvm-packages/lib/libxgboost4j.so jvm-packages/xgboost4j/src/native/xgboost4j.cpp build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
In file included from jvm-packages/xgboost4j/src/native/xgboost4j.cpp:15:
include/xgboost/c_api.h:16:10: fatal error: 'stdio.h' file not found
^
1 error generated. make: *\ [jvm-packages/lib/libxgboost4j.so] Error 1 move native lib mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory complete [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xgboost4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- scala-maven-plugin:3.2.2:compile (default) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ xgboost4j --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- scala-maven-plugin:3.2.2:compile (compile) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ xgboost4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/huzikun/xgboost/jvm-packages/xgboost4j/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ xgboost4j --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- scala-maven-plugin:3.2.2:testCompile (test-compile) @ xgboost4j --- [WARNING] Expected all dependencies to require Scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-compiler:2.10.5 requires scala version: 2.10.5 [WARNING] org.scala-lang:scala-reflect:2.10.5 requires scala version: 2.10.5 [WARNING] ml.dmlc:xgboost4j:0.5 requires scala version: 2.10.5 [WARNING] org.scalatest:scalatest_2.10:2.2.6 requires scala version: 2.10.6 [WARNING] Multiple versions of scala libraries detected! [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ xgboost4j ---
Running TestSuite [ERROR]: No test suite found. Nothing to run org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.BoosterImplTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) org.testng.TestNGException: Failure in JUnit mode for class ml.dmlc.xgboost4j.java.DMatrixTest: could not create/run JUnit test suite: cannot retrieve JUnit method at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:230) at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:223) at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:204) at org.testng.TestRunner$2.run(TestRunner.java:639) at org.testng.TestRunner.runWorkers(TestRunner.java:1030) at org.testng.TestRunner.privateRunJUnit(TestRunner.java:664) at org.testng.TestRunner.run(TestRunner.java:576) at org.testng.SuiteRunner.runTest(SuiteRunner.java:331) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:326) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:288) at org.testng.SuiteRunner.run(SuiteRunner.java:193) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:910) at org.testng.TestNG.runSuitesLocally(TestNG.java:879) at org.testng.TestNG.run(TestNG.java:787) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.262 sec - in TestSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ xgboost4j ---
Discovery starting.
Discovery completed in 107 milliseconds.
Run starting. Expected test count is: 7
ScalaBoosterImplSuite:
七月 08, 2016 11:54:35 上午 ml.dmlc.xgboost4j.java.NativeLibLoader smartLoad
严重: failed to load library from both native path and jar
七月 08, 2016 11:54:35 上午 ml.dmlc.xgboost4j.java.DMatrix
I guess the problem above is because that I didn't successfully build the shared library. So I delete my xgboost document and restart from the beginning. I download xgboost again. But when I am running make -j4, it shows error. (I have set CC=clang-omp++; CXX=clang-omp++; and I have installed clang-omp by run: brew install clang-mop and I have Xcode on my mac)
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -MM -MT build/learner.o src/learner.cc >build/learner.d clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -MM -MT build/logging.o src/logging.cc >build/logging.d clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d In file included from src/c_api/c_api_error.cc:6: In file included from src/c_api/./c_api_error.h:9: dmlc-core/include/dmlc/base.h:136:10: fatal error: 'sys/types.h' file not foundIn file included from src/c_api/c_api.cc:3: In file included from include/xgboost/data.h:10: dmlc-core/include/dmlc/base.h:136:In file included from 10src/logging.cc:: 7: In file included from fatal errorinclude/xgboost/logging.h: :11: In file included from 'sys/types.h'dmlc-core/include/dmlc/logging.h: 10file: not/usr/local/Cellar/clang-omp/2015-04-01/libexec/bin/../include/c++/v1/cstdio#include <sys/types.h> :found100 ^ : 10: fatal error: In file included from src/learner.cc'stdio.h': 7file: In file included from notinclude/xgboost/logging.h :found11:
In file included from dmlc-core/include/dmlc/logging.h:10:
/usr/local/Cellar/clang-omp/2015-04-01/libexec/bin/../include/c++/v1/cstdio:100#include <sys/types.h>:
10: ^
fatal error:
'stdio.h'#include
^
1 error generated. make: * [build/c_api/c_api_error.o] Error 1 make: * Waiting for unfinished jobs.... 1 error generated. make: * [build/logging.o] Error 1 1 error generated. make: * [build/c_api/c_api.o] Error 1 1 error generated. make: *\ [build/learner.o] Error 1
it seems that your system does not even have stdio.h,
I'm not sure why this happens and it has beyond the scope of xgboost....
you'd ensure that you can do normal c++ dev work in your system....
When I'm using Xcode, it is easy to include stdio.h.....
and what does it mean by: make: *\ [jvm-packages/lib/libxgboost4j.so] Error 1 move native lib mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory complete
When I'm using Xcode, it is easy to include stdio.h.....
yes, so you need to ensure that your local env enables you to do the basic dev work outside of IDE, like vi,
and what does it mean by:
make: *** [jvm-packages/lib/libxgboost4j.so] Error 1
move native lib
mv: rename lib/libxgboost4j.so to xgboost4j/src/main/resources/lib/libxgboost4j.dylib: No such file or directory
complete
it means that you did not compile native lib correctly
I encountered the same error as yours, and solved by the following command as stated in the installation guide: brew install gcc --without-multilib The detailed installation step:
brew install gcc --without-multilib
vi ~/.bash_profile
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/"
source ~/.bash_profile
git clone --recursive https://github.com/dmlc/xgboost
git pull && git submodule init && git submodule update && git submodule status
cd xgboost; cp make/minimum.mk ./config.mk; make -j4
mvn package
I still got an error when packaging xgboost4j-spark, but jar in xgboost4j works.
Hope it helps.Thank you, I have solved this problem in a similar way as you did.
I am running the java Demo code copied from https://github.com/dmlc/xgboost/blob/master/jvm-packages/xgboost4j-example/src/main/java/ml/dmlc/xgboost4j/java/example/BasicWalkThrough.java But an error is given. The error information appears:
七月 02, 2016 10:46:22 下午 ml.dmlc.xgboost4j.java.NativeLibLoader smartLoad 严重: failed to load library from both native path and jar 七月 02, 2016 10:46:22 下午 ml.dmlc.xgboost4j.java.DMatrix
严重: load native library failed.
七月 02, 2016 10:46:22 下午 ml.dmlc.xgboost4j.java.DMatrix
严重: java.io.FileNotFoundException: File /lib/libxgboost4j.dylib was not found inside JAR.
Exception in thread "main" java.lang.UnsatisfiedLinkError: ml.dmlc.xgboost4j.java.XGBoostJNI.XGDMatrixCreateFromFile(Ljava/lang/String;I[J)I
at ml.dmlc.xgboost4j.java.XGBoostJNI.XGDMatrixCreateFromFile(Native Method)
at ml.dmlc.xgboost4j.java.DMatrix.(DMatrix.java:83)
at newtest.mytest.main(mytest.java:27)
the code is :
package newtest; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import ml.dmlc.xgboost4j.java.Booster; import ml.dmlc.xgboost4j.java.DMatrix; import ml.dmlc.xgboost4j.java.XGBoost; import ml.dmlc.xgboost4j.java.XGBoostError; //import ml.dmlc.xgboost4j.java.example.util.DataLoader; public class mytest { public static boolean checkPredicts(float[][] fPredicts, float[][] sPredicts) { if (fPredicts.length != sPredicts.length) { return false; }
}
It appears that the error happens when this line is running: DMatrix trainMat = new DMatrix("/Users/huzikun/xgboost/demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("/Users/huzikun/xgboost/demo/data/agaricus.txt.test");
This problem has bothered me for two days. I would appreciate it if anyone could help. Thanks a lot.