Commit 16e45ca9 authored by Jan Philipp Haller's avatar Jan Philipp Haller
Browse files

IpoptSolverGenerator-CMakeConfig: Linking Ipopt

parent 4ec29521
Pipeline #343720 failed with stage
in 4 minutes and 15 seconds
......@@ -3,6 +3,7 @@ package de.monticore.lang.monticar.generator.cpp.mathopt.optimizationSolver.solv
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.Generator;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
......@@ -125,26 +126,11 @@ public class IpoptSolverGeneratorImplementation implements NLPSolverGeneratorImp
protected void addCMakeDependenciesToGenerator(EMAMBluePrintCPP bluePrint) {
Generator gen = bluePrint.getGenerator();
if (gen instanceof GeneratorCPP) {
List<CMakeFindModule> dependencies = getCMakeDependencies();
for (CMakeFindModule dep : dependencies)
((GeneratorCPP) gen).getCMakeConfig().addModuleDependency(dep);
CMakeConfig cmake = ((GeneratorCPP) gen).getCMakeConfig();
cmake.addCmakeLibraryLinkage("ipopt");
}
// if (gen instanceof GeneratorEMAMOpt2CPP) {
// List<CMakeFindModule> dependencies = getCMakeDependencies();
// for (CMakeFindModule dep : dependencies)
// ((GeneratorEMAMOpt2CPP) gen).getCMakeConfig().addModuleDependency(dep);
// }
}
public List<CMakeFindModule> getCMakeDependencies() {
CMakeFindModule findCPPAD = new CMakeFindModule("CPPAD", "cppad/ipopt/solve.hpp", "", new ArrayList<String>(), new ArrayList<String>(), true, false, true);
CMakeFindModule findIPOpt = new CMakeFindModule("Ipopt", "coin/IpNLP.hpp", "ipopt", new ArrayList<String>(), new ArrayList<String>(), true, true, true);
CMakeFindModule findCoinMumps = new CMakeFindModule("CoinMumps", "", "coinmumps", new ArrayList<String>(), new ArrayList<String>(), false, true, true);
CMakeFindModule findCoinLapack = new CMakeFindModule("CoinLapack", "", "coinlapack", new ArrayList<String>(), new ArrayList<String>(), false, true, true);
CMakeFindModule findCoinBlas = new CMakeFindModule("CoinBlas", "", "coinblas", new ArrayList<String>(), new ArrayList<String>(), false, true, true);
CMakeFindModule findCoinMetis = new CMakeFindModule("CoinMetis", "", "coinmetis", new ArrayList<String>(), new ArrayList<String>(), false, true, true);
CMakeFindModule findGfortran = new CMakeFindModule("GFortran", "", "gfortran", new ArrayList<String>(), new ArrayList<String>(), false, true, true);
return Arrays.asList(findCPPAD, findIPOpt, findCoinMumps, findCoinLapack, findCoinBlas, findCoinMetis, findGfortran);
}
}
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