JavaCPP 1.5初体验

  |   0 评论   |   39 浏览

背景

之前写了一系列JavaCPP的文章,但都是基于JavaCPP 1.4.4版本。

目前最新的稳定版为 JavaCPP 1.5,同时在反复的操作中,发现有些步骤是可以省略的。

本文介绍一下JavaCPP 1.5。

环境构建

centos:7环境

docker run --privileged -it centos:7 /bin/bash

安装必要的包

yum install ccache clang gcc-c++ gcc-gfortran java-devel ant python python36-devel python36-setuptools numpy swig git file which wget unzip tar bzip2 gzip xz patch autoconf-archive automake make cmake3 libtool perl nasm yasm alsa-lib-devel freeglut-devel gtk2-devel libusb-devel libusb1-devel zlib-devel SDL-devel libva-devel python36-pip

这里面去掉了maven,因为官方的maven版本 3.0.5 太低了,使用时会报错

安装maven

wget "http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz"
tar xvf apache-maven-3.6.1-bin.tar.gz
ln -sf /root/share/apache-maven-3.6.1/bin/mvn /usr/bin

下载JavaCPP

构建 JavaCPP

# git clone -b 1.5 https://github.com/bytedeco/javacpp.git  
# cd javacpp
# mvn clean install

成功提示

[INFO] Installing /root/build/javacpp/target/javacpp.jar to /root/.m2/repository/org/bytedeco/javacpp/1.5/javacpp-1.5.jar
[INFO] Installing /root/build/javacpp/pom.xml to /root/.m2/repository/org/bytedeco/javacpp/1.5/javacpp-1.5.pom
[INFO] Installing /root/build/javacpp/target/javacpp-sources.jar to /root/.m2/repository/org/bytedeco/javacpp/1.5/javacpp-1.5-sources.jar
[INFO] Installing /root/build/javacpp/target/javacpp-javadoc.jar to /root/.m2/repository/org/bytedeco/javacpp/1.5/javacpp-1.5-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  54.005 s
[INFO] Finished at: 2019-06-02T12:29:25Z

构建 JavaCPP-presets

git clone -b 1.4.4 https://github.com/bytedeco/javacpp-presets.git  

构建 cminpack 为例

cd javacpp-presets/cminpack/
mvn clean package

评论

发表评论

validate