Skip to content

Commit

Permalink
* Let presets pick up include or link paths from cached resource…
Browse files Browse the repository at this point in the history
…s (pull #101)
  • Loading branch information
saudet committed Apr 28, 2017
1 parent 623d950 commit 37ddac1
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Let presets pick up `include` or `link` paths from cached resources ([pull #101](https://github.com/bytedeco/javacpp-presets/pull/101))
* Update presets for Visual Studio 2015 ([issue #298](https://github.com/bytedeco/javacpp-presets/issues/298))
* Reuse the presets for HDF5 with Caffe
* Replace the `exec-maven-plugin` with the `javacpp` plugin itself to execute the `cppbuild.sh` script files
Expand Down
35 changes: 35 additions & 0 deletions caffe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,41 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>hdf5</artifactId>
<version>1.10.0-patch1-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>0.2.19-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>hdf5</artifactId>
<version>1.10.0-patch1-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>0.2.19-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<propertyKeysAndValues>
<property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"caffe/layers/lrn_layer.hpp", "caffe/layers/cudnn_lrn_layer.hpp", "caffe/layers/cudnn_lcn_layer.hpp", "caffe/layers/pooling_layer.hpp", "caffe/layers/cudnn_pooling_layer.hpp",
"caffe/layers/spp_layer.hpp", "caffe/layers/recurrent_layer.hpp", "caffe/layers/lstm_layer.hpp", "caffe/layers/rnn_layer.hpp", "caffe/util/benchmark.hpp", "caffe/util/db.hpp",
"caffe/util/db_leveldb.hpp", "caffe/util/db_lmdb.hpp", "caffe/util/io.hpp", "caffe/util/rng.hpp", "caffe/util/im2col.hpp", "caffe/util/insert_splits.hpp", "caffe/util/mkl_alternate.hpp",
"caffe/util/upgrade_proto.hpp", "caffe/util/cudnn.hpp"}, link = "caffe@.1.0.0-rc5", includepath = {"/usr/local/cuda/include/",
"caffe/util/upgrade_proto.hpp", "caffe/util/cudnn.hpp"}, link = "caffe@.1.0.0-rc5", resource = {"include", "lib"}, includepath = {"/usr/local/cuda/include/",
"/System/Library/Frameworks/vecLib.framework/", "/System/Library/Frameworks/Accelerate.framework/"}, linkpath = "/usr/local/cuda/lib/"),
@Platform(value = {"linux-x86_64", "macosx-x86_64"}, define = {"SHARED_PTR_NAMESPACE boost", "USE_LEVELDB", "USE_LMDB", "USE_OPENCV"}) })
public class caffe implements InfoMapper {
Expand Down
13 changes: 13 additions & 0 deletions chilitags/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<compilerOptions>
<compilerOption>-std=c++11</compilerOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* @author Samuel Audet
*/
@Properties(value = @Platform(include = "chilitags/chilitags.hpp", link = "chilitags_static"),
@Properties(value = @Platform(include = "chilitags/chilitags.hpp", link = "chilitags_static", resource = {"include", "lib"}),
inherit = {opencv_calib3d.class, opencv_video.class}, target = "org.bytedeco.javacpp.chilitags")
public class chilitags implements InfoMapper {
public void map(InfoMap infoMap) {
Expand Down
13 changes: 13 additions & 0 deletions flandmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<propertyKeysAndValues>
<property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* @author Jarek Sacha
*/
@Properties(value = @Platform(define = "FLANDMAR_MSVC_COMPAT", include = {"flandmark_detector.h", "liblbp.h"}, link = "flandmark_static"),
@Properties(value = @Platform(define = "FLANDMAR_MSVC_COMPAT", include = {"flandmark_detector.h", "liblbp.h"}, link = "flandmark_static", resource = {"include", "lib"}),
inherit = opencv_imgproc.class, target = "org.bytedeco.javacpp.flandmark")
public class flandmark implements InfoMapper {
public void map(InfoMap infoMap) {
Expand Down
2 changes: 1 addition & 1 deletion hdf5/src/main/java/org/bytedeco/javacpp/presets/hdf5.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"H5Attribute.h", "H5OcreatProp.h", "H5DcreatProp.h", "H5CommonFG.h", "H5DataType.h", "H5DxferProp.h", "H5FaccProp.h", "H5FcreatProp.h",
"H5AtomType.h", "H5PredType.h", "H5EnumType.h", "H5IntType.h", "H5FloatType.h", "H5StrType.h", "H5CompType.h", "H5ArrayType.h",
"H5VarLenType.h", "H5DataSet.h", "H5Group.h", "H5File.h", "H5Library.h"},
link = {"hdf5@.100", "hdf5_hl@.100", "hdf5_cpp@.100"}),
link = {"hdf5@.100", "hdf5_hl@.100", "hdf5_cpp@.100"}, resource = {"include", "lib"}),
@Platform(value = "windows", link = {"libhdf5", "libhdf5_hl", "libhdf5_cpp", "libszip", "libzlib"}, preload = {"msvcp120", "msvcr120"}),
@Platform(value = "windows-x86", includepath = "C:/Program Files (x86)/HDF_Group/HDF5/1.10.0/include/",
preloadpath = "C:/Program Files (x86)/HDF_Group/HDF5/1.10.0/bin/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
@Platform(include={"leptonica/alltypes.h", "leptonica/environ.h", "leptonica/array.h", "leptonica/bbuffer.h", "leptonica/heap.h", "leptonica/list.h",
"leptonica/ptra.h", "leptonica/queue.h", "leptonica/rbtree.h", "leptonica/stack.h", "leptonica/arrayaccess.h", "leptonica/bmf.h", "leptonica/ccbord.h",
"leptonica/dewarp.h", "leptonica/gplot.h", "leptonica/imageio.h", "leptonica/jbclass.h", "leptonica/morph.h", "leptonica/pix.h",
"leptonica/recog.h", "leptonica/regutils.h", "leptonica/stringcode.h", "leptonica/sudoku.h", "leptonica/watershed.h", "leptonica/allheaders.h"}, link="lept@.5"),
"leptonica/recog.h", "leptonica/regutils.h", "leptonica/stringcode.h", "leptonica/sudoku.h", "leptonica/watershed.h", "leptonica/allheaders.h"},
link="lept@.5", resource = {"include", "lib"}),
@Platform(value="android", link="lept"),
@Platform(value="windows", link="liblept", preload={"libwinpthread-1", "libgcc_s_dw2-1", "libgcc_s_seh-1", "libstdc++-6", "liblept-5"}),
@Platform(value="windows-x86", preloadpath="C:/msys64/mingw32/bin/"),
Expand Down
24 changes: 24 additions & 0 deletions mxnet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>0.2.19-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.2.0-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>0.2.19-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<propertyKeysAndValues>
<property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Platform(value = {"linux-x86", "macosx"}, compiler = "cpp11", define = {"DMLC_USE_CXX11 1", "MSHADOW_USE_CBLAS 1", "MSHADOW_IN_CXX11 1"},
include = {"mxnet/c_api.h", "mxnet/c_predict_api.h", /*"dmlc/base.h", "dmlc/io.h", "dmlc/logging.h", "dmlc/type_traits.h",
"dmlc/parameter.h", "mshadow/base.h", "mshadow/expression.h", "mshadow/tensor.h", "mxnet/base.h",*/},
link = "mxnet", includepath = {"/usr/local/cuda/include/",
link = "mxnet", resource = {"include", "lib"}, includepath = {"/usr/local/cuda/include/",
"/System/Library/Frameworks/vecLib.framework/", "/System/Library/Frameworks/Accelerate.framework/"}, linkpath = "/usr/local/cuda/lib/") })
public class mxnet implements InfoMapper {
public void map(InfoMap infoMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
* @author Samuel Audet
*/
@Properties(target = "org.bytedeco.javacpp.openblas", value = {@Platform(define = {"__OPENBLAS 1", "LAPACK_COMPLEX_CPP"},
include = {"openblas_config.h", "cblas.h", "blas_extra.h", "lapacke_config.h", "lapacke_mangling.h", "lapacke.h", "lapacke_utils.h"}, link = "openblas@.0",
include = {"openblas_config.h", "cblas.h", "blas_extra.h", "lapacke_config.h", "lapacke_mangling.h", "lapacke.h", "lapacke_utils.h"},
link = "openblas@.0", resource = {"include", "lib"},
preload = {"iomp5", "mkl_avx", "mkl_avx2", "mkl_avx512_mic", "mkl_def", "mkl_mc3", "mkl_core", "mkl_gnu_thread", "mkl_intel_lp64",
"mkl_intel_thread", "mkl_rt", "mkl_rt#openblas@.0", "gcc_s@.1", "quadmath@.0", "gfortran@.3"}, compiler = "fastfpu"),
@Platform(value = "android", include = {"openblas_config.h", "cblas.h", "blas_extra.h" /* no LAPACK */}, link = "openblas", preload = "", compiler = "fastfpu"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"<algorithm>", "<map>", "<opencv2/core/saturate.hpp>", "<opencv2/core/version.hpp>", "<opencv2/core/base.hpp>", "<opencv2/core/cvstd.hpp>",
"<opencv2/core/utility.hpp>", "<opencv2/core/types_c.h>", "<opencv2/core/core_c.h>", "<opencv2/core/types.hpp>",
"<opencv2/core.hpp>", "<opencv2/core/operations.hpp>", "<opencv2/core/bufferpool.hpp>", "<opencv2/core/mat.hpp>",
"<opencv2/core/persistence.hpp>", "<opencv2/core/optim.hpp>", "opencv_adapters.h"}, link = {"opencv_core@.3.2", "opencv_imgproc@.3.2"}),
"<opencv2/core/persistence.hpp>", "<opencv2/core/optim.hpp>", "opencv_adapters.h"}, link = {"opencv_core@.3.2", "opencv_imgproc@.3.2"},
resource = {"include", "lib", "sdk", "share"}),
@Platform(value = "linux", preloadpath = {"/usr/lib/", "/usr/lib32/", "/usr/lib64/"}, preload = "gomp@.1"),
@Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}),
@Platform(value = "linux-x86", preloadpath = {"/usr/lib32/", "/usr/lib/"}),
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@
<includePath>${basedir}/cppbuild/${javacpp.platform}/include/</includePath>
<linkPath>${basedir}/cppbuild/${javacpp.platform}/lib/</linkPath>
<preloadPath>${basedir}/cppbuild/${javacpp.platform}/bin/</preloadPath>
<includeResources>
<includeResource>/org/bytedeco/javacpp/include/</includeResource>
<includeResource>/org/bytedeco/javacpp/${javacpp.platform}/include/</includeResource>
</includeResources>
<linkResource>/org/bytedeco/javacpp/${javacpp.platform}/lib/</linkResource>
<resourcePath>${basedir}/cppbuild/${javacpp.platform}/</resourcePath>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -241,6 +247,7 @@
<skip>${javacpp.compiler.skip}</skip>
<classOrPackageName>org.bytedeco.javacpp.*</classOrPackageName>
<copyLibs>true</copyLibs>
<!-- <copyResources>true</copyResources>-->
</configuration>
</execution>
</executions>
Expand Down
13 changes: 13 additions & 0 deletions tesseract/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<dependencies>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>leptonica</artifactId>
<version>1.74.1-${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>leptonica</artifactId>
<version>1.74.1-${project.parent.version}</version>
<classifier>${javacpp.platform}</classifier>
</dependency>
</dependencies>
<configuration>
<propertyKeysAndValues>
<property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
@Properties(target="org.bytedeco.javacpp.tesseract", inherit=lept.class, value={
@Platform(define="TESS_CAPI_INCLUDE_BASEAPI", include={"tesseract/platform.h", "tesseract/apitypes.h", "tesseract/unichar.h", "tesseract/host.h",
"tesseract/tesscallback.h", "tesseract/publictypes.h", "tesseract/thresholder.h", "tesseract/pageiterator.h", "tesseract/ltrresultiterator.h",
"tesseract/resultiterator.h", "tesseract/strngs.h", "tesseract/genericvector.h", "tesseract/baseapi.h", "tesseract/capi.h"}, link="tesseract@.3"),
"tesseract/resultiterator.h", "tesseract/strngs.h", "tesseract/genericvector.h", "tesseract/baseapi.h", "tesseract/capi.h"},
link="tesseract@.3", resource = {"include", "lib"}),
@Platform(value="android", link="tesseract"),
@Platform(value="windows", link="libtesseract", preload="libtesseract-3") })
public class tesseract implements InfoMapper {
Expand Down

0 comments on commit 37ddac1

Please sign in to comment.