ADD_SUBDIRECTORY(contrib) # has to be included after source
ADD_SUBDIRECTORY(examples)
-#
-# Define some custom targets for convenience
-#
-INCLUDE(setup_custom_targets)
-
#
# And finally, print the configuration:
#
)
ENDIF()
+ #
+ # A custom target with the same name as the component:
+ #
+ ADD_CUSTOM_TARGET(compat_files
+ DEPENDS
+ expand_instantiations
+ make_dependencies
+ report_features
+ )
+
IF(NOT CMAKE_CROSSCOMPILING)
ADD_CUSTOM_TARGET(run_report_features COMMAND report_features)
ENDIF()
+++ /dev/null
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 2013 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-#
-# Setup some convenience custom targets for the build system:
-#
-
-
-########################################################################
-# #
-# Custom targets for library, documentation and compat_files comp.: #
-# #
-########################################################################
-
-ADD_CUSTOM_TARGET(library)
-FOREACH(_build ${DEAL_II_BUILD_TYPES})
- ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
-ENDFOREACH()
-
-IF(DEAL_II_COMPONENT_DOCUMENTATION)
- ADD_CUSTOM_TARGET(documentation
- DEPENDS doxygen
- )
-ENDIF()
-
-IF(DEAL_II_COMPONENT_COMPAT_FILES)
- ADD_CUSTOM_TARGET(compat_files
- DEPENDS
- expand_instantiations
- make_dependencies
- report_features
- )
-ENDIF()
ENDIF()
IF(DEAL_II_COMPONENT_PARAMETER_GUI)
- ADD_SUBDIRECTorY(parameter_gui)
+ ADD_SUBDIRECTORY(parameter_gui)
ENDIF()
+ADD_SUBDIRECTORY(test_affinity)
+
--- /dev/null
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# FIND_PACKAGE(deal.II 8.0 REQUIRED)
+# DEAL_II_SETUP_CACHED_VARIABLES()
+# PROJECT(test_affinity)
+ADD_EXECUTABLE(test_affinity
+ test_affinity.cc
+ )
+#DEAL_II_SETUP_TARGET()
+
+IF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ SET(_build "DEBUG")
+ELSE()
+ SET(_build "RELEASE")
+ENDIF()
+
+SET_TARGET_PROPERTIES(test_affinity PROPERTIES
+ LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}"
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
+ LINKER_LANGUAGE "CXX"
+ )
+
+TARGET_LINK_LIBRARIES(test_affinity ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+
+IF(NOT CMAKE_CROSSCOMPILING)
+ ADD_CUSTOM_TARGET(run_test_affinity COMMAND test_affinity)
+ENDIF()
+
+# IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "")
+# SET(DEAL_II_EXECUTABLE_RELDIR "bin")
+# ENDIF()
+
+# INSTALL(TARGETS test_affinity
+# RUNTIME
+# DESTINATION ${DEAL_II_EXECUTABLE_RELDIR}
+# COMPONENT mesh_converter
+# )
+
--- /dev/null
+#include <deal.II/grid/tria.h>
+
+int main ()
+{
+ // we need this, otherwise gcc will not link against deal.II
+ dealii::Triangulation<2> test;
+
+ cpu_set_t my_set;
+ CPU_ZERO(&my_set);
+
+ unsigned int len = sizeof(my_set);
+ int ret = sched_getaffinity(0, len, &my_set);
+
+ if (ret!=0)
+ {
+ printf("sched_getaffinity() failed, return value: %d\n", ret);
+ return -1;
+ }
+
+ unsigned int bits_set = CPU_COUNT(&my_set);
+
+ if (bits_set==1)
+ {
+ printf("Warning: sched_getaffinity() returns that we can only use one CPU.\n");
+ return 1;
+ }
+ printf("ncpus=%d, mask=%08X\n", bits_set, *(unsigned int*)(&my_set));
+}
#
ADD_SUBDIRECTORY(doxygen)
+ #
+ # A custom target with the same name as the component:
+ #
+ ADD_CUSTOM_TARGET(documentation DEPENDS doxygen)
+
#
# Install the static elements of the html documentation:
#
ADD_SUBDIRECTORY(meshworker)
+ADD_CUSTOM_TARGET(library)
+
FOREACH(build ${DEAL_II_BUILD_TYPES})
STRING(TOLOWER ${build} build_lowercase)
${deal_ii_objects_${build_lowercase}}
)
+ ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX})
+
SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
PROPERTIES
VERSION "${DEAL_II_PACKAGE_VERSION}"
# a C++ library is still ABI backwards compatible :-]
#
SOVERSION "${DEAL_II_PACKAGE_VERSION}"
- LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
+ LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}"
COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}"