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

Merge branch 'chennapoda'

parents 2ad8f754 8c1ca970
No related branches found
No related tags found
No related merge requests found
sudo : required sudo : required
dist : trusty
group : edge
compiler: compiler:
- gcc - gcc
......
...@@ -28,15 +28,6 @@ option(WITH_CUDA "Use CUDA/GPU" OFF) ...@@ -28,15 +28,6 @@ option(WITH_CUDA "Use CUDA/GPU" OFF)
option(WITH_MPI "Use MPI (experimental)" OFF) option(WITH_MPI "Use MPI (experimental)" OFF)
option(WITH_GUI "Install moose-gui. Works only with python2." ON ) option(WITH_GUI "Install moose-gui. Works only with python2." ON )
# get platform and arch using python.
find_package( PythonInterp REQUIRED)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import sys;print('%s-%s'%(sys.platform,sys.arch))"
OUTPUT_VARIABLE PY_PLATFORM_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Building bdist for arch - ${PY_PLATFORM_ARCH}")
# On python3. Do not install GUI. # On python3. Do not install GUI.
find_package(PythonInterp REQUIRED) find_package(PythonInterp REQUIRED)
...@@ -62,7 +53,6 @@ if(UNIX AND NOT APPLE) ...@@ -62,7 +53,6 @@ if(UNIX AND NOT APPLE)
endif( ) endif( )
add_custom_target(moose ALL) add_custom_target(moose ALL)
...@@ -73,7 +63,10 @@ set(PYMOOSE_BUILD_DIR ${CMAKE_BINARY_DIR}/__moose-core_build) ...@@ -73,7 +63,10 @@ set(PYMOOSE_BUILD_DIR ${CMAKE_BINARY_DIR}/__moose-core_build)
# installing into user_specified path, set PYTHONPATH to this directory. We now # installing into user_specified path, set PYTHONPATH to this directory. We now
# create a bdist to this directory. # create a bdist to this directory.
set(PYMOOSE_INSTALL_DIR ${CMAKE_BINARY_DIR}/__moose-core_install) set(PYMOOSE_INSTALL_DIR ${CMAKE_BINARY_DIR}/__moose-core_install)
set(PYMOOSE_BDIST_DIR ${PYMOOSE_BUILD_DIR}/) file(MAKE_DIRECTORY ${PYMOOSE_INSTALL_DIR})
set(PYMOOSE_BDIST_DIR ${PYMOOSE_BUILD_DIR})
message( STATUS "bdist directory PYMOOSE_BDIST_DIR ${PYMOOSE_BDIST_DIR}" )
if(WITH_GUI) if(WITH_GUI)
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui) set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
...@@ -94,14 +87,16 @@ configure_file( ${CMAKE_SOURCE_DIR}/cmake/build_moose-core.sh.in ...@@ -94,14 +87,16 @@ configure_file( ${CMAKE_SOURCE_DIR}/cmake/build_moose-core.sh.in
# Build pymoose module. # Build pymoose module.
add_custom_target( moose-core ALL DEPENDS ${OUTPUT_MOOSEBIN} ) add_custom_target( moose-core ALL DEPENDS ${OUTPUT_MOOSEBIN} )
add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN} add_custom_command( OUTPUT ${OUTPUT_MOOSEBIN}
COMMAND MAKE=$(MAKE) bash -c ${CMAKE_BINARY_DIR}/build_moose-core.sh COMMAND MAKE=$(MAKE) bash -c ${CMAKE_BINARY_DIR}/build_moose-core.sh
# Note that this command requires us to be in the same directory where we # Note that this command requires us to be in the same directory where we
# want to extract the tar file. # want to extract the tar file.
COMMAND ${CMAKE_COMMAND} -E chdir ${PYMOOSE_INSTALL_DIR} COMMAND ${CMAKE_COMMAND} -E chdir ${PYMOOSE_INSTALL_DIR}
tar xvf ${PYMOOSE_BUILD_DIR}/pymoose-${MOOSE_VERSION}.${PY_PLATFORM_ARCH}.tar.gz tar xvf ${PYMOOSE_BUILD_DIR}/pymoose-${MOOSE_VERSION}.*.tar.gz
COMMENT "Building bdist and unarchiving it" COMMENT "Building bdist and unarchiving it"
VERBATIM # VERBATIM ## WARN: Don't use VERBATIM here. The glob * in tar xvf will not
# work
) )
add_dependencies(moose moose-core) add_dependencies(moose moose-core)
...@@ -130,7 +125,8 @@ endif() ...@@ -130,7 +125,8 @@ endif()
set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui) set(MOOSE_GUI_DIR ${CMAKE_SOURCE_DIR}/moose-gui)
# Install pymoose. Use tar.gz in PYMOOSE_BUILD_DIR and unarchive it. # Install pymoose. Use tar.gz in PYMOOSE_BUILD_DIR and unarchive it.
install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/ # /usr is prefixed by bdist so we need to replace it.
install(DIRECTORY ${PYMOOSE_INSTALL_DIR}/usr/
DESTINATION ${CMAKE_INSTALL_PREFIX} DESTINATION ${CMAKE_INSTALL_PREFIX}
PATTERN ".git" EXCLUDE PATTERN ".git" EXCLUDE
PATTERN "*.pyc" EXCLUDE PATTERN "*.pyc" EXCLUDE
......
...@@ -25,4 +25,4 @@ cmake -DCMAKE_INSTALL_PREFIX=@PYMOOSE_INSTALL_DIR@ \ ...@@ -25,4 +25,4 @@ cmake -DCMAKE_INSTALL_PREFIX=@PYMOOSE_INSTALL_DIR@ \
@PYMOOSE_SOURCE_DIR@ @PYMOOSE_SOURCE_DIR@
$MAKE $MAKE
ctest --output-on-failure || echo "Some tests failed" ctest --output-on-failure || echo "Some tests failed"
$MAKE bdist $MAKE bdist VERBOSE=1
...@@ -13,7 +13,7 @@ override_dh_auto_clean: ...@@ -13,7 +13,7 @@ override_dh_auto_clean:
# consider using -DUSE_VERSIONED_DIR=ON if backporting # consider using -DUSE_VERSIONED_DIR=ON if backporting
override_dh_auto_configure: override_dh_auto_configure:
cmake -DCMAKE_INSTALL_PREFIX=debian/tmp/usr cmake -DCMAKE_INSTALL_PREFIX=debian/tmp/usr -DCMAKE_VERSION=3.2.git
override_dh_auto_build: override_dh_auto_build:
make VERBOSE=0 -j`nproc` make VERBOSE=0 -j`nproc`
......
...@@ -439,6 +439,28 @@ if(${CMAKE_BUILD_TOOL} MATCHES "make") ...@@ -439,6 +439,28 @@ if(${CMAKE_BUILD_TOOL} MATCHES "make")
) )
endif() endif()
# Target for creating bdist. This is handy for creating bdist for packaging.
# Save the binary distribution (tar.gz) to PYMOOSE_BDIST_DIR. Note that this
# target is only useful when creating packages on Open Build Service i.e. if you
# use this target on distribution X, it may not work on distrbutions other than
# X. See python-wheels for making portable distributions.
if(NOT PYMOOSE_BDIST_DIR)
set(PYMOOSE_BDIST_DIR ${CMAKE_BINARY_DIR}/pymoose_bdist)
endif( )
# get platform and arch using python.
# NOTE: creating bdist or bdist_dump uses /usr and /usr/local on rpm and deb
# based unix respectively. Not a great situation to be in. Need to write a
# setup.cfg file to fix the prefix in all cases.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/python/setup.cfg "[install]\nprefix=/usr" )
find_package( PythonInterp REQUIRED)
add_custom_target( bdist
COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py bdist_dumb -d ${PYMOOSE_BDIST_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
COMMENT "Genearating bdist using setup.cmake.py."
VERBATIM
)
############################ CTEST ###################################### ############################ CTEST ######################################
include( CTest ) include( CTest )
......
...@@ -24,6 +24,9 @@ try: ...@@ -24,6 +24,9 @@ try:
except Exception as e: except Exception as e:
from distutils.core import setup from distutils.core import setup
# Read version from VERSION created by cmake file. This file must be present for
# setup.cmake.py to work perfectly.
script_dir = os.path.dirname( os.path.abspath( __file__ ) ) script_dir = os.path.dirname( os.path.abspath( __file__ ) )
version = '3.2pre1' version = '3.2pre1'
......
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