Skip to content

Commit

Permalink
Merge pull request #3 from patflick/desa-new
Browse files Browse the repository at this point in the history
Merging DESA code into master.
  • Loading branch information
patflick authored Aug 12, 2019
2 parents 50665cb + 5dfba62 commit 9ae5c7a
Show file tree
Hide file tree
Showing 28 changed files with 3,916 additions and 390 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ script:
- ./bin/test-ansv
- ./bin/test-suffixtree
- ./bin/test-gsa
- ./bin/test-desa
- mpiexec -np 4 ./bin/test-psac
- mpiexec -np 13 ./bin/test-psac
- mpiexec -np 4 ./bin/test-ansv
Expand All @@ -86,6 +87,8 @@ script:
- mpiexec -np 13 ./bin/test-gsa
- mpiexec -np 4 ./bin/test-gsa
- mpiexec -np 4 ./bin/test-ss
- mpiexec -np 4 ./bin/test-desa


after_success:
# only collect coverage if compiled with gcc
Expand Down
4 changes: 4 additions & 0 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
'-I',
'./ext',
'-I',
'./ext/mxx',
'-I',
'../ext/mxx',
'-I',
'./ext/mxx/include',
'-I',
'../ext/mxx/include',
Expand Down
142 changes: 36 additions & 106 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,134 +3,64 @@ cmake_minimum_required(VERSION 2.6)
# project settings
project(psac)

#### Options
OPTION(PSAC_BUILD_EXES "Build all psac executables (command line tools & benchmark scripts)" ON)
OPTION(PSAC_BUILD_TESTS "Build unit tests" ON)
OPTION(PSAC_ENABLE_COVERAGE "Enable code coverage reporting" OFF)

##### General Compilation Settings

# Initialize CXXFLAGS.
#set(CMAKE_CXX_FLAGS "-Wall -O0 -g --std=c++11 -D_GLIBCXX_DEBUG")
#set(CMAKE_CXX_FLAGS "-Wall -Wuninitialized -O0 -g --std=c++11")
#set(CMAKE_CXX_FLAGS "-Wall -O3 -funroll-loops -msse3 --std=c++11 -g -march=native")
#set(CMAKE_CXX_FLAGS "-Wall -O3 -funroll-loops -msse3 -DNDEBUG --std=c++11 -march=native")
#set(CMAKE_CXX_FLAGS "-Wall -O3 -DNDEBUG --std=c++11 -Wuninitialized -g")


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized --std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=native")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g")

# Add these standard paths to the search paths for FIND_LIBRARY
# to find libraries from these locations first
if(UNIX)
set(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH} /lib /usr/lib")
endif()

# --------------------------------------------------------------
# Indicate CMake 2.7 and above that we don't want to mix relative
# and absolute paths in linker lib lists.
# Run "cmake --help-policy CMP0003" for more information.
# --------------------------------------------------------------
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif()


#### MPI
find_package(MPI REQUIRED)
if (MPI_FOUND)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS}")
#set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} ${MPI_LINK_FLAGS}")
set(EXTRA_LIBS ${EXTRA_LIBS} ${MPI_LIBRARIES})
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
else (MPI_FOUND)
message(SEND_ERROR "This application cannot compile without MPI")
endif (MPI_FOUND)




## add ScoreP support


option(ENABLE_PROFILING_SCOREP "Enable ScoreP profiling support." OFF)

