Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

mvn install produces packages with invalid pom xml #15618

Closed
vkorenev opened this issue Jul 20, 2019 · 6 comments
Closed

mvn install produces packages with invalid pom xml #15618

vkorenev opened this issue Jul 20, 2019 · 6 comments

Comments

@vkorenev
Copy link

Description

When building Scala from source, mvn install produces packages with non-expanded ${libtype} in their pom files. This causes an error when trying to use them from sbt build.

Environment info (Required)

----------Python Info----------
('Version      :', '2.7.15+')
('Compiler     :', 'GCC 7.3.0')
('Build        :', ('default', 'Nov 27 2018 23:36:35'))
('Arch         :', ('64bit', ''))
------------Pip Info-----------
No corresponding pip install for current python.
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
('Platform     :', 'Linux-5.0.0-20-generic-x86_64-with-Ubuntu-18.04-bionic')
('system       :', 'Linux')
('node         :', 'lambda')
('release      :', '5.0.0-20-generic')
('version      :', '#21~18.04.1-Ubuntu SMP Thu Jun 27 04:04:37 UTC 2019')
----------Hardware Info----------
('machine      :', 'x86_64')
('processor    :', 'x86_64')
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               94
Model name:          Intel(R) Xeon(R) CPU E3-1535M v5 @ 2.90GHz
Stepping:            3
CPU MHz:             1203.733
CPU max MHz:         3800.0000
CPU min MHz:         800.0000
BogoMIPS:            5808.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            8192K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0185 sec, LOAD: 1.0404 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0183 sec, LOAD: 0.8940 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0315 sec, LOAD: 0.3366 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0545 sec, LOAD: 0.3508 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0429 sec, LOAD: 0.1739 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.2459 sec, LOAD: 0.1956 sec.

Java version:

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

Maven version:

Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "5.0.0-20-generic", arch: "amd64", family: "unix"

Build info (Required if built from source)

MXNet commit hash:
cc861f0a3fecea8fb94c9687396e27966e5ddcde

Build command:
mvn install
(Completes successfully)

Error Message:

[error] java.net.URISyntaxException: Illegal character in path at index 101: file:/home/vkorenev/.m2/repository/org/apache/mxnet/libmxnet-scala/INTERNAL/libmxnet-scala-INTERNAL.${libtype}
[error]         at java.net.URI$Parser.fail(URI.java:2848)
[error]         at java.net.URI$Parser.checkChars(URI.java:3021)
[error]         at java.net.URI$Parser.parseHierarchical(URI.java:3105)
[error]         at java.net.URI$Parser.parse(URI.java:3053)
[error]         at java.net.URI.<init>(URI.java:588)
[error]         at java.net.URL.toURI(URL.java:946)
[error]         at sjsonnew.JavaExtraFormats.$anonfun$urlStringIso$1(JavaExtraFormats.scala:40)
[error]         at sjsonnew.IsoString$$anon$1.to(IsoString.scala:26)
[error]         at sjsonnew.IsoFormats$$anon$2.write(IsoFormats.scala:31)
[error]         at sjsonnew.StandardFormats$OptionFormat.write(StandardFormats.scala:37)
[error]         at sjsonnew.StandardFormats$OptionFormat.addField(StandardFormats.scala:44)
[error]         at sjsonnew.StandardFormats$OptionFormat.addField(StandardFormats.scala:33)
[error]         at sjsonnew.Builder.addField(Builder.scala:43)
[error]         at sbt.librarymanagement.ArtifactFormats$$anon$1.write(ArtifactFormats.scala:35)
[error]         at sbt.librarymanagement.ArtifactFormats$$anon$1.write(ArtifactFormats.scala:9)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2$adapted(CollectionFormats.scala:85)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:941)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:941)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:80)
[error]         at sjsonnew.JsonWriter.addField(JsonFormat.scala:40)
[error]         at sjsonnew.JsonWriter.addField$(JsonFormat.scala:37)
[error]         at sjsonnew.CollectionFormats$$anon$2.addField(CollectionFormats.scala:80)
[error]         at sjsonnew.Builder.addField(Builder.scala:43)
[error]         at sbt.librarymanagement.ModuleReportFormats$$anon$1.write(ModuleReportFormats.scala:42)
[error]         at sbt.librarymanagement.ModuleReportFormats$$anon$1.write(ModuleReportFormats.scala:9)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2$adapted(CollectionFormats.scala:85)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:941)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:941)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:80)
[error]         at sjsonnew.JsonWriter.addField(JsonFormat.scala:40)
[error]         at sjsonnew.JsonWriter.addField$(JsonFormat.scala:37)
[error]         at sjsonnew.CollectionFormats$$anon$2.addField(CollectionFormats.scala:80)
[error]         at sjsonnew.Builder.addField(Builder.scala:43)
[error]         at sbt.librarymanagement.ConfigurationReportFormats$$anon$1.write(ConfigurationReportFormats.scala:26)
[error]         at sbt.librarymanagement.ConfigurationReportFormats$$anon$1.write(ConfigurationReportFormats.scala:9)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.$anonfun$write$2$adapted(CollectionFormats.scala:85)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:941)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:941)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:85)
[error]         at sjsonnew.CollectionFormats$$anon$2.write(CollectionFormats.scala:80)
[error]         at sjsonnew.JsonWriter.addField(JsonFormat.scala:40)
[error]         at sjsonnew.JsonWriter.addField$(JsonFormat.scala:37)
[error]         at sjsonnew.CollectionFormats$$anon$2.addField(CollectionFormats.scala:80)
[error]         at sjsonnew.Builder.addField(Builder.scala:43)
[error]         at sbt.librarymanagement.UpdateReportFormats$$anon$1.write(UpdateReportFormats.scala:27)
[error]         at sbt.librarymanagement.UpdateReportFormats$$anon$1.write(UpdateReportFormats.scala:9)
[error]         at sjsonnew.SupportConverter.toJsonUnsafe(SupportConverter.scala:23)
[error]         at sjsonnew.SupportConverter.toJsonUnsafe$(SupportConverter.scala:20)
[error]         at sjsonnew.support.scalajson.unsafe.Converter$.toJsonUnsafe(Converter.scala:7)
[error]         at sjsonnew.SupportConverter.$anonfun$toJson$1(SupportConverter.scala:14)
[error]         at scala.util.Try$.apply(Try.scala:213)
[error]         at sjsonnew.SupportConverter.toJson(SupportConverter.scala:14)
[error]         at sjsonnew.SupportConverter.toJson$(SupportConverter.scala:13)
[error]         at sjsonnew.support.scalajson.unsafe.Converter$.toJson(Converter.scala:7)
[error]         at sbt.util.PlainOutput.write(Output.scala:16)
[error]         at sbt.util.FileBasedStore.$anonfun$write$1(CacheStore.scala:73)
[error]         at sbt.util.FileBasedStore.$anonfun$write$1$adapted(CacheStore.scala:72)
[error]         at sbt.io.Using.apply(Using.scala:27)
[error]         at sbt.util.FileBasedStore.write(CacheStore.scala:72)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:70)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:150)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:150)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:131)
[error]         at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:164)
[error]         at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2844)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:270)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:279)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:270)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (update) java.net.URISyntaxException: Illegal character in path at index 101: file:/home/vkorenev/.m2/repository/org/apache/mxnet/libmxnet-scala/INTERNAL/libmxnet-scala-INTERNAL.${libtype}
[error] Total time: 1 s, completed 20-Jul-2019 1:27:32 PM

