Skip to content
Snippets Groups Projects
Commit 5e8a578a authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

mac CI build jobs

- fix find_package(MPI) when WARNING_ERROR is defined and recent version of CMake is used
- fix python_coupling Manager::addPath
parent 8783776c
Branches
Tags
No related merge requests found
############################################################################### ###############################################################################
## ## ## ##
## Genral settings ## ## General settings ##
## ## ## ##
############################################################################### ###############################################################################
...@@ -970,6 +970,71 @@ msvc-14.1_MpiOnly: ...@@ -970,6 +970,71 @@ msvc-14.1_MpiOnly:
- triggers - 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 ## ## Deploy jobs ##
......
...@@ -360,17 +360,6 @@ if( NOT WARNING_DEPRECATED) ...@@ -360,17 +360,6 @@ if( NOT WARNING_DEPRECATED)
endif() endif()
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 ) if ( WALBERLA_CXX_COMPILER_IS_CLANG )
add_flag ( CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow -Wno-c++11-extensions -Qunused-arguments" ) add_flag ( CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow -Wno-c++11-extensions -Qunused-arguments" )
...@@ -1233,8 +1222,24 @@ if ( WALBERLA_BUILD_WITH_LTO ) ...@@ -1233,8 +1222,24 @@ if ( WALBERLA_BUILD_WITH_LTO )
endif( ) endif( )
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 ( )
############################################################################################################################ ############################################################################################################################
## ##
## Sanitizer ## Sanitizer
......
...@@ -75,11 +75,9 @@ void Manager::addPath( const std::string & path ) ...@@ -75,11 +75,9 @@ void Manager::addPath( const std::string & path )
{ {
WALBERLA_ASSERT( initialized_ ); WALBERLA_ASSERT( initialized_ );
object main_module = import("__main__"); object sys = import("sys");
dict globals = extract<dict>( main_module.attr( "__dict__" ) ); list sys_path = extract<list>( sys.attr("path") );
exec( "import sys", globals ); sys_path.append(path);
std::string pathCommand = std::string ( "sys.path.append( \"") + path + "\" ) ";
exec( str(pathCommand), globals );
} }
void Manager::triggerInitialization() void Manager::triggerInitialization()
...@@ -116,10 +114,24 @@ void Manager::triggerInitialization() ...@@ -116,10 +114,24 @@ void Manager::triggerInitialization()
} }
catch ( boost::python::error_already_set & ) { 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" ); WALBERLA_ABORT( "Error while initializing Python" );
} }
} }
...@@ -159,4 +171,3 @@ int someSymbolSoThatLinkerDoesNotComplain=0; ...@@ -159,4 +171,3 @@ int someSymbolSoThatLinkerDoesNotComplain=0;
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