#if(ENABLE_PROFILING_SCOREP)
# message(STATUS "Profiling with ScoreP enabled.")
#
# execute_process(COMMAND scorep-config --cxxflags --nocompiler
# OUTPUT_VARIABLE SCOREP_CXX_FLAGS)
# ##RESULT_VARIABLE SCOREP_CONFIG_RETURN)
# #if(NOT SCOREP_CONFIG_RETURN EQUAL 0)
# # message(FATAL_ERROR "Can NOT execute 'scorep-config' at $ENV{SCOREP_ROOT}/bin/scorep-config - check file permissions")
# #endif()
# execute_process(COMMAND scorep-config --mpp=mpi --ldflags
# OUTPUT_VARIABLE SCOREP_LD_FLAGS)
# execute_process(COMMAND scorep-config --mpp=mpi --libs
# OUTPUT_VARIABLE SCOREP_LIBS)
# string(STRIP "${SCOREP_LIBS}" SCOREP_LIBS)
#
# #execute_process(COMMAND scorep-config --mpp=mpi --libs
# # OUTPUT_VARIABLE SCOREP_LIBFLAGS)
# #string(STRIP "${SCOREP_LIBFLAGS}" SCOREP_LIBFLAGS)
#
# # subsystem iniialization file
# execute_process(COMMAND scorep-config --mpp=mpi --nocuda --noopencl --adapter-init
# OUTPUT_VARIABLE SCOREP_INIT_FILE)
# file(WRITE ${CMAKE_BINARY_DIR}/scorep_init.c "${SCOREP_INIT_FILE}")
#
# #if(SCOREP_ENABLE)
# set(SCOREP_SRCFILES "${CMAKE_BINARY_DIR}/scorep_init.c")
# #endif(SCOREP_ENABLE)
#
#
# # TODO: possibly put the LIBS to target_link_libraries
# set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${SCOREP_LD_FLAGS} ${SCOREP_LIBS}")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SCOREP_CXX_FLAGS}")
# #set(EXTRA_LIBS ${EXTRA_LIBS} ${SCOREP_LIBS})
#endif(ENABLE_PROFILING_SCOREP)


if(ENABLE_PROFILING_SCOREP)
message(STATUS "Profiling with ScoreP enabled.")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "scorep")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "scorep")
endif(ENABLE_PROFILING_SCOREP)

### Test Coverage
OPTION(ENABLE_COVERAGE "Enable code coverage reporting" OFF)
if(ENABLE_COVERAGE)
if(PSAC_ENABLE_COVERAGE)
# turn off stack protection for gcov coverage, because the stack protector shows
# up as a never taken branch, and thus turns any last statement in a function
# with a stack procetor into a partially covered statement.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fno-stack-protector")
endif(ENABLE_COVERAGE)
endif(PSAC_ENABLE_COVERAGE)

###### Executable and Libraries
# Save libs and executables in the same place
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib CACHE PATH "Output directory for libraries" )
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "Output directory for applications" )
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories("${PROJECT_SOURCE_DIR}/ext/mxx")
include_directories("${PROJECT_SOURCE_DIR}/ext/mxx/include")
include_directories("${PROJECT_SOURCE_DIR}/ext")
include_directories("${PROJECT_SOURCE_DIR}/ext/cxx-prettyprint")
## psac header library
add_library(psaclib INTERFACE)
target_include_directories(psaclib INTERFACE include)

## psac dependencies

# load mxx and its gtest wrapper
add_subdirectory("${PROJECT_SOURCE_DIR}/ext/mxx")
set(MXX_BUILD_TESTS OFF CACHE BOOL "disable building mxx tests" FORCE)
add_subdirectory(ext/mxx)
target_link_libraries(psaclib INTERFACE mxx)

# include libdivsufsort (with 64bit support but without examples)
set(BUILD_DIVSUFSORT64 ON CACHE BOOL "enables divsufsort 64bit functions" FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "enables divsufsort 64bit functions" FORCE)
add_subdirectory("${PROJECT_SOURCE_DIR}/ext/libdivsufsort")
include_directories(${libdivsufsort_BINARY_DIR}/include)
include_directories(${libdivsufsort_SOURCE_DIR}/include)
set(BUILD_EXAMPLES OFF CACHE BOOL "enables divsufsort examples" FORCE)
add_subdirectory(ext/libdivsufsort)

# prettyprint
target_include_directories(psaclib INTERFACE ext/cxx-prettyprint)

# divsufsort (integrate into psac as `psac-dss-lib`)
add_library(psac-dss-lib INTERFACE)
target_link_libraries(psac-dss-lib INTERFACE psaclib)
target_include_directories(psac-dss-lib INTERFACE ${libdivsufsort_BINARY_DIR}/include)
target_link_libraries(psac-dss-lib INTERFACE divsufsort divsufsort64)

# add own subdirectories
add_subdirectory(src)
add_subdirectory(src/tests)

## build executables
if(PSAC_BUILD_EXES)
add_subdirectory(src)
endif()

# build tests
add_subdirectory(test)
if (PSAC_BUILD_TESTS)
add_subdirectory(test)
endif()

2 changes: 1 addition & 1 deletion ext/mxx
Submodule mxx updated 1 files
+37 −40 CMakeLists.txt
Loading

0 comments on commit 9ae5c7a

Please sign in to comment.