Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / mpfr / CMakeLists.txt @ b745c1a8

History | View | Annotate | Download (6.77 KB)

1
cmake_minimum_required(VERSION 2.8.4)
2
include(FindUnixCommands)
3

    
4

    
5
#take all lustre files
6
LUSTREFILES(LFILES ${CMAKE_CURRENT_SOURCE_DIR} )
7
set(TESTS_PREFIX "mpfr_tests")
8
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
9
set(MAX_INPUT_VALUE 1)
10

    
11

    
12
FOREACH(lus_file ${LFILES})
13
  get_filename_component(L ${lus_file} NAME_WE)
14
  set(DST_DIR "${CMAKE_CURRENT_BINARY_DIR}/${L}")
15
  set(NODE_NAME  "${L}")
16
  set(LUSTRE_OPTIONS_OPT "" )
17

    
18
  Copy_or_generate_lusi_input_and_output_values_for_reference(
19
    LUS_FILE ${lus_file}
20
    NODE ${NODE_NAME}
21
    OPTS ${LUSTRE_OPTIONS_OPT}
22
    MAX ${MAX_INPUT_VALUE}  	#maximum value for input values.
23
    SRC_DIR ${SRC_DIR}
24
    DST_DIR ${DST_DIR}
25
    )
26
  
27
  Lustre_compile_and_compare_to_reference(
28
    LUS_FILE ${lus_file}
29
    NODE ${NODE_NAME}
30
    TESTS_PREFIX ${TESTS_PREFIX}
31
    OPTS ${LUSTRE_OPTIONS_OPT}
32
    CALL_ID "1"
33
    SRC_DIR ${SRC_DIR}
34
    DST_DIR ${DST_DIR}
35
    )
36
  
37
  set(LUSTRE_OPTIONS_OPT "-mpfr" "100")
38
  set(EPSILON "0.0001")
39
  
40
  Copy_or_generate_lusi_input_and_output_values_for_reference(
41
    LUS_FILE ${lus_file}
42
    NODE ${NODE_NAME}
43
    OPTS ${LUSTRE_OPTIONS_OPT}
44
    MAX ${MAX_INPUT_VALUE}  	#maximum value for input values.
45
    SRC_DIR ${SRC_DIR}
46
    DST_DIR ${DST_DIR}
47
    )
48
  
49
  Lustre_compile_and_compare_to_reference(
50
    LUS_FILE ${lus_file}
51
    NODE ${NODE_NAME}
52
    TESTS_PREFIX ${TESTS_PREFIX}
53
    OPTS ${LUSTRE_OPTIONS_OPT}
54
    CALL_ID "2"
55
    SRC_DIR ${SRC_DIR}
56
    DST_DIR ${DST_DIR}
57
    MYJAVADIFF
58
    DIFF_EPSILON ${EPSILON}
59
    )
60

    
61

    
62
  
63
  # set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${L}")
64
  # file(COPY ${lfile}   DESTINATION  ${LUSTRE_OUTPUT_DIR})
65
  # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.lusi)
66
  #   file(COPY  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
67
  # else()
68
  #   message("generate ${L}.lusi \n")
69
  #   Lustre_Compile(LUS_FILE ${lfile}
70
  #     NODE ""
71
  #     OPTS "-lusi")				
72
  #   set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
73
  #   execute_process(RESULT_VARIABLE res 
74
  #     COMMAND ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}__${LUS_OPTS_CUT}} 
75
  #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
76
  #   if(${res} STREQUAL "0")
77
  #     file(COPY  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
78
  #   else()
79
  #     message("${L}.lusi Error")
80
  #   endif()
81
  # endif()
82
  # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}_input_values)
83
  #   file(COPY  ${L}_input_values DESTINATION  ${LUSTRE_OUTPUT_DIR})
84
  # elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.lusi)
85
  #   message("generate input_values \n")
86
  #   execute_process(RESULT_VARIABLE res 
87
  #     COMMAND ${JAVA_RUNTIME} -cp ${CMAKE_BINARY_DIR}/modules/ Generate_inputs_lusi top ${L}.lusi 1
88
  #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
89
  #   if(${res} STREQUAL "0")
90
  #     file(COPY  ${L}_input_values DESTINATION  ${LUSTRE_OUTPUT_DIR})
91
  #   else()
92
  #     message("${L}_input_values Error")
93
  #   endif()
94
  # endif()
95
  # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}_output_values)
96
  #   file(COPY  ${L}_output_values DESTINATION  ${LUSTRE_OUTPUT_DIR})
97
  # elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}_input_values)
98
  #   message("generate output_values for reference \n")
