Commit 162e0367 authored by Praetorius, Simon's avatar Praetorius, Simon

Added some changes to compiler AMDiS on APPLE systems

parent beb965bd
......@@ -19,7 +19,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_)
message(FATAL_ERROR "Could not find BDDCML headers.")
endif()
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(BDDCML_LIB bddcml
HINTS ENV LIBRARY_PATH
DOC "BDDCML library")
......@@ -29,7 +29,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_)
else()
message(FATAL_ERROR "Could not find the BDDCML library")
endif()
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDCML=1)
endmacro(target_enable_bddcml)
......@@ -28,9 +28,9 @@ macro(target_enable_boost _TARGET_ _SCOPE_)
find_package(Boost ${BOOST_VERSION} REQUIRED ${BOOST_LIBS_REQUIRED})
target_include_directories(${_TARGET_} ${_SCOPE_} ${Boost_INCLUDE_DIR})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${Boost_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
if (MSVC_SHARED_LIBS AND LINK_EXECUTABLE)
link_directories(${Boost_LIBRARY_DIRS})
......
......@@ -21,7 +21,7 @@ macro(target_enable_hypre _TARGET_ _SCOPE_)
target_include_directories(${_TARGET_} ${_SCOPE_} ${HYPRE_INCLUDE_DIRECTORIES})
endif (_HYPRE_H)
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(_HYPRE_LIB HYPRE
HINTS ${PETSC_LIBRARY_DIRS})
......@@ -41,10 +41,10 @@ macro(target_enable_hypre _TARGET_ _SCOPE_)
find_package(LAPACK REQUIRED)
endif (LAPACK_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${LAPACK_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
if (_HYPRE_H AND (NOT LINK_EXECUTABLE OR _HYPRE_LIB))
if (_HYPRE_H AND (NOT LINK_EXECUTABLE OR _HYPRE_LIB OR APPLE))
set(HAVE_HYPRE ON)
target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_HAS_HYPRE)
else ()
......
......@@ -13,7 +13,7 @@ macro(target_enable_mpi _TARGET_ _SCOPE_)
target_compile_options(${_TARGET_} ${_SCOPE_}
${MPI_CXX_COMPILE_FLAGS})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
# the parameter --enable-new-dtags causes a linker problem, i.e. some libraries are
# linked without an rpath (or any other path information) and can not be found while
# running the executable. The hack below removes this flag manually from the linker flags.
......@@ -21,7 +21,7 @@ macro(target_enable_mpi _TARGET_ _SCOPE_)
string(STRIP "${MY_MPI_CXX_LINK_FLAGS}" MY_MPI_CXX_LINK_FLAGS)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${MPI_CXX_LIBRARIES} ${MY_MPI_CXX_LINK_FLAGS})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
endmacro(target_enable_mpi)
macro(target_enable_petsc _TARGET_ _SCOPE_)
......@@ -74,7 +74,7 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
PETSC_VERSION=${PETSC_VERSION})
target_compile_options(${_TARGET_} ${_SCOPE_} ${PETSC_DEFINITIONS})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
set(PETSC_LINK_LIBRARIES "")
foreach (_PETSC_LIB ${PETSC_LIBRARIES})
find_library(_PETSC_LINK_LIB ${_PETSC_LIB} PATHS ${PETSC_LIBRARY_DIRS} NO_DEFAULT_PATH)
......@@ -82,7 +82,7 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
endforeach()
message(STATUS " Found PETSc library ${PETSC_LINK_LIBRARIES}")
target_link_libraries(${_TARGET_} ${_SCOPE_} ${PETSC_LINK_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
# parmetis is required
......@@ -104,7 +104,7 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
message(FATAL_ERROR "Could not find ParMetis header file 'parmetis.h'!")
endif (PARMETIS_HEADER_FILE)
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(PARMETIS_LIB parmetis
HINTS ${PARMETIS_DIR}/lib ${PETSC_LIBRARY_DIRS})
if (NOT PARMETIS_LIB)
......@@ -112,7 +112,7 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
endif (NOT PARMETIS_LIB)
message(STATUS " Found ParMetis library ${PARMETIS_LIB}")
target_link_libraries(${_TARGET_} ${_SCOPE_} ${PARMETIS_LIB})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
# metis is required
......@@ -125,7 +125,7 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
message(FATAL_ERROR "Could not find Metis header file 'metis.h'!")
endif (METIS_HEADER_FILE)
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(METIS_LIB metis
HINTS ${METIS_DIR}/lib ${PETSC_LIBRARY_DIRS})
if (NOT METIS_LIB)
......@@ -133,11 +133,11 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
endif (NOT METIS_LIB)
message(STATUS " Found Metis library ${METIS_LIB}")
target_link_libraries(${_TARGET_} ${_SCOPE_} ${METIS_LIB})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
# blas library is required
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(BLAS_LIB
NAMES blas fblas openblas
HINTS ${BLAS_DIR}/lib ${PETSC_LIBRARY_DIRS} /usr/lib/openblas-base /usr/lib/atlas-base)
......@@ -147,11 +147,11 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
find_package(BLAS REQUIRED)
endif (BLAS_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${BLAS_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
# lapack library is required
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(LAPACK_LIB
NAMES lapack flapack
HINTS ${LAPACK_DIR}/lib ${PETSC_LIBRARY_DIRS} ${PETSC_DIR}/lib)
......@@ -161,5 +161,5 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
find_package(LAPACK REQUIRED)
endif (LAPACK_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${LAPACK_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
endmacro(target_enable_petsc)
......@@ -25,7 +25,7 @@ macro(target_enable_png _TARGET_ _SCOPE_)
get_filename_component(PNG_PATH ${_PNG_H} PATH)
target_include_directories(${_TARGET_} ${_SCOPE_} ${PNG_PATH})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(_PNG_LIB png
HINTS ENV LIBRARY_PATH
DOC "The PNG library")
......@@ -34,7 +34,7 @@ macro(target_enable_png _TARGET_ _SCOPE_)
else()
message(FATAL_ERROR "Could not find the PNG library")
endif()
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_PNG=1)
endmacro(target_enable_png)
......@@ -18,9 +18,9 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
if (SuiteSparse_FOUND)
message(STATUS "Found SuiteSparse CMake-library")
include(${USE_SuiteSparse})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${SuiteSparse_LIBRARIES})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
target_include_directories(${_TARGET_} ${_SCOPE_} ${SuiteSparse_INCLUDE_DIR} ${SuiteSparse_METIS_INCLUDE_DIR})
set(FOUND_SUITESPARSE_LIBS ${SuiteSparse_LIBRARIES})
else (SuiteSparse_FOUND)
......@@ -39,7 +39,7 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
get_filename_component(UMFPACK_LIB_PATH ${UMFPACK_LIBRARY} PATH)
set(FOUND_SUITESPARSE_LIBS ${UMFPACK_LIBRARY})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
# find all connected libraries
find_library(AMD_LIBRARY amd HINTS ${UMFPACK_LIB_PATH})
......@@ -70,7 +70,7 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
endif (SUITESPARSECONFIG_LIBRARY)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${FOUND_SUITESPARSE_LIBS})
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
else()
message(FATAL_ERROR "Could not find the UMFPACK header umfpack.h.")
endif (UMFPACK_H AND UMFPACK_LIBRARY)
......@@ -78,7 +78,7 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
# Check for clock_gettime in librt
if (NOT WIN32 AND LINK_EXECUTABLE)
if (NOT WIN32 AND (LINK_EXECUTABLE OR APPLE))
include(CheckLibraryExists)
check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
if (HAVE_CLOCK_GETTIME)
......@@ -86,7 +86,7 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
else ()
check_library_exists(c clock_gettime "" HAVE_CLOCK_GETTIME)
endif (HAVE_CLOCK_GETTIME)
endif (NOT WIN32 AND LINK_EXECUTABLE)
endif (NOT WIN32 AND (LINK_EXECUTABLE OR APPLE))
# collect informations about umfpack version and found libraries
......@@ -98,12 +98,12 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
unset(_UMFPACK_H CACHE)
message(STATUS "UMFPACK version: ${UMFPACK_VERSION}")
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
message(STATUS "Found the following SuiteSparse libraries:")
foreach (lib ${FOUND_SUITESPARSE_LIBS})
message(STATUS " ${lib}")
endforeach ()
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
endif (FOUND_SUITESPARSE_LIBS)
target_compile_definitions(${_TARGET_} ${_SCOPE_}
......
......@@ -11,7 +11,7 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_)
find_file(ZOLTAN_HEADER_FILE "zoltan.h" PATHS ${Zoltan_INCLUDE_DIRS})
target_include_directories(${_TARGET_} ${_SCOPE_} ${Zoltan_INCLUDE_DIRS})
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
foreach (LIB_NAME ${Zoltan_LIBRARIES})
find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${Zoltan_LIBRARY_DIRS})
if (NOT _ZOLTAN_LIB)
......@@ -21,7 +21,7 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_)
endif ()
unset(_ZOLTAN_LIB CACHE)
endforeach(LIB_NAME)
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
else (Zoltan_FOUND)
find_file(ZOLTAN_HEADER_FILE "zoltan.h" HINTS ${ZOLTAN_DIR}/include ${PETSC_INCLUDE_DIRS})
if (ZOLTAN_HEADER_FILE)
......@@ -31,7 +31,7 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_)
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan.h'!")
endif(ZOLTAN_HEADER_FILE)
if (LINK_EXECUTABLE)
if (LINK_EXECUTABLE OR APPLE)
find_library(ZOLTAN_LIB zoltan
HINTS ${Zoltan_INCLUDE_DIR}/../lib DOC "Full path to the zoltan library")
if (NOT ZOLTAN_LIB)
......@@ -45,7 +45,7 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_)
else ()
message(WARNING "Zoltan configuration file Makefile.export.zoltan not found!")
endif ()
endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE OR APPLE)
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_ZOLTAN=1)
endif (Zoltan_FOUND)
......
......@@ -76,13 +76,11 @@ namespace AMDiS {
class NullCreator : public CreatorInterface<BaseClass>
{
/// Creates no object.
BaseClass* create()
virtual BaseClass* create() override
{
return NULL;
}
virtual ~NullCreator() {}
/// Implementation of \ref CreatorInterface::isNullCreator()
virtual bool isNullCreator() override
{
......@@ -101,8 +99,6 @@ namespace AMDiS {
class CreatorInterfaceName : public CreatorInterface<BaseClass>
{
public:
virtual ~CreatorInterfaceName() {}
/// Sets \ref name
void setName(std::string str)
{
......
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