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 to build javacpp-presets on windows #81

Closed
chinadragon0515 opened this issue Aug 24, 2015 · 10 comments
Closed

How to build javacpp-presets on windows #81

chinadragon0515 opened this issue Aug 24, 2015 · 10 comments
Labels

Comments

@chinadragon0515
Copy link

Per this issue bytedeco/javacv#196, I want to build javacpp and javacpp-presets.

I am using windows system, and I find a guide https://github.com/bytedeco/javacpp-presets/wiki/Building-on-Windows, my questions are,

  1. If I already download opencv 3.0.0, can I avoid to build it but make some changes point to it? If yes, where I need to make the changes?
  2. Can I run the mvn build with eclipse directly, but not need env. like mssy2?

thanks.

@saudet
Copy link
Member

saudet commented Aug 24, 2015

What "changes" are you referring to?

We can run Maven from Eclipse, sure, no problem. What issues are you encountering?

@chinadragon0515
Copy link
Author

This is the exception I got when I run in maven directly, it looks for a opencv file and fail to find it,

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.417 s
[INFO] Finished at: 2015-08-24T19:11:34+08:00
[INFO] Final Memory: 23M/286M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.0:build (generate-sources) on project opencv: Failed to execute JavaCPP Builder: Could not parse "opencv2\hal\defs.h": File does not exist -> [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.

@saudet
Copy link
Member

saudet commented Aug 24, 2015

I see, you want to change the include and link directories. That can be done by adjusting the values in the pom.xml file here:
https://github.com/bytedeco/javacpp-presets/blob/master/pom.xml#L153
It's not very user friendly. It's usually easier to just use cppbuild.sh.

@chinadragon0515
Copy link
Author

I made the changes, and met the issue again, and I search pre-built opencv 3.0, there is no face.hpp, is this a known issue or I need to build opencv first? Or follow this guide https://github.com/bytedeco/javacpp-presets/wiki/Building-on-Windows is recommended? And note I only want to build opencv now. thanks.

[INFO] Parsing D:\Project\javacv\opencv\opencv3.0\build\include\opencv2\imgproc.hpp
[ERROR] Failed to execute JavaCPP Builder: Could not parse "opencv2\face.hpp": File does not exist
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.325 s
[INFO] Finished at: 2015-08-24T19:22:07+08:00
[INFO] Final Memory: 27M/712M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.0:build (generate-sources) on project opencv: Failed to execute JavaCPP Builder: Could not parse "opencv2\face.hpp": File does not exist -> [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

@saudet
Copy link
Member

saudet commented Aug 24, 2015

We can remove opencv_face.java from the presets if you are not interested by that module...

@chinadragon0515
Copy link
Author

The new exception is

[ERROR] Failed to execute JavaCPP Builder: Could not parse "opencv2\xfeatures2d.hpp": File does not exist

Do we know what's the root cause for this? Is there a defect on this part?

And I tried to follow windows build guide, my computer failed to install window SDK, can I build in msys shell?

Do we have some plan to build javacv 1.0 with face recognizer? thanks.

@saudet
Copy link
Member

saudet commented Aug 25, 2015

Again, if you're not interested in the xfeatures2d module, just delete opencv_xfeatures2d.java from the presets.

The compiler as part of the SDK is gone. Just install Visual Studio instead.

Sure, there's eventually going to be a release.

@chinadragon0515
Copy link
Author

No luck,
need it try to use VC command "cl" to build, but I do not have VC, I only have mingw,

[INFO] cl /ID:\Project\javacv\opencv\opencv3.0\build\include "/IC:\Program Files\Java\jdk1.8.0_40\include" "/IC:\Program Files\Java\jdk1.8.0_40\include\win32" D:\dev\eclipsews-luna\javacpp-presets-master\opencv\target\classes\org\bytedeco\javacpp\jnicvkernels.cpp /fp:fast /W3 /Oi /O2 /EHsc /Gy /GL /MD /LD /link /OUT:D:\dev\eclipsews-luna\javacpp-presets-master\opencv\target\classes\org\bytedeco\javacpp\windows-x86_64\jnicvkernels.dll /LIBPATH:D:\Project\javacv\opencv\opencv3.0\build\x64\mingw\lib\ opencv_imgproc300.lib opencv_core300.lib 
[ERROR] Failed to execute JavaCPP Builder: Cannot run program "cl": CreateProcess error=2, The system cannot find the file specified

My question is can I specified the compiler to mingw? If yes, can you help to show how? thanks

@saudet
Copy link
Member

saudet commented Aug 25, 2015

OpenCV supports better MSVC, and it's free anyway, so I don't feel there's any reason to not use it...?

@saudet
Copy link
Member

saudet commented Oct 30, 2015

I've documented the build environments on this wiki page:
https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments#windows-x86-and-x86_64
Please follow those instructions.

@saudet saudet closed this as completed Oct 30, 2015
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

2 participants