Skip to content

Commit

Permalink
[update] update with_cmake with the ibex v2.4.2
Browse files Browse the repository at this point in the history
		 Use new way to configure interval with filib
  • Loading branch information
benEnsta committed Jun 25, 2017
1 parent 46ffd75 commit 0525af4
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
Binary file added 3rd/filibsrc-3.0.2.2.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IF(NOT CMAKE_BUILD_TYPE)
#SET(CMAKE_BUILD_TYPE "MINSIZEREL")
ENDIF()

set(PACKAGE_VERSION "2.3.0")
set(PACKAGE_VERSION "2.4.2")

# option declaration
option(BUILD_TESTS "Build tests" ON)
Expand Down Expand Up @@ -112,8 +112,8 @@ set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "IbexTeam")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Interval Library")
set(CPACK_PACKAGE_VERSION_MAJOR "2")
set(CPACK_PACKAGE_VERSION_MINOR "3")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_VERSION_MINOR "4")
set(CPACK_PACKAGE_VERSION_PATCH "2")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ibex-lib")

Expand Down
45 changes: 43 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
# Create cxscconf.h file (will be created in the build directory

FILE(READ ${CMAKE_SOURCE_DIR}/plugins/interval_lib_filib/wrapper.cpp IBEX_INTERVAL_LIB_WRAPPER_CPP)
FILE(READ ${CMAKE_SOURCE_DIR}/plugins/interval_lib_filib/wrapper.h IBEX_INTERVAL_LIB_WRAPPER_H)
set(IBEX_INTERVAL_LIB_INCLUDES "#include \"interval/interval.hpp\"")
set(IBEX_INTERVAL_LIB_EXTRA_DEFINES "
/* simplify instantiation */
#define FI_BASE double
#define FI_ROUNDING filib::native_switched
#define FI_MODE filib::i_mode_extended_flag
/** \\brief IBEX_NAN: <double> representation of NaN */
#define IBEX_NAN filib::primitive::compose(0,0x7FF,1 << 19,0)
")
set( IBEX_INTERVAL_LIB_NEG_INFINITY "filib::primitive::compose(1,0x7FF,0,0)" )
set( IBEX_INTERVAL_LIB_POS_INFINITY "filib::primitive::compose(0,0x7FF,0,0)" )
set( IBEX_INTERVAL_LIB_ITV_EXTRA "typedef filib::interval<FI_BASE,FI_ROUNDING,FI_MODE> FI_INTERVAL;" )
set( IBEX_INTERVAL_LIB_ITV_WRAP "Interval(const FI_INTERVAL& x);" )
set( IBEX_INTERVAL_LIB_ITV_ASSIGN "Interval& operator=(const FI_INTERVAL& x);" )
set( IBEX_INTERVAL_LIB_ITV_DEF "FI_INTERVAL itv;" )
set( IBEX_INTERVAL_LIB_DISTANCE "x1.itv.dist(x2.itv);" )
set(INTERVAL_LIB "FILIB")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/arithmetic/ibex_Interval.h.in
${CMAKE_CURRENT_BINARY_DIR}/arithmetic/ibex_Interval.h
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/arithmetic/ibex_Interval.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/arithmetic/ibex_Interval.cpp
)



configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ibex_Setting.h.in
${CMAKE_CURRENT_BINARY_DIR}/ibex_Setting.h
)

# add generated files to SRCS and HEADERS
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/arithmetic/ibex_Interval.h
${CMAKE_CURRENT_BINARY_DIR}/ibex_Setting.h
)
set(SRCS ${SRCS} ${CMAKE_CURRENT_BINARY_DIR}/arithmetic/ibex_Interval.cpp)


set( DIR_LIST
arithmetic
bisector
Expand All @@ -28,6 +67,8 @@ endif(WIN32)

# include all .cpp and .h
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/arithmetic)


foreach( dir ${DIR_LIST})
message(STATUS ${dir})
Expand All @@ -38,7 +79,7 @@ foreach( dir ${DIR_LIST})
set(SRCS ${SRCS} ${dir_src})
set(HEADERS ${HEADERS} ${dir_headers} ${dir_headers_})
endforeach(dir)
set(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/ibex_Setting.h)


set(dir ${CMAKE_CURRENT_SOURCE_DIR}/parser)
if(GENERATE_PARSER_FILES)
Expand Down
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ file(GLOB Test_SRC
"*.h"
"*.cpp"
)
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES("fmemopen.h" HAVE_FMEMOPEN)
if(HAVE_FMEMOPEN)
add_definitions(-DHAVE_FMEMOPEN)
endif(HAVE_FMEMOPEN)

if( NOT WITH_CLP)
list(REMOVE_ITEM Test_SRC ${CMAKE_CURRENT_SOURCE_DIR}/TestCtcPolytopHull.cpp)
list(REMOVE_ITEM Test_SRC ${CMAKE_CURRENT_SOURCE_DIR}/TestFritzJohn.cpp)
Expand Down
2 changes: 1 addition & 1 deletion tests/TestFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "ibex_Expr.h"
#include "ibex_SyntaxError.h"
#include <sstream>
#ifndef HAVE_FMEMOPEN
#ifdef HAVE_FMEMOPEN
#include "fmemopen.h"
#endif

Expand Down
6 changes: 2 additions & 4 deletions tests/TestParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//============================================================================
// I B E X
// I B E X
// File : TestParser.cpp
// Author : Gilles Chabert
// Copyright : Ecole des Mines de Nantes (France)
Expand All @@ -15,7 +15,7 @@
#include "ibex_SyntaxError.h"
#include "ibex_CtcFwdBwd.h"
#include "Ponts30.h"
#ifndef HAVE_FMEMOPEN
#ifdef HAVE_FMEMOPEN
#include "fmemopen.h"
#endif

Expand Down Expand Up @@ -322,5 +322,3 @@ void TestParser::nary_max() {
}

} // end namespace


0 comments on commit 0525af4

Please sign in to comment.