99
  #   set(LUSTRE_NODE_OPT  "${L}")
100
    
101
  #   Lustre_Compile(LUS_FILE ${lfile}
102
  #     NODE ${LUSTRE_NODE_OPT} 
103
  #     OPTS ""
104
  #     DIR ${CMAKE_CURRENT_SOURCE_DIR})
105
    
106
  #   set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
107
    
108
  #   execute_process(
109
  #     COMMAND ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}} 
110
  #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})			
111
  #   execute_process(
112
  #     COMMAND  make -f ${L}.makefile
113
  #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})	
114
  #   execute_process(RESULT_VARIABLE res 
115
  #     COMMAND ${BASH} -c "./${L}_${LUSTRE_NODE_OPT} < ${L}_input_values > ${L}_output_values"
116
  #     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})	
117
  #   file(REMOVE ${L}_${LUSTRE_NODE_OPT} io_frontend.o ${L}.c ${L}.h ${L}.lusic ${L}.makefile ${L}.o ${L}_alloc.h ${L}_main.c ${L}_main.o )
118
  #   if(${res} STREQUAL "0")
119
  #     file(COPY  ${L}_output_values DESTINATION  ${LUSTRE_OUTPUT_DIR})
120
  #   else()
121
  #     message("${L} output_values Error")
122
  #   endif()
123
#   endif()
124
# ENDFOREACH()
125

    
126

    
127

    
128
# FOREACH(lus_file ${GLOBAL_LUSTRE_FILES})
129
# 	get_filename_component(L ${lus_file} NAME_WE)
130
# 	message ("MPFR test for file ${lus_file} ") 
131
# 	set(LUSTRE_NODE_OPT  "${L}")
132

    
133

    
134
# 	#first combination :mpfr
135
# 	set(LUSTRE_OPTIONS_OPT "-mpfr" "100")
136
# 	set(EPSILON "0.0001")
137
	
138
# 	# First command generate C files from Lustre file
139
# 	Lustre_Compile(LUS_FILE ${lus_file}
140
# 					NODE ${LUSTRE_NODE_OPT}
141
# 					OPTS ${LUSTRE_OPTIONS_OPT}
142
# 					CALL_ID "2")
143
					
144
# 	set(LUS_OPTS_CUT_2 "${LUSTRE_OPTS_POSTFIX_${L}_2}")
145
# 	message ("MPFR command ${LUSTRE_COMPILER} LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT} --- ${LUSTREC_ARGS} -- ${LUSTREC_ARGS_${L}_${LUS_NODE}_${LUS_OPTS_CUT}}") 
146
# 	add_test(NAME mpfr_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
147
# 			COMMAND  ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}} 
148
# 	)
149

    
150
# 	 #********************* make -f ${L}.makefile ***************************
151
# 	 add_test(NAME mpfr_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
152
# 			COMMAND  make -f ${L}.makefile
153
# 			WORKING_DIRECTORY ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}}
154
# 	)
155
# 	SET_TESTS_PROPERTIES ( mpfr_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
156
# 	 PROPERTIES DEPENDS mpfr_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
157
# 				REQUIRED_FILES ${L}.makefile
158
# 				)
159
	 
160
# 	 #************** execute C binary **********************************
161
	
162
# 	if (BASH)
163
# 		add_test(
164
# 			NAME mpfr_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2} 
165
# 			COMMAND ${BASH} -c "./${L}_${LUSTRE_NODE_OPT} < ../${L}_input_values > ${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}_outputs"
166
# 			WORKING_DIRECTORY ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}}
167
# 		)
168
# 		SET_TESTS_PROPERTIES ( mpfr_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
169
# 			PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}
170
# 				DEPENDS mpfr_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2})
171
# 	else()
172
# 		message(FATAL_ERROR "Unknown shell command ${BASH} -c for ${CMAKE_HOST_SYSTEM_NAME}")
173
# 	endif()
174
	
175
# 	 #************** execute C binary **********************************
176
# 	 add_test(NAME mpfr_DIFF_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
177
# COMMAND ${JAVA_RUNTIME} -cp ${CMAKE_BINARY_DIR}/modules/ compare_lustrec_outputs ${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}_outputs ../${L}_output_values ${EPSILON}
178
# 	   WORKING_DIRECTORY ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}}
179
# 	)
180
# 	SET_TESTS_PROPERTIES ( mpfr_DIFF_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}
181
# 	 PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2}_outputs
182
# 				DEPENDS mpfr_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_2} )
183

    
184

    
185

    
186

    
187
ENDFOREACH()
188

    
189
add_custom_target(mpfr COMMAND ${CMAKE_CTEST_COMMAND} -R mpfr)
190