Minimum reproducible example

build.sbt:

name := "mxnet-scala-test"
version := "0.1"
scalaVersion := "2.11.12"
resolvers += Resolver.mavenLocal
libraryDependencies += "org.apache.mxnet" %% "mxnet-full" % "INTERNAL"

Steps to reproduce

sbt compile

Other info

Contents of ~/.m2/repository/org/apache/mxnet/mxnet-full_2.11/INTERNAL/mxnet-full_2.11-INTERNAL.pom:

<?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>mxnet-full_2.11</artifactId>
  <name>Assembly Scala Package</name>
  <packaging>pom</packaging>

  <properties>
    <MXNET_DIR>${project.parent.basedir}/..</MXNET_DIR>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.mxnet</groupId>
      <artifactId>mxnet-core</artifactId>
      <version>INTERNAL</version>
    </dependency>
    <dependency>
      <groupId>org.apache.mxnet</groupId>
      <artifactId>libmxnet-scala</artifactId>
      <version>INTERNAL</version>
      <type>${libtype}</type>
    </dependency>
    <dependency>
      <groupId>org.apache.mxnet</groupId>
      <artifactId>mxnet-infer</artifactId>
      <version>INTERNAL</version>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>staging</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>deploy</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>binary-jar</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>sources-jar</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/source.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/javadoc.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Contents of ~/.m2/repository/org/apache/mxnet/libmxnet-scala/INTERNAL/libmxnet-scala-INTERNAL.pom:

<?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>

Note that ${libtype} has not been expanded in these files.

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Installation

@vkorenev
Copy link
Author

Probably related to #13626.

@marcoabreu
Copy link
Contributor

@lanking520 @zachgk

@vrakesh
Copy link
Contributor

vrakesh commented Jul 22, 2019

@mxnet-label-bot add [Scala, Build]

@zachgk
Copy link
Contributor

zachgk commented Jul 24, 2019

I looked into this a bit. There are other non-expanded properties such as ${cxx} and ${project.parent.basedir} so I believe SBT should generally handle these. I think ${libtype} is different because it uses an activation https://github.com/apache/incubator-mxnet/blob/master/scala-package/pom.xml#L124. So, it will automatically set the appropriate libtype based on the detected operating system and maybe SBT is not handling this. Do you know if you can manually set either the os profile or the properties associated with that profile when pulling in the dependency?

@vkorenev
Copy link
Author

This relates to "INTERNAL" packages only, which are not supposed to be used in other projects (#15634). The package produced by mvn deploy -Drepo_url=file://$HOME/.m2/repository is good. So the actual problem is that mvn install does not deploy usable packages to the local repo as one might expect, but there is another command which can do this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants