1

I want to use the project from nd4j-cuda-10.2. it has jar files for two Operating Systems, Linux and Windows. than How can I exclude the jar from Linux when using a windows system and vice versa?.

[Maven Repository][1] [1]: https://repo1.maven.org/maven2/org/nd4j/nd4j-cuda-10.2/1.0.0-beta7/

due to the weight of the jar files. I want to exclude files that are not useful to each operating system. Is this possible?.

I mean, I would like maven to download the file "nd4j-cuda-10.2-1.0.0-beta7-linux-ppc64le.jar" only when it be on a linux system and the file "nd4j-cuda-10.2-1.0.0-beta7-windows-x86_64.jar" when on a system windows.

Part of pom.xml:

     <profile>
            <id>Windows_Profile</id>
            <activation>
                <os>
                    <name>windows 10</name>
                    <family>Windows</family>
                    <arch>amd64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.nd4j</groupId>
                    <artifactId>nd4j-cuda-10.2-platform</artifactId>
                    <version>${nd4j.version}</version>
                    <classifier></classifier>
                </dependency>
                <dependency>
                    <groupId>org.deeplearning4j</groupId>
                    <artifactId>deeplearning4j-cuda-10.2</artifactId>
                    <version>1.0.0-beta7</version>
                    <exclusions>
                        <exclusion>
                            <groupId></groupId>
                            <artifactId></artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile> 

I have worked a bit on the profiles for each operating system because I have found that it is the correct way to do it but it is not enough, I attach a bit of the code from my file, I appreciate your collaboration, any contribution is highly valued.

  • So, what problem do you have with your profiles? Note that your profiles are tight to the operation system you _build_ your project on. So when you build on Windows but later run on Linux, this does not work. – J Fabian Meier Nov 01 '20 at 14:11
  • First of all thanks for your help. Of course, I have no problem with the profiles, what happens is that the dependency has the JAR files of both operating systems and I would like Maven to only download one, that is, the operating system in which it is working. What it means is that although it is in Windows, maven also downloads the JAR for Linux and that is what I would like to avoid. – Kevin Santiago Rey Nov 01 '20 at 19:30
  • Please try to refer to this page: https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies – Samuel Audet Nov 02 '20 at 00:26

1 Answers1

1

Check if there are separate artifacts/maven dependencies that you could refer to. A quick check revealed there is something like https://mvnrepository.com/artifact/org.nd4j/jcuda-windows64.

Queeg
  • 7,748
  • 1
  • 16
  • 42