Open jobsLee-lcj opened 3 years ago
Please take a look at small existing projects depending on OpenCV this way. You can use those as templates for your own library: https://github.com/bytedeco/javacpp-presets/tree/master/chilitags https://github.com/bytedeco/javacpp-presets/tree/master/flandmark
Please take a look at small existing projects depending on OpenCV this way. You can use those as templates for your own library: https://github.com/bytedeco/javacpp-presets/tree/master/chilitags https://github.com/bytedeco/javacpp-presets/tree/master/flandmark
thank you for your reply. I have try the project of flandmark as follow steps:
bash cppbuild.sh install flandmark
mvn clean install -Djavacpp.platform=macosx-x86_64 -e -X --projects=flandmark
what a pity, it BUILD FAILURE. error info:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.049 s
[INFO] Finished at: 2020-10-23T10:09:38+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.5.5-SNAPSHOT:build (javacpp-compiler) on project flandmark: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.5-SNAPSHOT:build failed: Process exited with an error: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.bytedeco:javacpp:1.5.5-SNAPSHOT:build (javacpp-compiler) on project flandmark: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.5-SNAPSHOT:build failed: Process exited with an error: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution javacpp-compiler of goal org.bytedeco:javacpp:1.5.5-SNAPSHOT:build failed: Process exited with an error: 1
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
Caused by: java.lang.RuntimeException: Process exited with an error: 1
at org.bytedeco.javacpp.tools.Builder.generateAndCompile (Builder.java:628)
at org.bytedeco.javacpp.tools.Builder.build (Builder.java:1174)
at org.bytedeco.javacpp.tools.BuildMojo.execute (BuildMojo.java:417)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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)
[ERROR]
[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/PluginExecutionException
Additional, some C++ build error info as follow when run mvn clean install -Djavacpp.platform=macosx-x86_64 -e -X --projects=flandmark
.
In file included from /Users/lcj/Desktop/work/javacpp-presets/flandmark/target/native/org/bytedeco/flandmark/macosx-x86_64/jniflandmark.cpp:104:
In file included from /Users/lcj/Desktop/work/javacpp-presets/openblas/cppbuild/macosx-x86_64/include/lapacke_config.h:46:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:245:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/usr/local/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from /Users/lcj/Desktop/work/javacpp-presets/flandmark/target/native/org/bytedeco/flandmark/macosx-x86_64/jniflandmark.cpp:104:
In file included from /Users/lcj/Desktop/work/javacpp-presets/openblas/cppbuild/macosx-x86_64/include/lapacke_config.h:46:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:245:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error: no member named 'isgreater' in the global namespace
using ::isgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
In file included from /Users/lcj/Desktop/work/javacpp-presets/flandmark/target/native/org/bytedeco/flandmark/macosx-x86_64/jniflandmark.cpp:104:
It works fine on Travis CI. Looks like you have an old and/or broken version of Xcode installed. You'll need to fix that: https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments#mac-os-x-x86_64
It works fine on Travis CI. Looks like you have an old and/or broken version of Xcode installed. You'll need to fix that: https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments#mac-os-x-x86_64
I hava try that before。However,the build-environments for mac is outdated,my system is macOS Catalina 10.15.6
and Xcode is Xcode 11.5
. /Library/Developer/CommandLineTools/Packages/
does not exist (so there's not yet a .pkg file to open).As the link shows:
https://stackoverflow.com/questions/58278260/cant-compile-a-c-program-on-a-mac-after-upgrading-to-catalina-10-15/58278392#58278392
After export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
, it still not solved my problem.
Ok, after half day work, I build the project of flandmark success. My solution depends on the link: https://stackoverflow.com/questions/58628377/catalina-c-using-cmath-headers-yield-error-no-member-named-signbit-in-th/59780819#59780819
because the #include <...>
search order, after gcc -Wp,-v -E -
I just do sudo rm -rf /usr/local/include
, then build success.maybe there is some danger unknown.
But when I run the SimpleExample class of flandmark. IDEA throw error:
Information:java: Errors occurred while compiling module 'opencv'
Information:javac 1.8.0_171 was used to compile java sources
Information:2020/10/23, 19:13 - Build completed with 1 error and 1 warning in 3 m 3 s
Error:java: java.lang.OutOfMemoryError: GC overhead limit exceeded
You'll need to make sure Java has enough memory, for example, by setting the -Xmx option this way:
export _JAVA_OPTIONS=-Xmx2048m
https://github.com/bytedeco/javacpp-presets/blob/master/ci/install-travis.sh#L232
I'm on Mac, and I have follow files:
sportsai_AIbasketball_data_type.hpp as follow:
as the code shows, C++ header file need opencv. so, how could I write the java Parser config file. My code as follow:
Then, run
mvn clean install -Djavacpp.platform=macosx-x86_64 --projects=ai_basketball
, it can generate the java interface class. but COMPILATION ERROR. error info as follow:[ERROR] /Users/lcj/Desktop/work/javacpp-presets/ai_basketball/src/gen/java/org/bytedeco/ai_basketball/global.java:[111,52] 找不到符号 符号: 类 Mat 位置: 类 org.bytedeco.ai_basketball.global [ERROR] /Users/lcj/Desktop/work/javacpp-presets/ai_basketball/src/gen/java/org/bytedeco/ai_basketball/global.java:[163,74] 找不到符号 符号: 类 Point 位置: 类 org.bytedeco.ai_basketball.global
that means could not find class Mat or Point etc which from opencv.My question is how to write the @Properties in java config file? Thank you for your help.