forked from modern-fortran/neural-fortran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
87 lines (75 loc) · 2.15 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# CMake version, project name, language
cmake_minimum_required(VERSION 3.20)
# If build type not specified, default to release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build Release")
endif()
project(neural-fortran
LANGUAGES C Fortran
)
enable_testing()
include(FetchContent)
include(cmake/options.cmake)
include(cmake/compilers.cmake)
include(cmake/functional.cmake)
include(cmake/h5fortran.cmake)
include(cmake/json.cmake)
# library to archive (libneural.a)
add_library(neural
src/nf.f90
src/nf/nf_activation.f90
src/nf/nf_base_layer.f90
src/nf/nf_base_layer_submodule.f90
src/nf/nf_conv2d_layer.f90
src/nf/nf_conv2d_layer_submodule.f90
src/nf/nf_datasets.f90
src/nf/nf_datasets_submodule.f90
src/nf/nf_datasets_mnist.f90
src/nf/nf_datasets_mnist_submodule.f90
src/nf/nf_dense_layer.f90
src/nf/nf_dense_layer_submodule.f90
src/nf/nf_flatten_layer.f90
src/nf/nf_flatten_layer_submodule.f90
src/nf/nf_input1d_layer.f90
src/nf/nf_input1d_layer_submodule.f90
src/nf/nf_input3d_layer.f90
src/nf/nf_input3d_layer_submodule.f90
src/nf/nf_keras.f90
src/nf/nf_keras_submodule.f90
src/nf/nf_layer_constructors.f90
src/nf/nf_layer_constructors_submodule.f90
src/nf/nf_layer.f90
src/nf/nf_layer_submodule.f90
src/nf/nf_loss.f90
src/nf/nf_loss_submodule.f90
src/nf/nf_maxpool2d_layer.f90
src/nf/nf_maxpool2d_layer_submodule.f90
src/nf/nf_network.f90
src/nf/nf_network_submodule.f90
src/nf/nf_optimizers.f90
src/nf/nf_parallel.f90
src/nf/nf_parallel_submodule.f90
src/nf/nf_random.f90
src/nf/nf_random_submodule.f90
src/nf/nf_reshape_layer.f90
src/nf/nf_reshape_layer_submodule.f90
src/nf/io/nf_io_binary.f90
src/nf/io/nf_io_binary_submodule.f90
src/nf/io/nf_io_hdf5.f90
src/nf/io/nf_io_hdf5_submodule.f90
)
target_link_libraries(neural PRIVATE
functional::functional
h5fortran::h5fortran
HDF5::HDF5
jsonfortran::jsonfortran
)
install(TARGETS neural)
# Remove leading or trailing whitespace
string(REGEX REPLACE "^ | $" "" LIBS "${LIBS}")
if(${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
endif()
if(${PROJECT_NAME}_BUILD_EXAMPLES)
add_subdirectory(example)
endif()