Commit 4c219a1b authored by Malte Heithoff's avatar Malte Heithoff
Browse files

Add cmake dependencies when they are needed

parent 3e611cc4
Pipeline #336063 passed with stage
in 1 minute and 44 seconds
......@@ -15,19 +15,20 @@ import java.util.*;
public class CNNArch2Gluon extends CNNArchGenerator {
private CMakeConfig cMakeConfig = new CMakeConfig("");
public CNNArch2Gluon() {
architectureSupportChecker = new CNNArch2GluonArchitectureSupportChecker();
layerSupportChecker = new CNNArch2GluonLayerSupportChecker();
}
@Override
public CMakeConfig getCmakeConfig() {
return null;
}
//check cocos with CNNArchCocos.checkAll(architecture) before calling this method.
@Override
public List<FileContent> generateStrings(TaggingResolver taggingResolver, ArchitectureSymbol architecture){
if(architecture != null && architecture.getFullName() != null) {
cMakeConfig.getCMakeListsViewModel().setCompName(architecture.getFullName().replace('.', '_').replace('[', '_').replace(']', '_'));
}
List<FileContent> fileContents = compileFileContents(architecture);
return fileContents;
}
......@@ -85,6 +86,10 @@ public class CNNArch2Gluon extends CNNArchGenerator {
private List<FileContent> compileFileContents(ArchitectureSymbol architecture) {
// Add cmake dependencies when they are needed
cMakeConfig.addModuleDependency(new CMakeFindModule("Armadillo", true));
cMakeConfig.addCmakeLibraryLinkage("mxnet");
TemplateConfiguration templateConfiguration = new GluonTemplateConfiguration();
architecture.processForEpisodicReplayMemory();
......@@ -111,7 +116,7 @@ public class CNNArch2Gluon extends CNNArchGenerator {
rootModelName = rootModelName.replace('.', '_').replace('[', '_').replace(']', '_');
rootModelName = rootModelName.substring(0, 1).toLowerCase() + rootModelName.substring(1);
CMakeConfig cMakeConfig = new CMakeConfig(rootModelName);
cMakeConfig.getCMakeListsViewModel().setCompName(rootModelName);
cMakeConfig.addModuleDependency(new CMakeFindModule("Armadillo", true));
cMakeConfig.addCmakeLibraryLinkage("mxnet");
......@@ -121,4 +126,9 @@ public class CNNArch2Gluon extends CNNArchGenerator {
}
return fileContents;
}
@Override
public CMakeConfig getCmakeConfig() {
return cMakeConfig;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment