Skip to content
Snippets Groups Projects
Commit bcbd49a6 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Issue #195. Using external project to simplify the maintainence. centos-6 has

cmake 2.8 which is now the minimum version required to build moose.
Revered back Makefile in moose-core.
Update README.md
Fixed indentation.
parent 69456794
No related branches found
No related tags found
No related merge requests found
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(moose-all)
PROJECT(MOOSE)
set(MOOSE_VERSION "3.0.2")
include( ExternalProject )
# Options to pass down to moose-core
option(WITH_DOC "Build documentation" OFF)
option(DEBUG "Build with DEBUG support" OFF)
option(WITH_BOOST "Use Boost libraries instead of GSL" OFF)
option(WITH_CUSA "Use CUDA/GPU" OFF)
option(WITH_MPI "Use MPI" OFF)
## intialize paths
set(MOOSE_CORE_DIR "${CMAKE_SOURCE_DIR}/moose-core")
set(MOOSE_CORE_BUILD_DIR ${CMAKE_BINARY_DIR}/_build_moose_core)
set(MOOSE_CORE_INSTALL_DIR ${CMAKE_BINARY_DIR}/_install_moose_core)
FILE(MAKE_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
set(DATA_DIR ${CMAKE_SOURCE_DIR}/data)
set(OUTPUT_MOOSEBIN ${MOOSE_CORE_BUILD_DIR}/moose.bin)
set(OUTPUT_MOOSESDIST ${MOOSE_CORE_BUILD_DIR}/moose-${MOOSE_VERSION}.tar.gz)
# Options to pass down to moose-core
option(WITH_DOC "Build documentation" OFF)
option(DEBUG "Build with DEBUG support" OFF)
add_custom_command(OUTPUT ${OUTPUT_MOOSEBIN} ${OUTPUT_MOOSESDIST}
COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DDEBUG=${DEBUG}
-DWITH_DOC=${WITH_DOC}
${MOOSE_CORE_DIR}
COMMAND $(MAKE)
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR}
VERBATIM
)
add_custom_target(moose-all ALL
DEPENDS ${OUTPUT_MOOSESDIST} ${OUTPUT_MOOSEBIN}
)
install(CODE
"
execute_process(COMMAND ctest --output-on-failure
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
find_package(PythonInterp REQUIRED)
include(ExternalProject)
ExternalProject_Add(
moose-core
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/moose-core
BINARY_DIR ${MOOSE_CORE_BUILD_DIR}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${MOOSE_CORE_INSTALL_DIR}
-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
-DDEBUG=${DEBUG}
-DWITH_DOC=${WITH_DOC}
-DWITH_BOOST=${WITH_BOOST}
-DWITH_MPI=${WITH_MPI}
-DWITH_CUDA=${WITH_CUDA}
TEST_BEFORE_INSTALL 1
)
execute_process(COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake
WORKING_DIRECTORY ${MOOSE_CORE_BUILD_DIR})
"
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}}/moose-core/include)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}}/moose-core/lib)
## moose-gui
## TODO: moose-gui should be a python module.
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
install(DIRECTORY ${MOOSE_CORE_INSTALL_DIR}/
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
install(DIRECTORY ${MOOSE_GUI_DIR}
DESTINATION lib/moose/gui
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/moose/gui
PATTERN ".git" EXCLUDE
)
......
[![Build Status - master](https://travis-ci.org/BhallaLab/moose.svg?branch=master)](https://travis-ci.org/BhallaLab/moose)
This is the parent repository of [MOOSE simulator](https://moose.ncbs.res.in). It hosts components of MOOSE: core (written in C++) of MOOSE, python scripting interface, and its graphical user interface (GUI), and MOOGLI as [git-submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
This is the parent repository of [MOOSE simulator](https://moose.ncbs.res.in). It keeps the snanshots of components of MOOSE: core (written in C++) of MOOSE, python scripting interface, and its graphical user interface (GUI). This is your source
stable MOOSE code.
# Building
mkdir _build
cd _build
cmake ..
make
sudo make install
# Repositories
You can find detailed description of each MOOSE component in respective `README.md` in their repositories below:
......
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