Commit 04d8736d authored by gsell's avatar gsell
Browse files

Merge branch 'master' into '397-cleanup-in-other-cmakelists-txt'

# Conflicts:
#   src/CMakeLists.txt
parents 9cc20eac 1d423599
...@@ -41,14 +41,15 @@ set (CMAKE_CXX_STANDARD 11) ...@@ -41,14 +41,15 @@ set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF) set (CMAKE_CXX_EXTENSIONS OFF)
add_definitions (-DIPPL_LINUX -DIPPL_STRINGSTREAM) add_definitions (-DIPPL_MPI)
add_definitions (-DIPPL_MPI -DMPICH_SKIP_MPICXX -DIPPL_DONT_POOL) add_definitions (-DIPPL_DONT_POOL)
add_definitions (-DIPPL_USE_XDIV_RNG) add_definitions (-DIPPL_USE_XDIV_RNG)
add_definitions (-DIPPL_USE_PARTIAL_SPECIALIZATION) add_definitions (-DIPPL_USE_PARTIAL_SPECIALIZATION)
add_definitions (-Drestrict=__restrict__ -DNOCTAssert) add_definitions (-DNOCTAssert)
add_compile_options (-Wall) add_compile_options (-Wall)
add_compile_options (-funroll-loops -fstrict-aliasing) add_compile_options (-funroll-loops -fstrict-aliasing)
option (USE_STATIC_LIBRARIES "Link with static libraries if available" ON) option (USE_STATIC_LIBRARIES "Link with static libraries if available" ON)
if (NOT ${USE_STATIC_LIBRARIES}) if (NOT ${USE_STATIC_LIBRARIES})
add_compile_options (-fPIE -fPIC) add_compile_options (-fPIE -fPIC)
...@@ -73,7 +74,6 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") ...@@ -73,7 +74,6 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_compile_options (-ftemplate-depth=1024) add_compile_options (-ftemplate-depth=1024)
# Allow overloaded virtual functions (instances to be fixed in OPAL) # Allow overloaded virtual functions (instances to be fixed in OPAL)
#add_compile_options (-Wno-overloaded-virtual) #add_compile_options (-Wno-overloaded-virtual)
add_definitions(-DIPPL_RESTRICT_BUG)
if (ENABLE_OpenMP) if (ENABLE_OpenMP)
add_compile_options (-fopenmp) add_compile_options (-fopenmp)
endif () endif ()
...@@ -280,10 +280,11 @@ install ( ...@@ -280,10 +280,11 @@ install (
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake RENAME ${PROJECT_NAME}Config.cmake
) )
# vi: set et ts=4 sw=4 sts=4: # vi: set et ts=4 sw=4 sts=4:
# Local Variables: # Local Variables:
# mode:cmake # mode: cmake
# cmake-tab-width: 4 # cmake-tab-width: 4
# indent-tabs-mode:nil # indent-tabs-mode: nil
# End: # End:
SET(${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS}") set (${PROJECT_NAME}_CMAKE_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS}")
SET(${PROJECT_NAME}_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include") set (${PROJECT_NAME}_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
SET(${PROJECT_NAME}_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib") set (${PROJECT_NAME}_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
SET(${PROJECT_NAME}_LIBRARY "${CMAKE_INSTALL_PREFIX}/lib/libOPAL.a") set (${PROJECT_NAME}_LIBRARY "${CMAKE_INSTALL_PREFIX}/lib/libOPAL.a")
SET(IPPL_CMAKE_CXX_FLAGS "${IPPL_CMAKE_CXX_FLAGS}") set (${PROJECT_NAME}_LIBRARIES
SET(${PROJECT_NAME}_LIBRARIES
${GSL_LIBRARY} ${GSL_LIBRARY}
${GSL_CBLAS_LIBRARY} ${GSL_CBLAS_LIBRARY}
${H5Hut_LIBRARY} ${H5Hut_LIBRARY}
...@@ -20,7 +18,7 @@ SET(${PROJECT_NAME}_LIBRARIES ...@@ -20,7 +18,7 @@ SET(${PROJECT_NAME}_LIBRARIES
${CMAKE_DL_LIBS} ${CMAKE_DL_LIBS}
) )
SET(${PROJECT_NAME}_INCLUDE_DIRS set (${PROJECT_NAME}_INCLUDE_DIRS
${OPAL_SRC_DIR} ${OPAL_SRC_DIR}
${CLASSIC_SRC_DIR} ${CLASSIC_SRC_DIR}
${IPPL_INCLUDE_DIR} ${IPPL_INCLUDE_DIR}
......
...@@ -7,9 +7,7 @@ set (IPPL_VERSION_NAME "V${IPPL_VERSION_MAJOR}.${IPPL_VERSION_MINOR}") ...@@ -7,9 +7,7 @@ set (IPPL_VERSION_NAME "V${IPPL_VERSION_MAJOR}.${IPPL_VERSION_MINOR}")
set (IPPL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (IPPL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (${CMAKE_BUILD_TYPE} STREQUAL "Release") if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
add_definitions (-DNOPAssert) add_definitions (-DNOPAssert)
else ()
add_definitions (-DIPPL_DEBUG)
endif () endif ()
set (IPPL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE) set (IPPL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
...@@ -20,15 +18,23 @@ add_subdirectory (src) ...@@ -20,15 +18,23 @@ add_subdirectory (src)
option (ENABLE_IPPLTESTS "IPPL Tests" OFF) option (ENABLE_IPPLTESTS "IPPL Tests" OFF)
if (ENABLE_IPPLTESTS) if (ENABLE_IPPLTESTS)
add_subdirectory (test) add_subdirectory (test)
endif () endif ()
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake ) ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake )
install ( install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config_install.cmake
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}"
RENAME ${PROJECT_NAME}Config.cmake RENAME ${PROJECT_NAME}Config.cmake
) )
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
# indent-tabs-mode: nil
# End:
...@@ -35,7 +35,7 @@ class BrickExpLoop ...@@ -35,7 +35,7 @@ class BrickExpLoop
{ {
public: public:
static inline void static inline void
apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op) apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
{ {
int n0 = Lhs.size(0); int n0 = Lhs.size(0);
int n1 = Lhs.size(1); int n1 = Lhs.size(1);
...@@ -74,7 +74,7 @@ template<class LHS, class RHS, class OP> ...@@ -74,7 +74,7 @@ template<class LHS, class RHS, class OP>
class BrickExpLoop<LHS,RHS,OP,1U> class BrickExpLoop<LHS,RHS,OP,1U>
{ {
public: public:
static inline void apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op) static inline void apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
{ {
int n0 = Lhs.size(0); int n0 = Lhs.size(0);
for (int i0=0; i0<n0; ++i0) { for (int i0=0; i0<n0; ++i0) {
...@@ -90,7 +90,7 @@ class BrickExpLoop<LHS,RHS,OP,2U> ...@@ -90,7 +90,7 @@ class BrickExpLoop<LHS,RHS,OP,2U>
{ {
public: public:
static inline void static inline void
apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op) apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
{ {
int n0 = Lhs.size(0); int n0 = Lhs.size(0);
int n1 = Lhs.size(1); int n1 = Lhs.size(1);
...@@ -109,7 +109,7 @@ class BrickExpLoop<LHS,RHS,OP,3U> ...@@ -109,7 +109,7 @@ class BrickExpLoop<LHS,RHS,OP,3U>
{ {
public: public:
static inline void static inline void
apply(LHS& restrict Lhs, RHS& restrict Rhs, OP Op) apply(LHS& __restrict__ Lhs, RHS& __restrict__ Rhs, OP Op)
{ {
int n0 = Lhs.size(0); int n0 = Lhs.size(0);
int n1 = Lhs.size(1); int n1 = Lhs.size(1);
......
...@@ -182,7 +182,7 @@ public: ...@@ -182,7 +182,7 @@ public:
protected: protected:
void op_pp(); void op_pp();
T* restrict Current; // The current datum. T* __restrict__ Current; // The current datum.
vec<int,Dim> Strides; // The strides in the data. vec<int,Dim> Strides; // The strides in the data.
bool Whole; // True if iterating over whole brick bool Whole; // True if iterating over whole brick
}; };
......
...@@ -289,32 +289,6 @@ permute(const CompressedBrickIterator<T,D1>& iter, ...@@ -289,32 +289,6 @@ permute(const CompressedBrickIterator<T,D1>& iter,
unsigned int d1, d2; unsigned int d1, d2;
#ifdef IPPL_DEBUG
// Do a sanity check.
// Make sure that any indexes in current that don't appear
// in perm have length of 1.
// It is ok to have indexes in perm that don't appear in current.
// They just get zero stride.
// Check each Index in current.
for (d1=0; d1<D1; ++d1)
{
// Compare with every Index in perm.
for (d2=0; d2<D2; ++d2)
// If they match, check the next one.
if ( perm[d2].sameBase( current[d1] ) )
{
goto FoundIt;
}
// Didn't find it.
// Make sure the length is 1.
PAssert_EQ( current[d1].length(), 1 );
FoundIt:
;
}
#endif
// This is the iterator we'll be building. // This is the iterator we'll be building.
CompressedBrickIterator<T,D2> permute(iter.GetCompressedData()); CompressedBrickIterator<T,D2> permute(iter.GetCompressedData());
if ( iter.IsCompressed() ) if ( iter.IsCompressed() )
......
...@@ -34,7 +34,6 @@ add_subdirectory (extlib) ...@@ -34,7 +34,6 @@ add_subdirectory (extlib)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Build liboptp for linking to OPAL # Build liboptp for linking to OPAL
# #
add_compile_options (${IPPL_CMAKE_CXX_FLAGS})
include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories (${CMAKE_CURRENT_SOURCE_DIR})
add_library (optp ${OPTP_SRCS} ${PILOT_OPAL_SRCS}) add_library (optp ${OPTP_SRCS} ${PILOT_OPAL_SRCS})
...@@ -72,3 +71,11 @@ if (ENABLE_DOXYDOC) ...@@ -72,3 +71,11 @@ if (ENABLE_DOXYDOC)
) )
endif () endif ()
endif () endif ()
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
# indent-tabs-mode: nil
# End:
set (DKS_VERSION_OPAL \"${DKS_VERSION}\") set (DKS_VERSION_OPAL \"${DKS_VERSION}\")
add_definitions ( add_definitions (-DPARALLEL_IO)
"${IPPL_CMAKE_CXX_FLAGS} -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
if (ENABLE_SAAMG_SOLVER) if (ENABLE_SAAMG_SOLVER)
set (CMAKE_CXX_FLAGS add_definitions (-DHAVE_SAAMG_SOLVER)
"-DHAVE_SAAMG_SOLVER ${CMAKE_CXX_FLAGS}"
)
set (SAAMG_SOLVER_LIBS set (SAAMG_SOLVER_LIBS
${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES}
${Fortran_LIBS} ${Fortran_LIBS}
...@@ -29,14 +25,12 @@ else () ...@@ -29,14 +25,12 @@ else ()
endif () endif ()
if (ENABLE_AMR AND ENABLE_AMR_MG_SOLVER) if (ENABLE_AMR AND ENABLE_AMR_MG_SOLVER)
set (CMAKE_CXX_FLAGS add_definitions (-DHAVE_AMR_MG_SOLVER)
"-DHAVE_AMR_MG_SOLVER ${CMAKE_CXX_FLAGS}"
)
set (AMR_MG_SOLVER_LIBS set (AMR_MG_SOLVER_LIBS
${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES}) ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
else (ENABLE_AMR AND ENABLE_AMR_MG_SOLVER) else ()
set (AMR_MG_SOLVER_LIBS "") set (AMR_MG_SOLVER_LIBS "")
endif(ENABLE_AMR AND ENABLE_AMR_MG_SOLVER) endif ()
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALconfig.h) configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALconfig.h)
configure_file(revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALrevision.h) configure_file(revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALrevision.h)
...@@ -73,8 +67,8 @@ macro (ADD_OPAL_HEADERS ) ...@@ -73,8 +67,8 @@ macro (ADD_OPAL_HEADERS )
endif () endif ()
endmacro () endmacro ()
ADD_OPAL_SOURCES(opal.cpp) add_opal_sources (opal.cpp)
ADD_OPAL_SOURCES(changes.cpp) add_opal_sources (changes.cpp)
add_subdirectory (AbstractObjects) add_subdirectory (AbstractObjects)
add_subdirectory (Algebra) add_subdirectory (Algebra)
...@@ -106,7 +100,7 @@ if (ENABLE_AMR) ...@@ -106,7 +100,7 @@ if (ENABLE_AMR)
add_subdirectory (Amr) add_subdirectory (Amr)
endif () endif ()
include_directories ( BEFORE include_directories (BEFORE
${OPAL_SRC_DIR} ${OPAL_SRC_DIR}
${CLASSIC_SRC_DIR} ${CLASSIC_SRC_DIR}
${IPPL_INCLUDE_DIR} ${IPPL_INCLUDE_DIR}
...@@ -185,12 +179,9 @@ set (HDRS ...@@ -185,12 +179,9 @@ set (HDRS
install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/src") install (FILES ${HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/src")
# vi: set et ts=4 sw=4 sts=4: # vi: set et ts=4 sw=4 sts=4:
# Local Variables: # Local Variables:
# mode:cmake # mode:cmake
# cmake-tab-width: 4 # cmake-tab-width: 4
# indent-tabs-mode:nil # indent-tabs-mode:nil
# End: # End:
#Turn on gcov
#set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
#set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
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