Commit e59f2163 authored by Christian Godenschwager's avatar Christian Godenschwager
Browse files

Merge branch 'mac-ci' into 'master'

macOS CI build jobs

See merge request walberla/walberla!87
parents 8783776c 6c24f783
###############################################################################
## ##
## Genral settings ##
## General settings ##
## ##
###############################################################################
......@@ -970,6 +970,71 @@ msvc-14.1_MpiOnly:
- triggers
###############################################################################
## ##
## macOS Builds ##
## ##
###############################################################################
.mac_build_template: &mac_build_definition
script:
- export NUM_CORES=$(system_profiler SPHardwareDataType | grep 'Total Number of Cores' | awk '{print $5}')
- export MAX_BUILD_CORES=$(( $(system_profiler SPHardwareDataType | grep 'Memory' | awk '{print $2}') / 4 ))
- "[[ $MAX_BUILD_CORES -lt $NUM_CORES ]] && export NUM_BUILD_CORES=$MAX_BUILD_CORES || export NUM_BUILD_CORES=$NUM_CORES"
- c++ --version
- cmake --version
- mpirun --version
- mkdir build
- cd build
- cmake .. -DWALBERLA_BUILD_TESTS=ON -DWALBERLA_BUILD_BENCHMARKS=ON -DWALBERLA_BUILD_TUTORIALS=ON -DWALBERLA_BUILD_TOOLS=ON -DWALBERLA_BUILD_WITH_MPI=$WALBERLA_BUILD_WITH_MPI -DWALBERLA_BUILD_WITH_PYTHON=$WALBERLA_BUILD_WITH_PYTHON -DWALBERLA_BUILD_WITH_OPENMP=$WALBERLA_BUILD_WITH_OPENMP -DWALBERLA_BUILD_WITH_CUDA=$WALBERLA_BUILD_WITH_CUDA -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DWARNING_ERROR=ON
- cmake . -LAH
- make -j $NUM_BUILD_CORES -l $NUM_CORES
- ctest -LE $CTEST_EXCLUDE_LABELS -C $CMAKE_BUILD_TYPE --output-on-failure -j $NUM_CORES
tags:
- mac
mac_Serial_Dbg:
<<: *mac_build_definition
variables:
CMAKE_BUILD_TYPE: "DebugOptimized"
CTEST_EXCLUDE_LABELS: "longrun|cuda"
WALBERLA_BUILD_WITH_MPI: "OFF"
WALBERLA_BUILD_WITH_OPENMP: "OFF"
WALBERLA_BUILD_WITH_PYTHON: "ON"
WALBERLA_BUILD_WITH_CUDA: "ON"
mac_Serial:
<<: *mac_build_definition
variables:
CMAKE_BUILD_TYPE: "Release"
CTEST_EXCLUDE_LABELS: "longrun|cuda"
WALBERLA_BUILD_WITH_MPI: "OFF"
WALBERLA_BUILD_WITH_OPENMP: "OFF"
WALBERLA_BUILD_WITH_PYTHON: "ON"
WALBERLA_BUILD_WITH_CUDA: "ON"
mac_MpiOnly_Dbg:
<<: *mac_build_definition
variables:
CMAKE_BUILD_TYPE: "DebugOptimized"
CTEST_EXCLUDE_LABELS: "longrun|cuda"
WALBERLA_BUILD_WITH_MPI: "ON"
WALBERLA_BUILD_WITH_OPENMP: "OFF"
WALBERLA_BUILD_WITH_PYTHON: "ON"
WALBERLA_BUILD_WITH_CUDA: "ON"
mac_MpiOnly:
<<: *mac_build_definition
variables:
CMAKE_BUILD_TYPE: "Release"
CTEST_EXCLUDE_LABELS: "longrun|cuda"
WALBERLA_BUILD_WITH_MPI: "ON"
WALBERLA_BUILD_WITH_OPENMP: "OFF"
WALBERLA_BUILD_WITH_PYTHON: "ON"
WALBERLA_BUILD_WITH_CUDA: "ON"
###############################################################################
## ##
## Deploy jobs ##
......
......@@ -360,17 +360,6 @@ if( NOT WARNING_DEPRECATED)
endif()
endif()
# Treat warnings as errors
if ( WARNING_ERROR )
if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG )
add_flag ( CMAKE_CXX_FLAGS "-pedantic-errors -Werror" )
elseif( WALBERLA_CXX_COMPILER_IS_MSVC )
add_flag ( CMAKE_CXX_FLAGS "/WX" )
elseif ( WALBERLA_CXX_COMPILER_IS_CRAY )
add_flag ( CMAKE_CXX_FLAGS "-h error_on_warning" )
endif()
endif ( )
if ( WALBERLA_CXX_COMPILER_IS_CLANG )
add_flag ( CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow -Wno-c++11-extensions -Qunused-arguments" )
......@@ -784,18 +773,16 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER )
if ( WIN32 )
message ( STATUS "Enter Workaround Routine for Windows and OpenMPI: PRESS CONFIGURE ONE MORE TIME!" )
string ( REGEX REPLACE "(.*)/bin/.*" "\\1" MPI_PATH ${MPI_CXX_COMPILER} )
find_path ( MPI_INCLUDE_PATH mpi.h
find_path ( MPI_C_INCLUDE_PATH mpi.h
HINTS ${MPI_PATH}
PATH_SUFFIXES include Inc)
set ( MPI_CXX_INCLUDE_PATH ${MPI_INCLUDE_PATH} CACHE FILEPATH "" FORCE )
set ( MPI_C_INCLUDE_PATH ${MPI_INCLUDE_PATH} CACHE FILEPATH "" FORCE )
set ( MPI_CXX_INCLUDE_PATH ${MPI_C_INCLUDE_PATH} CACHE FILEPATH "" FORCE )
set ( MPI_CXX_LIBRARIES "MPI_CXX_LIBRARIES-NOTFOUND" CACHE FILEPATH "Cleared" FORCE )
find_library ( MPI_CXX_LIBRARIES
NAMES mpi++ mpicxx cxx mpi_cxx libmpi++ libmpicxx libcxx libmpi_cxx
HINTS ${MPI_PATH}
PATH_SUFFIXES lib )
set ( MPI_LIBRARY "MPI_CXX_LIBRARIES" CACHE FILEPATH "" FORCE )
if ( NOT MPI_CXX_LIBRARIES STREQUAL "MPI_CXX_LIBRARIES-NOTFOUND" )
set ( MPI_CXX_FOUND ON FORCE )
......@@ -806,7 +793,6 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER )
NAMES mpi mpich mpich2 msmpi libmpi libmpich libmpich2 libmsmpi
HINTS ${MPI_PATH}
PATH_SUFFIXES lib )
set ( MPI_EXTRA_LIBRARY "MPI_C_LIBRARIES" CACHE FILEPATH "" FORCE )
if ( NOT MPI_C_LIBRARIES STREQUAL "MPI_C_LIBRARIES-NOTFOUND" )
set ( MPI_C_FOUND ON FORCE )
......@@ -823,23 +809,14 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER )
endif ( )
if ( MPI_FOUND )
if ( MPI_CXX_FOUND )
include_directories ( SYSTEM ${MPI_CXX_INCLUDE_PATH} ${MPI_C_INCLUDE_PATH} )
foreach( LIB ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES} )
if ( LIB )
list ( APPEND SERVICE_LIBS ${LIB} )
endif ( )
endforeach ( )
add_flag ( CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}" )
add_flag ( CMAKE_C_FLAGS "${MPI_C_COMPILE_FLAGS}" )
else ( ) # For older CMake versions
include_directories ( SYSTEM ${MPI_INCLUDE_PATH} )
list ( APPEND SERVICE_LIBS ${MPI_LIBRARY} )
if ( MPI_EXTRA_LIBRARY )
list ( APPEND SERVICE_LIBS ${MPI_EXTRA_LIBRARY} )
include_directories ( SYSTEM ${MPI_CXX_INCLUDE_PATH} ${MPI_C_INCLUDE_PATH} )
foreach( LIB ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES} )
if ( LIB )
list ( APPEND SERVICE_LIBS ${LIB} )
endif ( )
add_flag ( CMAKE_C_FLAGS "${MPI_COMPILE_FLAGS}" )
endif ( )
endforeach ( )
add_flag ( CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}" )
add_flag ( CMAKE_C_FLAGS "${MPI_C_COMPILE_FLAGS}" )
add_flag ( CMAKE_MODULE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" )
add_flag ( CMAKE_EXE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" )
......@@ -847,7 +824,7 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER )
# When using Intel MPI, mpi.h has to be included before including the standard library
# therefore we use the -include flag to enforce this.
if ( MPI_INCLUDE_PATH MATCHES "intel" )
if ( MPI_C_INCLUDE_PATH MATCHES "intel" )
message (STATUS "Activating IntelMPI include workaround for mpi.h" )
add_flag ( CMAKE_CXX_FLAGS "-include mpi.h" )
add_flag ( CMAKE_C_FLAGS "-include mpi.h" )
......@@ -1233,7 +1210,23 @@ if ( WALBERLA_BUILD_WITH_LTO )
endif( )
endif ( )
############################################################################################################################
##
## Some more compiler flags that need to happen after any try_compile (e.g. inside FindMPI)
##
############################################################################################################################
# Treat warnings as errors
if ( WARNING_ERROR )
if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG )
add_flag ( CMAKE_CXX_FLAGS "-pedantic-errors -Werror" )
elseif( WALBERLA_CXX_COMPILER_IS_MSVC )
add_flag ( CMAKE_CXX_FLAGS "/WX" )
elseif ( WALBERLA_CXX_COMPILER_IS_CRAY )
add_flag ( CMAKE_CXX_FLAGS "-h error_on_warning" )
endif()
endif ( )
############################################################################################################################
##
......
......@@ -75,11 +75,9 @@ void Manager::addPath( const std::string & path )
{
WALBERLA_ASSERT( initialized_ );
object main_module = import("__main__");
dict globals = extract<dict>( main_module.attr( "__dict__" ) );
exec( "import sys", globals );
std::string pathCommand = std::string ( "sys.path.append( \"") + path + "\" ) ";
exec( str(pathCommand), globals );
object sys = import("sys");
list sys_path = extract<list>( sys.attr("path") );
sys_path.append(path);
}
void Manager::triggerInitialization()
......@@ -116,10 +114,24 @@ void Manager::triggerInitialization()
}
catch ( boost::python::error_already_set & ) {
PyErr_Print();
PyObject *type_ptr = NULL, *value_ptr = NULL, *traceback_ptr = NULL;
PyErr_Fetch(&type_ptr, &value_ptr, &traceback_ptr);
if( type_ptr )
{
extract<std::string> type_str(( str( handle<>( type_ptr ) ) ));
if( type_str.check() )
WALBERLA_LOG_DEVEL( type_str() );
}
if(value_ptr)
{
extract<std::string> value_str(( str( handle<>( value_ptr ) ) ));
if ( value_str.check() )
WALBERLA_LOG_DEVEL( value_str() );
}
WALBERLA_ABORT( "Error while initializing Python" );
}
}
......@@ -159,4 +171,3 @@ int someSymbolSoThatLinkerDoesNotComplain=0;
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