bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.64k stars 736 forks source link

zlib tutorial #129

Closed lobsteroh closed 8 years ago

lobsteroh commented 8 years ago

am getting way deeper into this than is good for me, but I am eager to get the presets working. as i am following along on the zlib tutorial, I issue mvn clean package --projects zlib and things wobble out of control with

[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for org.bytedeco.javacpp-presets:zlib:jar:1.2.8-1.0 [WARNING] 'version' contains an expression but should be a constant. @ org.bytedeco.javacpp-presets:zlib:1.2.8-${project.parent.version}, /Users/lobsterman/Documents/C-Java/javacpp/javacpp-presets_RH/zlib/pom.xml, line 14, column 12

and

[INFO] ------------------------------------------------------------------------ [INFO] Building JavaCPP Presets for OpenCV 3.0.0-1.2-SNAPSHOT [INFO] ------------------------------------------------------------------------ [WARNING] The POM for org.bytedeco:javacpp:jar:1.2-SNAPSHOT is missing, no dependency information available

is this something under my control to fix, is it a javacpp issue, or am i just doing something really stupid?

saudet commented 8 years ago

That just means you need to run mvn install for the javacpp module first.

saudet commented 8 years ago

That probably needs to be cleared up in the tutorial.

lobsteroh commented 8 years ago

thanks. so i mvn packaged the javacpp pom and got a clean everything on it Tests run: 15, Failures: 0, Errors: 0, Skipped: 0

so i trust the beast was installed at /Users/lobsterman/.m2/repository/org/bytedeco/javacpp-presets/1.2-SNAPSHOT/javacpp-presets-1.2-SNAPSHOT.pom

but when i mvn any of the presets (opencv, zlib or anything else) still sez ... [WARNING] The POM for org.bytedeco:javacpp:jar:1.2-SNAPSHOT is missing, no dependency information available

where is it looking for the thing? do i need to copy something somewhere else?

saudet commented 8 years ago

Right, we need the parent POM of the javacpp-presets module as well. Maven maps that to the "." project, so we can call something like this:

mvn clean install --projects .,zlib
lobsteroh commented 8 years ago

what i am saying is that this does not work for me, even for the existing child modules. i went through one by one systematically and only

mvn clean install --projects .,flycapture mvn clean install --projects .,videoinput

build without error

all the others fail with one of two similar error messages ...

mvn clean install --projects .,opencv fails with ... [ERROR] Failed to execute goal org.bytedeco:javacpp:1.2-SNAPSHOT:build (generate-sources) on project opencv: Failed to execute JavaCPP Builder: Could not parse "opencv2/hal/defs.h": File does not exist -> [Help 1]

or

mvn clean install --projects .,chilitags fails with ... [ERROR] Failed to execute goal on project chilitags: Could not resolve dependencies for project org.bytedeco.javacpp-presets:chilitags:jar:master-1.2-SNAPSHOT: Could not find artifact org.bytedeco.javacpp-presets:opencv:jar:3.0.0-1.2-SNAPSHOT -> [Help 1]

any suggestions?

saudet commented 8 years ago

Sure, that's another error. :) Be sure to run the cppbuild.sh script before everything.

lobsteroh commented 8 years ago

that must have been the step i had messed up. did the bash cppbuild.sh -platform macosx-x86_64 install and things came together like a charm. thanks @saudet. you made christmas come early. i owe you.

kristofgiber commented 8 years ago

I'm trying to reproduce the above and run bash cppbuild.sh -platform macosx-x86_64. It's a lengthy process and I've already encountered and fixed several issues related to some of my softwares not being up-to-date but this one I can't seem to fix:

When running bash cppbuild.sh install llvm it fails with the error:

x llvm-3.7.0.src/test/MC/SystemZ/insn-good.sxz: ../llvm-3.7.0.src.tar.xz: Unexpected end of input : Truncated tar archive tar: Error exit delayed from previous errors.

Any idea or workaround? Is this an issue with the llvm 3.7 release for osx or something else?

saudet commented 8 years ago

Please see https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments for the platform-specific instructions.

saudet commented 8 years ago

Maybe the scripts are having problems downloading the files properly on your machine. Try to download them some other way and put them under the "downloads" directory.

lobsteroh commented 8 years ago

hi kristof, i just double checked on my machine and can confirm that i get a clean bash for llvm all the way. i am on osx 10.11.1

kristofgiber commented 8 years ago

Thank you for the helps, in fact I'd missed the wiki page on Build Environments before, after installing some missing tools listed there, it indeed finished without error for all the modules but leptonica (and tesseract which depends on it). Leptonica needed a change in its cppbuild.sh though to finish because with libpng version 1.6.17 (lines 13 and 20), as it's now, it failed to uncompress. This was fixed when I changed to 1.6.20.

However, even after all the modules installed, and running 'mvn install' to javacpp with success, I still get the usual build error for 15 functions when I do 'mvn clean install --projects .,opencv':

In file included from /Users/user/Code/git/javacpp-presets/opencv/target/classes/org/bytedeco/javacpp/jnicvkernels.cpp:69:
.../javacpp-presets/opencv/cppbuild/macosx-x86_64/include/opencv2/core/saturate.hpp:102:83: error: 
      no member named 'max' in namespace 'std'; did you mean 'fmax'?
  ...uchar saturate_cast<uchar>(schar v)        { return (uchar)std::max((int)...                                                               
/usr/include/math.h:546:15: note: 'fmax' declared here
extern double fmax(double, double);
... 15 errors generated.

This doesn't prevent me from building zlib but I don't think it's a good sign for projects that depend on opencv. Any solutions on your minds?

kristofgiber commented 8 years ago

And indeed, this error may be related to my build error when running mvn clean package --projects .,flandmark:

[ERROR] Failed to execute goal on project flandmark: Could not resolve dependencies for project org.bytedeco.javacpp-presets:flandmark:jar:1.07-1.2-SNAPSHOT: Could not find artifact org.bytedeco.javacpp-presets:opencv:jar:3.1.0-1.2-SNAPSHOT -> [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
saudet commented 8 years ago

@kristofgiber Forgot to reply to this apparently, but that probably just means your version of Xcode is too old to compile OpenCV 3.1.