diff --git a/cpp_prototype/CMakeLists.txt b/cpp_prototype/CMakeLists.txt new file mode 100644 index 000000000..58cbc4b90 --- /dev/null +++ b/cpp_prototype/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.10) + +message(STATUS "CMake version ${CMAKE_VERSION}") + +set(LANGUAGES C CXX) +set(BML_BUILD_FORTRAN_INTERFACE TRUE CACHE BOOL + "Build the Fortran API (requires a Fortran compiler)") +if(BML_BUILD_FORTRAN_INTERFACE) + list(APPEND LANGUAGES Fortran) +endif() + +set(BML_BUILD_PYTHON_INTERFACE TRUE CACHE BOOL + "Build the Python API (requires Python dev package)") + +project(bml ${LANGUAGES}) # don't move this line as it changes PROJECT_SOURCE_DIR + +add_subdirectory(src) +add_subdirectory(tests) diff --git a/cpp_prototype/src/CMakeLists.txt b/cpp_prototype/src/CMakeLists.txt new file mode 100644 index 000000000..61cd4f200 --- /dev/null +++ b/cpp_prototype/src/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(bml + bml_allocate.cc) diff --git a/cpp_prototype/src/bml.h b/cpp_prototype/src/bml.h new file mode 100644 index 000000000..eee51cece --- /dev/null +++ b/cpp_prototype/src/bml.h @@ -0,0 +1,4 @@ +#ifndef __BML_H +#define __BML_H + +#endif diff --git a/cpp_prototype/src/bml_allocate.cc b/cpp_prototype/src/bml_allocate.cc new file mode 100644 index 000000000..abc445674 --- /dev/null +++ b/cpp_prototype/src/bml_allocate.cc @@ -0,0 +1,8 @@ +#include "bml_types.h" + +#include + +void * bml_allocate(int rows) +{ + return malloc(10); +} diff --git a/cpp_prototype/src/bml_types.h b/cpp_prototype/src/bml_types.h new file mode 100644 index 000000000..acf4f47fb --- /dev/null +++ b/cpp_prototype/src/bml_types.h @@ -0,0 +1,6 @@ +#ifndef __BML_TYPES_H +#define __BML_TYPES_H + +typedef void * BML_MATRIX_DENSE_T; + +#endif diff --git a/cpp_prototype/tests/CMakeLists.txt b/cpp_prototype/tests/CMakeLists.txt new file mode 100644 index 000000000..f997753d7 --- /dev/null +++ b/cpp_prototype/tests/CMakeLists.txt @@ -0,0 +1,3 @@ +include_directories(${CMAKE_SOURCE_DIR}/src) +add_executable(bml-test + bml-test.cc) diff --git a/cpp_prototype/tests/bml-test.cc b/cpp_prototype/tests/bml-test.cc new file mode 100644 index 000000000..2fbdc929a --- /dev/null +++ b/cpp_prototype/tests/bml-test.cc @@ -0,0 +1,7 @@ +#include +#include +#include + +int main() { + printf("starting tests\n"); +}