Skip to content

Commit

Permalink
Squashed merge from git gitlab-master into master
Browse files Browse the repository at this point in the history
at gitlab-master commit 2393461

all build files need to be regenerated
  • Loading branch information
kkulshre committed Jan 25, 2020
1 parent 296ae49 commit b1ca84e
Show file tree
Hide file tree
Showing 34 changed files with 20,892 additions and 222 deletions.
14 changes: 13 additions & 1 deletion .gitattributes
Expand Up @@ -2,6 +2,18 @@
.coin-or/projDesc.xml -text
ADOL-C/Makefile.am -text
ADOL-C/Makefile.in -text
ADOL-C/boost-test/CMakeLists.txt -text
ADOL-C/boost-test/README -text
ADOL-C/boost-test/const.h -text
ADOL-C/boost-test/main.cpp -text
ADOL-C/boost-test/traceCompositeTests.cpp -text
ADOL-C/boost-test/traceOperatorScalar.cpp -text
ADOL-C/boost-test/traceOperatorVector.cpp -text
ADOL-C/boost-test/traceSecOrderScalar.cpp -text
ADOL-C/boost-test/traceSecOrderVector.cpp -text
ADOL-C/boost-test/tracelessCompositeTests.cpp -text
ADOL-C/boost-test/tracelessOperatorScalar.cpp -text
ADOL-C/boost-test/tracelessOperatorVector.cpp -text
ADOL-C/doc/absdrivers.tex -text
ADOL-C/doc/adolc-manual.pdf -text
ADOL-C/doc/adolc-manual.ps -text
Expand Down Expand Up @@ -369,7 +381,7 @@ ADOL-C/test/speelpenning.cpp -text
/INSTALL -text
/LICENSE -text
MSVisualStudio/v14/ColPack.vcxproj -text
MSVisualStudio/v14/Readme_VC++.txt -text
MSVisualStudio/v14/README_VC++.md -text
MSVisualStudio/v14/adolc.sln -text
MSVisualStudio/v14/adolc.vcxproj -text
MSVisualStudio/v14/installer.sh -text
Expand Down
60 changes: 60 additions & 0 deletions ADOL-C/boost-test/CMakeLists.txt
@@ -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)
19 changes: 19 additions & 0 deletions ADOL-C/boost-test/README
@@ -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.
6 changes: 6 additions & 0 deletions ADOL-C/boost-test/const.h
@@ -0,0 +1,6 @@
#ifndef CONST_H
#define CONST_H

const double tol = 1e-8;

#endif
16 changes: 16 additions & 0 deletions ADOL-C/boost-test/main.cpp
@@ -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 );
}

0 comments on commit b1ca84e

Please sign in to comment.