-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
204 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(pyFUGE) | ||
set(SOURCE_DIR pyfuge/py_fiseval) | ||
|
||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
find_package(Eigen3 3.3 REQUIRED NO_MODULE) | ||
find_package(Catch2 REQUIRED NO_MODULE) | ||
find_package(OpenMP) | ||
if(OPENMP_FOUND) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") | ||
endif() | ||
include_directories( | ||
# ${SOURCE_DIR} | ||
${CMAKE_SOURCE_DIR}/pyfuge/py_fiseval/FISEval/include | ||
${EIGEN3_INCLUDE_DIR} | ||
) | ||
# get_cmake_property(_variableNames VARIABLES) | ||
# list (SORT _variableNames) | ||
# foreach (_variableName ${_variableNames}) | ||
# message(STATUS "${_variableName}=${${_variableName}}") | ||
# endforeach() | ||
add_subdirectory(${SOURCE_DIR}/FISEval) | ||
add_subdirectory(${SOURCE_DIR}/pybind11) | ||
pybind11_add_module(pyfuge_c SHARED "${SOURCE_DIR}/fiseval_bindings.cpp" ${SOURCE_DIR}/FISEval) | ||
target_link_libraries(pyfuge_c PRIVATE pyfuge) | ||
|
||
message(STATUS "${SOURCES}") |
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
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,63 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(FISEval) | ||
|
||
# set( CMAKE_VERBOSE_MAKEFILE on ) | ||
|
||
# Enable C 14 features | ||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# Set build type | ||
# set(CMAKE_BUILD_TYPE Release) | ||
|
||
|
||
find_package(Eigen3 3.3 REQUIRED NO_MODULE) | ||
find_package(Catch2 REQUIRED NO_MODULE) | ||
find_package(OpenMP) | ||
|
||
if(OPENMP_FOUND) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") | ||
endif() | ||
|
||
# Compiler specific flags | ||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize -mtune=native -march=native -mavx") | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") | ||
endif() | ||
|
||
include_directories(include) | ||
|
||
set(LINK_LIBRARIES | ||
Catch2::Catch | ||
Eigen3::Eigen | ||
) | ||
|
||
set(SOURCES | ||
src/fis.cpp | ||
) | ||
|
||
set(SOURCES_TEST | ||
tests/fis_lininterp_test.cpp | ||
tests/tests.cpp | ||
) | ||
set(SOURCES_TEST ${SOURCES_TEST} ${SOURCES}) | ||
|
||
|
||
# Make executable | ||
add_library(pyfuge ${SOURCES}) | ||
target_link_libraries(pyfuge ${LINK_LIBRARIES}) | ||
|
||
|
||
# compile tests only if debug | ||
# TODO: use cmake built-in test mecanisms | ||
if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# remove the main from SOURCE to only use the main from tests.cpp | ||
list(REMOVE_ITEM SOURCES_TEST src/main.cpp) | ||
add_executable(run_tests ${SOURCES_TEST}) | ||
target_link_libraries(run_tests ${LINK_LIBRARIES}) | ||
endif() |
This file was deleted.
Oops, something went wrong.
Empty file.
1 change: 1 addition & 0 deletions
1
...fiseval/FISEval/cpp/hpp/custom_eigen_td.h → ...fiseval/FISEval/include/custom_eigen_td.h
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
2 changes: 1 addition & 1 deletion
2
pyfuge/py_fiseval/FISEval/cpp/hpp/fis.h → pyfuge/py_fiseval/FISEval/include/fis.h
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
2 changes: 1 addition & 1 deletion
2
pyfuge/py_fiseval/FISEval/cpp/src/fis.cpp → pyfuge/py_fiseval/FISEval/src/fis.cpp
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 |
---|---|---|
@@ -1,4 1,4 @@ | ||
#include "../hpp/fis.h" | ||
#include "fis.h" | ||
#include "omp.h" | ||
#include <algorithm> | ||
#include <cmath> | ||
|
6 changes: 3 additions & 3 deletions
6
.../FISEval/cpp/tests/fis_lininterp_test.cpp → ...eval/FISEval/tests/fis_lininterp_test.cpp
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
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 |
---|---|---|
@@ -1,4 1,4 @@ | ||
#include "FISEval/cpp/hpp/fis.h" | ||
#include "fis.h" | ||
#include <pybind11/numpy.h> | ||
#include <pybind11/pybind11.h> | ||
|
||
|
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