Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ compiler:
before_install:
- sudo apt-get install gfortran -y
- type gfortran
install: autoreconf -i && ./configure && make -j8
script:
- make check -j8
- cat test/test_results.txt
jobs:
include:
- stage: build-and-test
install: autoreconf -i && ./configure && make -j8
script: make check -j8 && cat test/test_results.txt
-
install: mkdir build && cd build && cmake -DCMAKE_PREFIX_PATH=$PWD .. && make -j8 install
script: ./test.sh
1 change: 1 addition & 0 deletions Adept2Config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("${CMAKE_CURRENT_LIST_DIR}/adept.cmake")
89 changes: 89 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
cmake_minimum_required(VERSION 3.6)
project(Adept2)

set(CMAKE_CXX_STANDARD 14)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely not required, it builds even with gcc-4.2.


include(CTest)

set(ADEPT_HEADERS
include/adept/Active.h
include/adept/ActiveConstReference.h
include/adept/ActiveReference.h
include/adept/Allocator.h
include/adept/Array.h
include/adept/ArrayWrapper.h
include/adept/BinaryOperation.h
include/adept/Expression.h
include/adept/ExpressionSize.h
include/adept/FixedArray.h
include/adept/IndexedArray.h
include/adept/Packet.h
include/adept/RangeIndex.h
include/adept/ScratchVector.h
include/adept/SpecialMatrix.h
include/adept/Stack.h
include/adept/StackStorage.h
include/adept/StackStorageOrig.h
include/adept/StackStorageOrigStl.h
include/adept/Statement.h
include/adept/Storage.h
include/adept/UnaryOperation.h
include/adept/array_shortcuts.h
include/adept/base.h
include/adept/contiguous_matrix.h
include/adept/cppblas.h
include/adept/eval.h
include/adept/exception.h
include/adept/interp.h
include/adept/inv.h
include/adept/matmul.h
include/adept/noalias.h
include/adept/outer_product.h
include/adept/reduce.h
include/adept/scalar_shortcuts.h
include/adept/settings.h
include/adept/solve.h
include/adept/spread.h
include/adept/store_transpose.h
include/adept/traits.h
include/adept/vector_utilities.h
include/adept/where.h
)

set(ADEPT_SOURCES
adept/Array.cpp
adept/Stack.cpp
adept/StackStorageOrig.cpp
adept/Storage.cpp
adept/cppblas.cpp
adept/index.cpp
adept/inv.cpp
adept/jacobian.cpp
adept/settings.cpp
adept/solve.cpp
adept/vector_utilities.cpp
)

add_library(adept STATIC ${ADEPT_SOURCES} ${ADEPT_HEADERS})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can dynamic lib be supported as well? That is preferable on MacOS.

add_library(adept::adept ALIAS adept)
target_include_directories(adept PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

install(TARGETS adept
EXPORT adept
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

install(FILES ${ADEPT_HEADERS} DESTINATION include/adept)
install(FILES include/adept.h include/adept_arrays.h DESTINATION include)

install(FILES Adept2Config.cmake DESTINATION cmake)

install(EXPORT adept
NAMESPACE adept::
DESTINATION cmake)

add_subdirectory(test)
30 changes: 30 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function(add_adept_test TESTNAME)
set(TEST_SOURCES
algorithm.cpp)
set(TEST_HEADERS
algorithm.h
algorithm_with_and_without_ad.h)
add_executable(${TESTNAME} ${TESTNAME}.cpp ${TEST_SOURCES} ${TEST_HEADERS})
target_link_libraries(${TESTNAME}
PRIVATE
adept::adept)
enable_testing()
add_test(NAME ${TESTNAME} COMMAND ./${TESTNAME})
endfunction()

add_adept_test(test_adept)
#add_adept_test(test_adept_with_and_without_ad)
add_adept_test(test_array_derivatives)
add_adept_test(test_array_speed)
add_adept_test(test_arrays)
add_adept_test(test_checkpoint)
add_adept_test(test_constructors)
add_adept_test(test_derivatives)
add_adept_test(test_fixed_arrays)
#add_adept_test(test_gsl_interface)
add_adept_test(test_misc)
#add_adept_test(test_no_lib)
#add_adept_test(test_radiances)
#add_adept_test(test_radiances_array)
add_adept_test(test_thread_safe)
add_adept_test(test_thread_safe_arrays)