Skip to content

Commit

Permalink
Add Nox building in makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored and OpenModelica-Hudson committed Mar 16, 2017
1 parent 62fa9b3 commit 1cb1bf8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions Makefile.common
Expand Up @@ -445,6 +445,20 @@ clean-sundials:
rm -rf $(OMBUILDDIR)/include/omc/cpp/sundials
rm -f $(builddir_lib_omc)/libsundials*

# Build Nox
nox: 3rdParty/trilinos-nox/CMakeLists.txt
mkdir -p 3rdParty/trilinos-nox/build
cd 3rdParty/trilinos-nox/build && $(CMAKE) .. -G $(CMAKE_TARGET) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_INSTALL_PREFIX=`pwd` -DKLU_ENABLE:Bool=ON -DKLU_LIBRARY_DIR="$(builddir_lib_omc)" -DKLU_INCLUDE_DIR="$(OMBUILDDIR)/include/omc/c/suitesparse/Include/" -DCMAKE_C_FLAGS="$(CFLAGS) -lm -L $(builddir_lib_omc)" $(SUITESPARSE_LIBS) $(IS_MINGW32) $(IS_MINGW64) -DSUITESPARSECONFIG_LIBRARY="" -DOMDEV_DIR="$(OMDEVMSYS)"
$(MAKE) -C 3rdParty/trilinos-nox/build install
rm -r 3rdParty/trilinos-nox/build/lib/cmake
mkdir -p "$(builddir_lib_omc)/cpp"
cp -pf 3rdParty/trilinos-nox/build/lib/* "$(builddir_lib_omc)/cpp"

clean-nox:
test -d 3rdParty/trilinos-nox/build && cd 3rdParty/trilinos-nox/build && make clean
rm -rf $(OMBUILDDIR)/include/omc/cpp/trilinos-nox
rm -f $(builddir_lib_omc)/cpp/lib{belos,loca,ml,nox,teuchos}*

sanity-check: omc
$(OMBUILDDIR)/bin/omc Examples/SanityCheck.mos

Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -649,9 +649,9 @@ ENDIF(USE_KLU)
# Find Trilinos/Nox solvers
IF(USE_TRILINOS)
IF(MSVC)
SET(Trilinos_Path "")
SET(Trilinos_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/trilinos-nox/build_msvc")
ELSE(MSVC)
SET(Trilinos_Path "C:/Projekte/Trilinostest/Trilinos_install")
SET(Trilinos_Path "${CMAKE_SOURCE_DIR}/../../3rdParty/trilinos-nox/build")
ENDIF(MSVC)
SET(TRILINOS_INLCUDE_HOME ${Trilinos_Path}/include)
SET(TRILINOS_LIBRARY_RELEASE_HOME ${Trilinos_Path}/bin)
Expand All @@ -660,7 +660,7 @@ IF(USE_TRILINOS)
MESSAGE(STATUS "Trilinos library:")
MESSAGE(STATUS "${TRILINOS_LIBRARY_RELEASE_HOME}")

FIND_PATH(TRILINOS_INCLUDE_DIR NOX.h PATHS ${TRILINOS_INLCUDE_HOME} $ENV{TRILINOS_ROOT}/include)
FIND_PATH(TRILINOS_INCLUDE_DIR NOX.H PATHS ${TRILINOS_INLCUDE_HOME} $ENV{TRILINOS_ROOT}/include)
IF (NOT TRILINOS_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "Could not find Trilinos, specify environment variable TRILINOS_ROOT")
ELSE(NOT TRILINOS_INCLUDE_DIR)
Expand Down

0 comments on commit 1cb1bf8

Please sign in to comment.