| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~ contributor license agreements. See the NOTICE file distributed with |
| ~ this work for additional information regarding copyright ownership. |
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 |
| ~ (the "License"); you may not use this file except in compliance with |
| ~ the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, software |
| ~ distributed under the License is distributed on an "AS IS" BASIS, |
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ~ See the License for the specific language governing permissions and |
| ~ limitations under the License. |
| --> |
| <project xmlns="http://maven.apache.org/POM/4.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| <modelVersion>4.0.0</modelVersion> |
| <parent> |
| <groupId>org.apache.mxnet</groupId> |
| <artifactId>mxnet-parent</artifactId> |
| <version>INTERNAL</version> |
| <relativePath>../pom.xml</relativePath> |
| </parent> |
| |
| <artifactId>libmxnet-scala</artifactId> |
| <name>MXNet Scala Package - Native</name> |
| <packaging>${libtype}</packaging> |
| |
| <properties> |
| <MXNET_DIR>${project.parent.basedir}/..</MXNET_DIR> |
| </properties> |
| |
| <profiles> |
| <profile> |
| <id>osx-x86_64</id> |
| <activation> |
| <os><family>mac</family></os> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>native-maven-plugin</artifactId> |
| <extensions>true</extensions> |
| <configuration> |
| <javahOS>darwin</javahOS> |
| <compilerProvider>generic-classic</compilerProvider> |
| <compilerExecutable>${cxx}</compilerExecutable> |
| <linkerExecutable>${cxx}</linkerExecutable> |
| <sources> |
| <source> |
| <directory>src/main/native</directory> |
| <fileNames> |
| <fileName>org_apache_mxnet_native_c_api.cc</fileName> |
| </fileNames> |
| </source> |
| </sources> |
| <compilerStartOptions> |
| <compilerStartOption>-std=c++0x</compilerStartOption> |
| </compilerStartOptions> |
| <compilerEndOptions> |
| <compilerEndOption>-I${MXNET_DIR}/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/dmlc-core/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/mshadow</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/dlpack/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/tvm/nnvm/include</compilerEndOption> |
| <compilerEndOption>-DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CUDA=0</compilerEndOption> |
| <compilerEndOption>-g -O0 -fPIC -msse3 -mf16c</compilerEndOption> |
| <compilerEndOption>-Wall -Wsign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-local-typedefs</compilerEndOption> |
| </compilerEndOptions> |
| <linkerStartOptions> |
| <linkerStartOption>-shared</linkerStartOption> |
| </linkerStartOptions> |
| <linkerMiddleOptions> |
| <linkerMiddleOption>-framework JavaVM</linkerMiddleOption> |
| <linkerMiddleOption>-Wl,-exported_symbol,_Java_*</linkerMiddleOption> |
| <linkerMiddleOption>-Wl,-x</linkerMiddleOption> |
| </linkerMiddleOptions> |
| <linkerEndOptions> |
| <linkerEndOption>-Wl,-install_name,libmxnet-scala.jnilib -lmxnet -L${MXNET_DIR}/lib</linkerEndOption> |
| </linkerEndOptions> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <version>1.6.0</version> |
| <executions> |
| <execution> |
| <id>post-native-build</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>install_name_tool</executable> |
| <commandlineArgs>-add_rpath @loader_path ${project.build.directory}/${project.artifactId}.jnilib</commandlineArgs> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>linux-x86_64</id> |
| <activation> |
| <os> |
| <family>unix</family> |
| <name>Linux</name> |
| </os> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>native-maven-plugin</artifactId> |
| <extensions>true</extensions> |
| <configuration> |
| <javahOS>linux</javahOS> |
| <compilerProvider>generic-classic</compilerProvider> |
| <compilerExecutable>${cxx}</compilerExecutable> |
| <linkerExecutable>${cxx}</linkerExecutable> |
| <sources> |
| <source> |
| <directory>src/main/native</directory> |
| <fileNames> |
| <fileName>org_apache_mxnet_native_c_api.cc</fileName> |
| </fileNames> |
| </source> |
| </sources> |
| <compilerStartOptions> |
| <compilerStartOption>-std=c++0x</compilerStartOption> |
| </compilerStartOptions> |
| <compilerEndOptions> |
| <compilerEndOption>-I${MXNET_DIR}/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/dmlc-core/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/mshadow</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/dlpack/include</compilerEndOption> |
| <compilerEndOption>-I${MXNET_DIR}/3rdparty/tvm/nnvm/include</compilerEndOption> |
| <compilerEndOption>-DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CUDA=0</compilerEndOption> |
| <compilerEndOption>-O3 -DNDEBUG=1 -fPIC -msse3 -mf16c</compilerEndOption> |
| <compilerEndOption>-Wall -Wsign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-local-typedefs</compilerEndOption> |
| </compilerEndOptions> |
| <linkerStartOptions> |
| <linkerStartOption>-shared</linkerStartOption> |
| </linkerStartOptions> |
| <linkerEndOptions> |
| <linkerEndOption>-Wl,-rpath=${dollar}ORIGIN -lmxnet -L${MXNET_DIR}/lib</linkerEndOption> |
| </linkerEndOptions> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <version>1.6.0</version> |
| <executions> |
| <execution> |
| <id>link-native-lib</id> |
| <phase>generate-resources</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>bash</executable> |
| <commandlineArgs>-c 'ln -sf ${MXNET_DIR}/lib/* ${project.build.directory}/'</commandlineArgs> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </project> |