Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed merge from git gitlab-master into master
at gitlab-master commit 2393461 all build files need to be regenerated
- Loading branch information
Showing
34 changed files
with
20,892 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(boost-test-adolc CXX) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
|
||
## BOOST | ||
set(3RDPARTY_BOOST_DIR "" CACHE PATH "The directory where BOOST library is installed") | ||
|
||
if(3RDPARTY_BOOST_DIR) | ||
set(BOOST_ROOT ${3RDPARTY_BOOST_DIR}) | ||
# set(BOOST_INCLUDEDIR ${3RDPARTY_BOOST_DIR}/include) | ||
# set(BOOST_LIBRARYDIR ${3RDPARTY_BOOST_DIR}/lib) | ||
endif() | ||
|
||
set(BOOST_MIN_VERSION "1.59.0") | ||
set(Boost_NO_BOOST_CMAKE ON) | ||
|
||
find_package(Boost ${BOOST_MIN_VERSION} REQUIRED) | ||
|
||
if(NOT Boost_FOUND) | ||
message(FATAL_ERROR "Fatal error: Boost (version >= 1.69.0) required.") | ||
else() | ||
message(STATUS "Setting up BOOST") | ||
message(STATUS "Boost include: " ${Boost_INCLUDE_DIRS}) | ||
message(STATUS "Boost library: " ${Boost_LIBRARY_DIRS}) | ||
endif() | ||
|
||
## ADOL-C | ||
set (ADOLC_BASE "" CACHE PATH "The directory where ADOL-C is installed") | ||
if(ADOLC_BASE) | ||
message(STATUS "Setting up ADOL-C") | ||
|
||
unset(ADOLC_INCLUDE_DIR CACHE) | ||
find_path(ADOLC_INCLUDE_DIR NAMES adolc/adolc.h PATHS ${ADOLC_BASE}/include NO_DEFAULT_PATH) | ||
if(NOT ADOLC_INCLUDE_DIR) | ||
message(FATAL_ERROR "Fatal error: ADOL-C include directory not found, check if ADOLC_BASE path is correct") | ||
endif() | ||
|
||
unset(ADOLC_LIBRARY CACHE) | ||
find_library(ADOLC_LIBRARY NAMES adolc PATHS ${ADOLC_BASE}/lib64 ${ADOLC_BASE}/lib NO_DEFAULT_PATHS) | ||
if(NOT ADOLC_LIBRARY) | ||
message(FATAL_ERROR "Fatal error: ADOL-C library not found, check if ADOLC_BASE path is correct") | ||
endif() | ||
|
||
unset(ADOLC_LIBRARY_DIR CACHE) | ||
get_filename_component(ADOLC_LIBRARY_DIR ${ADOLC_LIBRARY} DIRECTORY CACHE) | ||
|
||
message(STATUS "ADOL-C include: " ${ADOLC_INCLUDE_DIR}) | ||
message(STATUS "ADOL-C library: " ${ADOLC_LIBRARY_DIR}) | ||
else() | ||
message(FATAL_ERROR "ADOLC_BASE directory has to be specified") | ||
endif() | ||
|
||
include_directories(${Boost_INCLUDE_DIRS} ${ADOLC_INCLUDE_DIR}) | ||
link_directories(${Boost_LIBRARY_DIRS} ${ADOLC_LIBRARY_DIR}) | ||
|
||
set(SOURCE_FILES main.cpp tracelessOperatorScalar.cpp tracelessOperatorVector.cpp tracelessCompositeTests.cpp traceOperatorScalar.cpp traceOperatorVector.cpp traceCompositeTests.cpp traceSecOrderScalar.cpp traceSecOrderVector.cpp) | ||
add_executable(boost-test-adolc ${SOURCE_FILES}) | ||
|
||
target_link_libraries(boost-test-adolc -ladolc -lboost_system -lboost_unit_test_framework) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ADOL-C offers a unit-testing capability developed using the Boost.Test library. | ||
There are more than 400 tests to verify the basic functionality of ADOL-C, including both traceless and trace-based adouble variants. | ||
|
||
The minimum required version of BOOST library is 1.59.0. Any older version will cause compile-time errors. | ||
The BOOST library has to be compiled --with-test module, such that the library file boost_unit_test_framework is available. | ||
|
||
Instructions for compiling the test suite with cmake: | ||
|
||
1) Create the 'build' directory inside the boost-test directory (it is ignored by git). | ||
|
||
2) In 'boost-test/build' type: 'ccmake ../' or 'cmake-gui ../' | ||
|
||
3) Cmake will search for the system installed version of BOOST. If the minimum required version is not satisfied, please enter the path where an appropriate BOOST version is installed in '3RDPARTY_BOOST_DIR'. | ||
|
||
4) ADOL-C has to be compiled with the same version of BOOST defined in 3). When using a different BOOST version than the one provided by the operating system, ADOL-C can be configured with --with-boost flag before compiling the ADOL-C sources. | ||
|
||
5) In cmake, specify ADOLC_BASE directory where ADOL-C is installed. | ||
|
||
Run the executable boost-test-adolc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef CONST_H | ||
#define CONST_H | ||
|
||
const double tol = 1e-8; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#define BOOST_TEST_MODULE boost-adolc-test | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_NO_MAIN | ||
#include <boost/test/unit_test.hpp> | ||
|
||
namespace utf = boost::unit_test; | ||
|
||
#include<adolc/adtl.h> | ||
|
||
// entry point: | ||
int main(int argc, char* argv[], char* envp[]) | ||
{ | ||
adtl::setNumDir(2); | ||
return utf::unit_test_main( &init_unit_test, argc, argv ); | ||
} | ||
|
Oops, something went wrong.