File tree Expand file tree Collapse file tree 7 files changed +37
-14
lines changed Expand file tree Collapse file tree 7 files changed +37
-14
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,8 @@ DerivedData
62
62
lib *
63
63
build
64
64
config.sh
65
- * exe *
66
65
vgcore *
67
66
68
- test /* .txt
69
-
70
67
doc /* .aux
71
68
doc /* .dvi
72
69
doc /* .idx
Original file line number Diff line number Diff line change @@ -12,12 +12,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${USER_CXX_FLAGS}")
12
12
message (STATUS "Configured CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS} " )
13
13
14
14
find_package (MPI )
15
- message (STATUS "MPI_INCLUDE_PATH: ${MPI_INCLUDE_PATH} " )
16
- message (STATUS "MPI_CXX_LIBRARIES: ${MPI_CXX_LIBRARIES} " )
15
+ if (MPI_FOUND )
16
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_MPI=1" )
17
+ include_directories (SYSTEM ${MPI_INCLUDE_PATH} )
18
+ message (STATUS "MPI_INCLUDE_PATH: ${MPI_INCLUDE_PATH} " )
19
+ message (STATUS "MPI_CXX_LIBRARIES: ${MPI_CXX_LIBRARIES} " )
20
+ endif ()
17
21
18
22
# set header / library paths
19
23
include_directories (include / ) # headers
20
- include_directories (SYSTEM ${MPI_INCLUDE_PATH} )
21
24
22
25
enable_testing ()
23
26
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# C++ flags
4
- CXX_FLAGS=" -O3 -flto -Wall"
4
+ CXX_FLAGS=" -O3 -flto -Wall -Wno-unused-function "
5
5
6
6
# currently unused:
7
7
# C++ compiler
8
- # CC="g++"
9
- # MPI compiler wrapper
10
- # MPICC="mpic++"
11
-
8
+ # CXX="g++"
Original file line number Diff line number Diff line change 1
1
link_libraries (mci )
2
2
add_executable (ex1.exe ex1/main.cpp )
3
- add_executable (ex2.exe ex2/main.cpp )
4
- target_link_libraries (ex2.exe ${MPI_CXX_LIBRARIES} )
3
+ if (MPI_FOUND )
4
+ add_executable (ex2.exe ex2/main.cpp )
5
+ target_link_libraries (ex2.exe ${MPI_CXX_LIBRARIES} )
6
+ endif ()
Original file line number Diff line number Diff line change
1
+ #if USE_MPI==1
2
+
1
3
#ifndef MPIMCI
2
4
#define MPIMCI
3
5
@@ -124,3 +126,5 @@ namespace MPIMCI
124
126
};
125
127
126
128
#endif
129
+
130
+ #endif
Original file line number Diff line number Diff line change 1
1
file (GLOB SOURCES "*.cpp" )
2
- add_library (mci STATIC ${SOURCES} )
2
+ add_library (mci SHARED ${SOURCES} )
3
+ add_library (mci_static STATIC ${SOURCES} )
4
+
5
+ if (MPI_FOUND )
6
+ target_link_libraries (mci ${MPI_CXX_LIBRARIES} )
7
+ target_link_libraries (mci_static ${MPI_CXX_LIBRARIES} )
8
+ endif ()
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ VALGRIND=" valgrind --leak-check=full --track-origins=yes"
4
+
5
+ ORIGDIR=$( pwd)
6
+ cd ../build/test/
7
+ ${VALGRIND} ./check
8
+ for exe in ./ut* .exe; do
9
+ echo
10
+ echo " Running test ${exe} ..."
11
+ ${VALGRIND} ${exe}
12
+ echo
13
+ done
14
+ cd ${ORIGDIR}
You can’t perform that action at this time.
0 commit comments