From dd23a7927c7808ec90f47c93d7dbb95c617be894 Mon Sep 17 00:00:00 2001 From: Lnc Date: Wed, 25 Feb 2015 15:06:27 +0100 Subject: [PATCH 1/5] Add clan1_scop_extract function and clan1 executable --- CMakeLists.txt | 271 +++++++++++++++++++++++++--------------- cmake/clan-config.cmake | 47 +++++++ exe/clan1.c | 44 +++++++ include/clan/clan1.h | 43 +++++++ source/clan1.c | 48 +++++++ 5 files changed, 354 insertions(+), 99 deletions(-) create mode 100644 cmake/clan-config.cmake create mode 100644 exe/clan1.c create mode 100644 include/clan/clan1.h create mode 100644 source/clan1.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c0fb17..6592db9 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,32 +1,96 @@ -cmake_minimum_required(VERSION 2.8) +# Copyright © 2015 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -set(PACKAGE_VERSION "0.7.1") -set(top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}") -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +cmake_minimum_required(VERSION 2.6) -# User's settings - C Flags +# Release / Debug flags -# set(release "TRUE") - set(release "FALSE") + if (RELEASE STREQUAL "FALSE" OR RELEASE STREQUAL "DEBUG") + set(RELEASE "FALSE") + else() + set(RELEASE "TRUE") + endif() + + if (RELEASE) + set(CMAKE_C_FLAGS "-O3 -DNDEBUG -march=native -ffast-math") + else() + set(CMAKE_C_FLAGS "-Og -g3") + endif() - # Release - if (release) - set(CMAKE_C_FLAGS "-O3") - # Debug # valgrind --show-reachable=yes --leak-check=full -v exe +# General C flags + # General + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion -Wsign-conversion -std=c11 -pedantic") + # Thread support + if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") else() - set(CMAKE_C_FLAGS "-O0 -g3") + link_libraries(pthread) + message(STATUS "Your compiler id \"${CMAKE_C_COMPILER_ID}\" is not GNU, OpenMP is disabled") endif() -# User's settings - General C Flags - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic") + +# OpenScop + message(STATUS "---") + find_package(osl REQUIRED) + +# OpenScop 1 + message(STATUS "---") + find_package(osl1) + if (OSL1_FOUND) + add_definitions("-Dclan_with_osl1") + endif() + +# Flex + find_package(BISON REQUIRED) + find_package(FLEX REQUIRED) + file(COPY "source/parser.y" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/source") + file(COPY "source/scanner.l" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/source") + BISON_TARGET(clan_parser "${CMAKE_CURRENT_BINARY_DIR}/source/parser.y" "${CMAKE_CURRENT_BINARY_DIR}/source/parser.c") + FLEX_TARGET(clan_scanner "${CMAKE_CURRENT_BINARY_DIR}/source/scanner.l" "${CMAKE_CURRENT_BINARY_DIR}/source/scanner.c") + ADD_FLEX_BISON_DEPENDENCY(clan_scanner clan_parser) + include_directories("${CMAKE_CURRENT_BINARY_DIR}/source") + +# Clan + message(STATUS "---") + set(PACKAGE_VERSION "0.7.1") + set(top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}") + # ./include/clan/macros.h + configure_file("./include/clan/macros.h.in" "include/clan/macros.h") + include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") + # ./include/*.h + set(clan_INCLUDE "./include") + message(STATUS "Include Clan = ${clan_INCLUDE}") + include_directories("${clan_INCLUDE}") -# Build doxygen +# Build Clan doxygen + message(STATUS "---") +# if (DOXYGEN_FOUND) +# message(STATUS "Doxygen found =) ${DOXYGEN_EXECUTABLE}") +# add_custom_target( +# doxygen +# ${DOXYGEN_EXECUTABLE} +# WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" +# COMMENT "Generating API documentation with Doxygen" VERBATIM +# ) +# else() +# message(STATUS "Doxygen not found :(") +# endif() find_package(Doxygen) - if(DOXYGEN_FOUND) + if (DOXYGEN_FOUND) configure_file("doc/Doxyfile.in" "Doxyfile") add_custom_target( doxygen @@ -35,30 +99,30 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) COMMENT "Generating API documentation with Doxygen" VERBATIM ) else() - message (STATUS "Doxygen not found :( API documentation can not be built") + message(STATUS "Doxygen not found :(") endif() # Build documentation - - # doc + + # Documentation find_program(texi2pdf_exe texi2pdf) - if(texi2pdf_exe) + if (texi2pdf_exe) add_custom_target( - doc + documentation ${texi2pdf_exe} ${CMAKE_CURRENT_SOURCE_DIR}/doc/clan.texi --output=${CMAKE_CURRENT_BINARY_DIR}/clan.pdf WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Generating documentation (pdf) (with texi2pdf)" VERBATIM ) else() - message (STATUS "texi2pdf not found :( Documentation can not be built") + message (STATUS "texi2pdf not found :(") endif() - + # Reference card find_program(pdflatex_exe pdflatex) - if(pdflatex_exe) + if (pdflatex_exe) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/doc/reference_card DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) add_custom_target( - ref_card + reference_card ${pdflatex_exe} ${CMAKE_CURRENT_BINARY_DIR}/reference_card/reference_card.tex WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/reference_card" COMMENT "Generating Clan reference card (pdf) (with pdflatex)" VERBATIM @@ -68,101 +132,95 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif() -# osl - find_package(osl REQUIRED) - -# Flex - find_package(BISON REQUIRED) - find_package(FLEX REQUIRED) - BISON_TARGET(clan_parser source/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.c) - FLEX_TARGET(clan_scanner source/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/scanner.c) - ADD_FLEX_BISON_DEPENDENCY(clan_scanner clan_parser) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -# Include directories (to use #include <> instead of #include "") - - # include/clan/macros.h - configure_file("include/clan/macros.h.in" "include/clan/macros.h") - include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") - # clan - include_directories("./include") - - # Compiler log message(STATUS "---") message(STATUS "C compiler = ${CMAKE_C_COMPILER}") - if (release) - message(STATUS "Mode Release") + if (RELEASE) + message(STATUS "Release mode") else() - message(STATUS "Mode Debug") + message(STATUS "Debug mode") endif() message(STATUS "C flags = ${CMAKE_C_FLAGS}") -# Library - - message(STATUS "---") - - # files .c +# Library Clan + file( GLOB_RECURSE - sources + clan_sources source/* ) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/source/clan.c;" "" sources "${sources}") # with ; string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/source/clan.c" "" sources "${sources}") # without ; - + # Shared add_library( clan SHARED - ${sources} + ${clan_sources} ${BISON_clan_parser_OUTPUTS} ${FLEX_clan_scanner_OUTPUTS} ) - target_link_libraries(clan ${OSL_LIBRARY}) - get_property(clan_lib_location TARGET clan PROPERTY LOCATION) - message(STATUS "Add clan library (shared) ${clan_lib_location}") - + if (OSL1_FOUND) + target_link_libraries(clan ${OSL1_LIBRARY} ${OSL_LIBRARY}) + else() + target_link_libraries(clan ${OSL_LIBRARY}) + endif() + message(STATUS "Add Clan library (shared)") + # Static add_library( clan_static STATIC - ${sources} + ${clan_sources} ${BISON_clan_parser_OUTPUTS} ${FLEX_clan_scanner_OUTPUTS} ) set_target_properties(clan_static PROPERTIES OUTPUT_NAME clan) - target_link_libraries(clan_static ${OSL_LIBRARY}) - get_property(clan_static_lib_location TARGET clan_static PROPERTY LOCATION) - message(STATUS "Add clan library (static) ${clan_static_lib_location}") + if (OSL1_FOUND) + target_link_libraries(clan_static ${OSL1_LIBRARY} ${OSL_LIBRARY}) + else() + target_link_libraries(clan_static ${OSL_LIBRARY}) + endif() + message(STATUS "Add Clan library (static)") # Executables & tests - - message(STATUS "---") # clan + + enable_testing() + message(STATUS "---") message(STATUS "Add executable clan") add_executable(clan_exe "source/clan.c") set_target_properties(clan_exe PROPERTIES OUTPUT_NAME "clan") - target_link_libraries(clan_exe clan_static ${OSL_LIBRARY}) - - # clan test + target_link_libraries(clan_exe clan_static) + + if (OSL1_FOUND) + message(STATUS "Add executable clan1") + add_executable(clan1_exe "exe/clan1.c") + set_target_properties(clan1_exe PROPERTIES OUTPUT_NAME "clan1") + target_link_libraries(clan1_exe clan_static) + endif() + + # Valgrind + #find_program(VALGRIND_EXE NAMES valgrind) + + # Python find_package(PythonInterp) if (PYTHONINTERP_FOUND) - message(STATUS "---") - - enable_testing() + # Tests file( GLOB_RECURSE tests tests/*.c ) - foreach(test ${tests}) + message(STATUS "Add Test ${test}") + if("${test}" MATCHES "autoscop") + add_test( ${test} "${CMAKE_CURRENT_SOURCE_DIR}/tests/check_source_result.py" @@ -171,7 +229,9 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) "${CMAKE_CURRENT_BINARY_DIR}/clan" "-autoscop" ) + else() + add_test( ${test} "${CMAKE_CURRENT_SOURCE_DIR}/tests/check_source_result.py" @@ -179,44 +239,57 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) "${test}.scop" "${CMAKE_CURRENT_BINARY_DIR}/clan" ) + endif() - endforeach() - - message(STATUS "---") - + + endforeach() + endif() # Install - + # Library install(TARGETS clan LIBRARY DESTINATION lib) - install(TARGETS clan_static ARCHIVE DESTINATION lib) + install(TARGETS clan_static ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + # Executable + install(TARGETS clan_exe RUNTIME DESTINATION bin) + if (OSL1_FOUND) + install(TARGETS clan1_exe RUNTIME DESTINATION bin) + endif() + # .h install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h") install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/" DESTINATION include FILES_MATCHING PATTERN "*.h") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/parser.h" DESTINATION include/clan) - install(FILES clan-config.cmake DESTINATION lib/clan) - install(TARGETS clan_exe RUNTIME DESTINATION bin) + # .cmake + install(FILES cmake/clan-config.cmake DESTINATION lib/clan) + # Doxygen + if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen) + install(DIRECTORY doc/doxygen DESTINATION share/clan) + endif() + # Documentation + if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/clan.pdf) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clan.pdf DESTINATION share/clan) + endif() + # Reference card + if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/reference_card.pdf) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/reference_card.pdf DESTINATION share/clan) + endif() # Little help - + message(STATUS "---") message(STATUS "You can execute:") - message(STATUS " make # To compile clan library & clan") - if (PYTHONINTERP_FOUND) - message(STATUS " make test # To execute tests") - endif() - message(STATUS " make install # To install library, include and CMake module") - message(STATUS " # If you need root access:") - message(STATUS " # sudo make install") - message(STATUS " # su -c \"make install\"") - if(DOXYGEN_FOUND) - message(STATUS " make doxygen # To generate the Doxygen") + message(STATUS " make # To compile Clan tests") + message(STATUS " make test # To execute tests") + message(STATUS " make install # To install library, include and CMake module") + message(STATUS " # If you need root access:") + message(STATUS " # sudo make install") + message(STATUS " # su -c \"make install\"") + if (DOXYGEN_FOUND) + message(STATUS " make doxygen # To generate the Doxygen") endif() - if(texi2pdf_exe) - message(STATUS " make doc # To generate the documentation") + if (texi2pdf_exe) + message(STATUS " make documentation # To generate the documentation") endif() - if(pdflatex_exe) - message(STATUS " make ref_card # To generate Clan reference card") + if (pdflatex_exe) + message(STATUS " make reference_card # To Clan reference card") endif() - - message(STATUS "---") diff --git a/cmake/clan-config.cmake b/cmake/clan-config.cmake new file mode 100644 index 0000000..1e7d923 --- /dev/null +++ b/cmake/clan-config.cmake @@ -0,0 +1,47 @@ +# Copyright © 2015 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Try to find the Clan library + +# CLAN_FOUND - System has Clan library +# CLAN_INCLUDE_DIR - The Clan include directory +# CLAN_LIBRARY - Library needed to use Clan + + +find_library(CLAN_LIBRARY clan) +find_file(CLAN_INCLUDE_DIR "clan/clan.h") + +if (CLAN_LIBRARY AND CLAN_INCLUDE_DIR) + + string(REPLACE "/clan/clan.h" "" CLAN_INCLUDE_DIR ${CLAN_INCLUDE_DIR}) + + set(CLAN_FOUND "TRUE") + + include_directories(${CLAN_INCLUDE_DIR}) + + message(STATUS "Library Clan found =) ${CLAN_INCLUDE_DIR} | ${CLAN_LIBRARY}") + + find_package(osl1) + if (OSL1_FOUND) + add_definitions("-Dclan_with_osl1") + endif() + +else() + + set(CLAN_FOUND "FALSE") + + message(STATUS "Library Clan not found :(") + +endif() diff --git a/exe/clan1.c b/exe/clan1.c new file mode 100644 index 0000000..f2a1105 --- /dev/null +++ b/exe/clan1.c @@ -0,0 +1,44 @@ +// Copyright © 2015 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +#include +#include + +#include + + +int main(int argc, char** argv) { + + if (argc == 1) { + fprintf(stderr, "# Usage: %s \n", argv[0]); + return 1; + } + + FILE* file = fopen(argv[1], "r"); + + if (file != NULL) { + osl1_vector_scop_t scops = clan1_scop_extract(file); + for (size_t i = 0; i < scops.size; ++i) { + osl1_scop_print(&scops.array[i]); + } + osl1_vector_scop_destroy(&scops); + } + else { + fprintf(stderr, "# ERROR: %s: Can not open file \"%s\"\n", argv[0], argv[1]); + return 1; + } + + return 0; +} diff --git a/include/clan/clan1.h b/include/clan/clan1.h new file mode 100644 index 0000000..ede8306 --- /dev/null +++ b/include/clan/clan1.h @@ -0,0 +1,43 @@ +// Copyright © 2015 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +#ifndef CLAN_CLAN1_H +#define CLAN_CLAN1_H + +#ifdef clan_with_osl1 + +#include + +#include + +#include "clan.h" + + +#if defined(__cplusplus) +extern "C" +{ +#endif + + +// Extract +osl1_vector_scop_t clan1_scop_extract(FILE* file); + +#if defined(__cplusplus) +} +#endif + +#endif + +#endif diff --git a/source/clan1.c b/source/clan1.c new file mode 100644 index 0000000..ff9c281 --- /dev/null +++ b/source/clan1.c @@ -0,0 +1,48 @@ +// Copyright © 2015 Inria, Written by Lénaïc Bagnères, lenaic.bagneres@inria.fr + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +#include + +#ifdef clan_with_osl1 + +#include + +#include "../include/clan/clan1.h" +#include "../include/clan/clan.h" + + +// Extract + +/** + * @brief Extract SCoPs from a C file + * @param[in] file A C file + * @return the osl1_vector_scop_t with the SCoPs extracted + */ +osl1_vector_scop_t clan1_scop_extract(FILE* file) { + // Create Clan options + clan_options_t* clan_options = clan_options_malloc(); + // Extract + osl_scop_t* scop_osl = clan_scop_extract(file, clan_options); + // Convert + osl1_vector_scop_t scops = osl_to_osl1(scop_osl); + // Destroy + clan_options_free(clan_options); clan_options = NULL; + osl_scop_free(scop_osl); scop_osl = NULL; + // Return + return scops; +} + +#endif From dda06c23ecaa33f29ca62ea8b42c91569c1f2367 Mon Sep 17 00:00:00 2001 From: Lnc Date: Fri, 27 Feb 2015 16:31:21 +0100 Subject: [PATCH 2/5] Add extraction of first comments by clan1_scop_extract --- source/clan1.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/clan1.c b/source/clan1.c index ff9c281..1f3e996 100644 --- a/source/clan1.c +++ b/source/clan1.c @@ -38,6 +38,34 @@ osl1_vector_scop_t clan1_scop_extract(FILE* file) { osl_scop_t* scop_osl = clan_scop_extract(file, clan_options); // Convert osl1_vector_scop_t scops = osl_to_osl1(scop_osl); + // Get first comments + { + fpos_t file_pos; fgetpos(file, &file_pos); + const osl_scop_t* scop_osl_p = scop_osl; + for (size_t i = 0; i < scops.size; ++i) { + osl1_scop_t* scop = &scops.array[i]; + // Get coordinates extension + const osl_coordinates_t* const coordinates = + osl_generic_lookup(scop_osl_p->extension, "coordinates"); + // Extension + if (coordinates != NULL) { + // Extract first comments + rewind(file); + osl1_extension_comments_t comments = + osl1_extension_comments_extract(file, + (size_t)coordinates->line_start); + // Add extension + gho_any_t any = osl1_extension_comments_to_any(&comments); + gho_vector_any_add(&scop->extensions, &any); + gho_any_destroy(&any); + // Destroy + osl1_extension_comments_destroy(&comments); + } + // Next + scop_osl_p = scop_osl_p->next; + } + fsetpos(file, &file_pos); + } // Destroy clan_options_free(clan_options); clan_options = NULL; osl_scop_free(scop_osl); scop_osl = NULL; From 471b77d873d15139ca84896b65526a984f20bdcc Mon Sep 17 00:00:00 2001 From: Lnc Date: Wed, 4 Mar 2015 09:34:50 +0100 Subject: [PATCH 3/5] Rename clan1_scop_extract function to clan1_extract_scops --- exe/clan1.c | 2 +- include/clan/clan1.h | 2 +- source/clan1.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exe/clan1.c b/exe/clan1.c index f2a1105..af03b9c 100644 --- a/exe/clan1.c +++ b/exe/clan1.c @@ -29,7 +29,7 @@ int main(int argc, char** argv) { FILE* file = fopen(argv[1], "r"); if (file != NULL) { - osl1_vector_scop_t scops = clan1_scop_extract(file); + osl1_vector_scop_t scops = clan1_extract_scops(file); for (size_t i = 0; i < scops.size; ++i) { osl1_scop_print(&scops.array[i]); } diff --git a/include/clan/clan1.h b/include/clan/clan1.h index ede8306..9af2ec4 100644 --- a/include/clan/clan1.h +++ b/include/clan/clan1.h @@ -32,7 +32,7 @@ extern "C" // Extract -osl1_vector_scop_t clan1_scop_extract(FILE* file); +osl1_vector_scop_t clan1_extract_scops(FILE* file); #if defined(__cplusplus) } diff --git a/source/clan1.c b/source/clan1.c index 1f3e996..38dbffa 100644 --- a/source/clan1.c +++ b/source/clan1.c @@ -31,7 +31,7 @@ * @param[in] file A C file * @return the osl1_vector_scop_t with the SCoPs extracted */ -osl1_vector_scop_t clan1_scop_extract(FILE* file) { +osl1_vector_scop_t clan1_extract_scops(FILE* file) { // Create Clan options clan_options_t* clan_options = clan_options_malloc(); // Extract From 3eb1d3b467d645f0972f6c8fb37ec911a564b7a9 Mon Sep 17 00:00:00 2001 From: Lnc Date: Fri, 17 Apr 2015 14:54:46 +0200 Subject: [PATCH 4/5] Add types of output dimensions by clan1_extract_scops function --- source/clan1.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/clan1.c b/source/clan1.c index 38dbffa..4ee92fa 100644 --- a/source/clan1.c +++ b/source/clan1.c @@ -66,6 +66,23 @@ osl1_vector_scop_t clan1_extract_scops(FILE* file) { } fsetpos(file, &file_pos); } + // Types of output dimensions + for (size_t i = 0; i < scops.size; ++i) { + osl1_scop_t* scop = &scops.array[i]; + for (size_t s = 0; s < scop->statements.size; ++s) { + osl1_statement_t* statement = &scop->statements.array[s]; + for (size_t cv = 0; cv < statement->scattering.size; ++cv) { + osl1_convex_relation_t* convex_relation = + &statement->scattering.array[cv]; + for (size_t t = 0; t < convex_relation->output_dims_types.size; ++t) { + osl1_dimension_type_t* type = + &convex_relation->output_dims_types.array[t]; + if (t % 2 == 0) { type->dimension_type = osl1_dimension_type_beta; } + else { type->dimension_type = osl1_dimension_type_alpha; } + } + } + } + } // Destroy clan_options_free(clan_options); clan_options = NULL; osl_scop_free(scop_osl); scop_osl = NULL; From 661bd99cd02f0d180a51cbb328a9c3b317098fed Mon Sep 17 00:00:00 2001 From: Lnc Date: Wed, 10 Jun 2015 16:13:03 +0200 Subject: [PATCH 5/5] Update CMake build process --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6592db9..298dae2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,9 @@ cmake_minimum_required(VERSION 2.6) else() target_link_libraries(clan ${OSL_LIBRARY}) endif() + if (OSL_GMP_FOUND) + target_link_libraries(clan ${OSL_GMP_LIBRARY}) + endif() message(STATUS "Add Clan library (shared)") # Static @@ -182,6 +185,9 @@ cmake_minimum_required(VERSION 2.6) else() target_link_libraries(clan_static ${OSL_LIBRARY}) endif() + if (OSL_GMP_FOUND) + target_link_libraries(clan_static ${OSL_GMP_LIBRARY}) + endif() message(STATUS "Add Clan library (static)")