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

how can i use opencv_face in javacv1.0? #204

Closed
LeeJeongSep opened this issue Aug 17, 2015 · 5 comments
Closed

how can i use opencv_face in javacv1.0? #204

LeeJeongSep opened this issue Aug 17, 2015 · 5 comments
Labels

Comments

@LeeJeongSep
Copy link

i want to use opencv_face module for fisherface.
i saw we have to build from source for using face module in below #200 issue.
how build the face module from source?
where is the source? please help me.

@saudet
Copy link
Member

saudet commented Aug 17, 2015

All instructions are here: https://github.com/bytedeco/javacpp-presets/#build-instructions
All the source that you need is from GitHub. Be sure to run mvn install for both the latest source of the javacpp and javacpp-presets modules.

@saudet saudet closed this as completed Aug 17, 2015
@chinadragon0515
Copy link

Can we have default build to have these class but avoid everyone to rebuild? thanks.

@saudet
Copy link
Member

saudet commented Aug 23, 2015

Of course, but someone needs to make those builds :)

@chinadragon0515
Copy link

I tried to understand more detail about the issue and tried to rebuild, I met some issues and have some questions,

  1. By default, if we only need build javacv 1.0 sample, we only need to specified these in the pom file and it will auto pop the dependencies jar like javacv.jar, javacpp.jar and opencv.jar.


    org.bytedeco
    javacv
    1.0

  2. The issues with above solution is the auto pop javacv.jar,javacpp.jar and opencv.jar are built with specified system so we need to rebuild all these jar manually, right?

  3. For the build sequence, we need to first build javacpp.jar, then build javacpp-presets and make javacpp-presets uses built javacpp.jar but not depended on this in the pom file, right?

    org.bytedeco javacpp ${project.parent.version}

Then we build javacv to make it depend on the built javacpp.jar and opencv.jar.
Last we make sample depended on the build three jar file, is this correct?

  1. I tried to build javacpp with maven, I met an issue, here is the log, what I need to do? In the meanwhile, I am doing more try now.
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Not installing Nexus Staging features:
[INFO]  * Preexisting staging related goal bindings found in 1 modules.
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building JavaCPP 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ javacpp ---
[INFO] Deleting D:\dev\eclipsews-luna\javacpp-master\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javacpp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 23 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ javacpp ---
[INFO] Compiling 104 source files to D:\dev\eclipsews-luna\javacpp-master\target\classes
[INFO] 
[INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ javacpp ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 1 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ javacpp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) @ javacpp ---
[INFO] Compiling 2 source files to D:\dev\eclipsews-luna\javacpp-master\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ javacpp ---
[INFO] Surefire report directory: D:\dev\eclipsews-luna\javacpp-master\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.bytedeco.javacpp.IndexerTest
Generating D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\jniIndexerTest.cpp
Compiling D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\windows-x86_64\jniIndexerTest.dll
cl "/IC:\Program Files\Java\jdk1.8.0_40\include" "/IC:\Program Files\Java\jdk1.8.0_40\include\win32" D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\jniIndexerTest.cpp /W3 /Oi /O2 /EHsc /Gy /GL /MD /LD /link /OUT:D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\windows-x86_64\jniIndexerTest.dll 
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.725 sec <<< FAILURE!
org.bytedeco.javacpp.IndexerTest  Time elapsed: 0.723 sec  <<< ERROR!
java.io.IOException: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at org.bytedeco.javacpp.tools.Builder.compile(Builder.java:317)
    at org.bytedeco.javacpp.tools.Builder.generateAndCompile(Builder.java:371)
    at org.bytedeco.javacpp.tools.Builder.build(Builder.java:642)
    at org.bytedeco.javacpp.IndexerTest.setUpClass(IndexerTest.java:55)
    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:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    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:497)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 25 more

Running org.bytedeco.javacpp.StringTest
Generating D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\jniStringTest.cpp
Compiling D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\windows-x86_64\jniStringTest.dll
cl "/IC:\Program Files\Java\jdk1.8.0_40\include" "/IC:\Program Files\Java\jdk1.8.0_40\include\win32" D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\jniStringTest.cpp /W3 /Oi /O2 /EHsc /Gy /GL /MD /LD /link /OUT:D:\dev\eclipsews-luna\javacpp-master\target\test-classes\org\bytedeco\javacpp\windows-x86_64\jniStringTest.dll 
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.331 sec <<< FAILURE!
org.bytedeco.javacpp.StringTest  Time elapsed: 0.33 sec  <<< ERROR!
java.io.IOException: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at org.bytedeco.javacpp.tools.Builder.compile(Builder.java:317)
    at org.bytedeco.javacpp.tools.Builder.generateAndCompile(Builder.java:371)
    at org.bytedeco.javacpp.tools.Builder.build(Builder.java:642)
    at org.bytedeco.javacpp.StringTest.setUpClass(StringTest.java:54)
    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:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    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:497)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 25 more


Results :

Tests in error: 
  org.bytedeco.javacpp.IndexerTest: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified
  org.bytedeco.javacpp.StringTest: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.861 s
[INFO] Finished at: 2015-08-23T12:27:12+08:00
[INFO] Final Memory: 31M/291M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project javacpp: There are test failures.
[ERROR] 
[ERROR] Please refer to D:\dev\eclipsews-luna\javacpp-master\target\surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException

@saudet
Copy link
Member

saudet commented Aug 29, 2015

@chinadragon0515 You're understanding is correct. JavaCPP is just not finding the default compiler for your platform, which is MSVC on Windows. Please install MSVC.

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

No branches or pull requests

3 participants