Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 3ce9582

Browse files
Merge pull request #2 from jchristopherson/Development
Development
2 parents 167c8e2 + 4bd79e7 commit 3ce9582

File tree

419 files changed

+28940
-4135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

419 files changed

+28940
-4135
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
bin/
3636
lib/
3737
build/
38-
html/
3938
latex/
4039

4140

@@ -51,4 +50,4 @@ install_manifest.txt
5150
CTestTestfile.cmake
5251

5352
# Misc Stuff
54-
c_cpp_properties.json
53+
c_cpp_properties.json

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ before_install:
77
- sudo apt-get update -qq
88

99
install:
10-
- sudo apt-get install -qq gfortran-5
11-
- sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-5 90
12-
13-
before_script:
10+
- sudo apt-get install -qq gfortran-7
11+
- sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 90
12+
13+
before_script:
1414
- mkdir build
1515
- cd build
1616
- cmake ..

CMakeLists.txt

Lines changed: 72 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,107 @@
11
# Master CMAKE Build Script
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.7)
33
project(curvefit C CXX Fortran)
44

55
# Define version information
6-
set(curvefit_VERSION_MAJOR 1)
7-
set(curvefit_VERSION_MINOR 1)
8-
set(curvefit_VERSION_PATCH 0)
6+
set(CURVEFIT_MAJOR_VERSION 1)
7+
set(CURVEFIT_MINOR_VERSION 1)
8+
set(CURVEFIT_PATCH_VERSION 0)
9+
set(CURVEFIT_VERSION ${CURVEFIT_MAJOR_VERSION}.${CURVEFIT_MINOR_VERSION}.${CURVEFIT_PATCH_VERSION})
10+
11+
# Set a default build type if none was specified
12+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
13+
message(STATUS "Setting build type to 'Release' as none was specified.")
14+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
15+
# Set the possible values of build type for cmake-gui
16+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
17+
endif()
18+
19+
# By default, shared library
20+
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
21+
22+
# Locate Dependencies
23+
find_package(ferror 1.3.0)
24+
find_package(linalg 1.5.0)
25+
find_package(nonlin 1.3.0)
26+
27+
# Define dependency directories
28+
set(NONLIN_DIRECTORY ${PROJECT_SOURCE_DIR}/src/external/nonlin)
29+
set(LINALG_DIRECTORY ${NONLIN_DIRECTORY}/src/external/linalg)
30+
set(FERROR_DIRECTORY ${LINALG_DIRECTORY}/src/external/ferror)
31+
32+
# If FERROR is not installed on the system, build the default implementation
33+
if (${ferror_FOUND})
34+
message(STATUS "An acceptable version of FERROR (v" ${ferror_VERSION} ") was found, and will be utilized.")
35+
set(FERROR_LIBRARIES ferror)
36+
get_target_property(ferror_LibLocation ferror LOCATION)
37+
endif()
38+
39+
# If LINALG is not installed on the system, build the default implementation
40+
if (${linalg_FOUND})
41+
message(STATUS "An acceptable version of LINALG (v" ${linalg_VERSION} ") was found, and will be utilized.")
42+
set(LINALG_LIBRARIES linalg)
43+
get_target_property(linalg_LibLocation linalg LOCATION)
44+
endif()
45+
46+
# If NONLIN is not installed on the system, build the default implementation
47+
if (${nonlin_FOUND})
48+
message(STATUS "An acceptable version of NONLIN (v" ${nonlin_VERSION} ") was found, and will be utilized.")
49+
set(NONLIN_LIBRARIES nonlin)
50+
get_target_property(nonlin_LibLocation nonlin LOCATION)
51+
else()
52+
message(STATUS "NONLIN not found. The default implementation will be used.")
53+
add_subdirectory(${NONLIN_DIRECTORY})
54+
set(nonlin_INCLUDE_DIRS ${NONLIN_DIRECTORY}/include)
55+
set(NONLIN_LIBRARIES nonlin)
56+
set(nonlin_LibLocation ${nonlin_BINARY_DIR})
57+
include_directories(${LINALG_DIRECTORY}/include)
58+
include_directories(${FERROR_DIRECTORY}/include)
59+
endif()
60+
61+
# Include the dependency module files
62+
include_directories(${nonlin_INCLUDE_DIRS} ${linalg_INCLUDE_DIRS} ${ferror_INCLUDE_DIRS})
63+
64+
# Export all symbols on Windows when building shared libraries
65+
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
66+
67+
# Locate the module files
68+
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/include)
969

1070
# Define output directories, if undefined
1171
if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
12-
message(STATUS "Library output directories undefined. Using default directories.")
72+
message(STATUS "CURVEFIT library output directories undefined. Using default directories.")
1373
if (CMAKE_BUILD_TYPE MATCHES Debug)
1474
# Debug Build
1575
if (BUILD_SHARED_LIBS)
1676
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
1777
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
1878
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
19-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug/mod)
2079
else()
2180
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
2281
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
2382
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
24-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug/mod)
2583
endif ()
2684
elseif (CMAKE_BUILD_TYPE MATCHES Release)
2785
# Release Build
2886
if (BUILD_SHARED_LIBS)
2987
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Release)
3088
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Release)
3189
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Release)
32-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Release/mod)
3390
else()
3491
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Release)
3592
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Release)
3693
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Release)
37-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Release/mod)
3894
endif ()
3995
else ()
4096
# Default Condition
4197
if (BUILD_SHARED_LIBS)
4298
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
4399
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
44100
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug)
45-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/Debug/mod)
46101
else()
47102
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
48103
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
49104
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug)
50-
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/Debug/mod)
51105
endif ()
52106
endif ()
53107
endif ()
@@ -71,18 +125,6 @@ else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
71125
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -Wall")
72126
endif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
73127

74-
# Define necessary CMake variables, and define the dependency.
75-
set(ExternalProjectCMakeArgs
76-
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
77-
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
78-
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
79-
-DCMAKE_Fortran_MODULE_DIRECTORY=${CMAKE_Fortran_MODULE_DIRECTORY}
80-
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/external
81-
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
82-
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
83-
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
84-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
85-
86128
# Locate the source directory
87129
add_subdirectory(src)
88130

@@ -94,71 +136,18 @@ if (BUILD_CURVEFIT_EXAMPLES)
94136
# Inform the user we're building the examples
95137
message(STATUS "Building CURVEFIT examples.")
96138

97-
# Interpolation Example
98-
add_executable(curvefit_interp_example examples/curvefit_interp_example.f90)
99-
target_link_libraries(curvefit_interp_example curvefit)
100-
101-
# LOWESS Example
102-
add_executable(curvefit_lowess_example examples/curvefit_lowess_example.f90)
103-
target_link_libraries(curvefit_lowess_example curvefit)
104-
105-
# Nonlinear Regression Example
106-
add_executable(curvefit_nlreg_example examples/curvefit_nlreg_example.f90)
107-
target_link_libraries(curvefit_nlreg_example curvefit)
108-
109-
# Calibration Example
110-
add_executable(curvefit_cal_example examples/curvefit_cal_example.f90)
111-
target_link_libraries(curvefit_cal_example curvefit)
112-
113-
# --------------------
114-
include_directories(${PROJECT_SOURCE_DIR}/include
115-
${PROJECT_SOURCE_DIR}/src/external/nonlin/include
116-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/include
117-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/src/external/ferror/include)
118-
119-
# Linear Interpolation Example
120-
add_executable(curvefit_c_interp_example examples/curvefit_c_interp_example.c)
121-
target_link_libraries(curvefit_c_interp_example curvefit)
122-
123-
# LOWESS Example
124-
add_executable(curvefit_c_lowess_example examples/curvefit_c_lowess_example.c)
125-
target_link_libraries(curvefit_c_lowess_example curvefit m)
126-
127-
# Nonlinear Regression Example
128-
add_executable(curvefit_c_nlreg_example examples/curvefit_c_nlreg_example.c)
129-
target_link_libraries(curvefit_c_nlreg_example curvefit)
139+
# Build the examples
140+
add_subdirectory(examples)
130141
endif()
131142

132143
# ------------------------------------------------------------------------------
133144
# TESTS
134145
# ------------------------------------------------------------------------------
135-
option(BUILD_CURVEFIT_TESTS "Build CURVEFIT tests?" ON)
146+
option(BUILD_CURVEFIT_TESTS "Build CURVEFIT tests?" OFF)
136147
if (BUILD_CURVEFIT_TESTS)
137-
set(curvefit_test_sources tests/curvefit_test.f90
138-
tests/curvefit_test_interp.f90 tests/curvefit_test_statistics.f90
139-
src/external/nonlin/src/external/linalg/tests/test_core.f90
140-
tests/curvefit_test_regression.f90 tests/curvefit_test_calibration.f90)
141-
add_executable(curvefit_test ${curvefit_test_sources})
142-
target_link_libraries(curvefit_test curvefit)
143-
add_custom_command(OUTPUT curvefit_tests DEPENDS ${curvefit_test_sources}
144-
COMMAND curvefit_test)
145-
add_custom_target(run_curvefit_tests ALL DEPENDS curvefit_tests)
146-
endif()
148+
# Inform the user we're building the tests
149+
message(STATUS "Building CURVEFIT tests.")
147150

148-
# C Test
149-
option(BUILD_CURVEFIT_C_TESTS "Build CURVEFIT C API tests?" ON)
150-
if (BUILD_CURVEFIT_C_TESTS)
151-
include_directories(${PROJECT_SOURCE_DIR}/include
152-
${PROJECT_SOURCE_DIR}/src/external/nonlin/include
153-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/include
154-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/src/external/ferror/include
155-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/tests)
156-
set(curvefit_c_test_sources tests/curvefit_c_test.c
157-
${PROJECT_SOURCE_DIR}/src/external/nonlin/src/external/linalg/tests/c_test_core.c)
158-
add_executable(curvefit_c_test ${curvefit_c_test_sources})
159-
target_link_libraries(curvefit_c_test curvefit m)
160-
add_custom_command(OUTPUT curvefit_c_tests_cmd
161-
DEPENDS ${curvefit_c_test_sources}
162-
COMMAND curvefit_c_test)
163-
add_custom_target(run_curvefit_c_tests ALL DEPENDS curvefit_c_tests_cmd)
151+
# Build the tests
152+
add_subdirectory(tests)
164153
endif()

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ program example
167167
output = [0.0d0, 0.55983d0, 1.11975d0, 1.67982d0, 2.24005d0, &
168168
2.80039d0, 2.24023d0, 1.68021d0, 1.12026d0, 0.56021d0, 0.00006d0]
169169
applied_copy = applied
170-
171-
! Determine a suitable calibration gain (the least squares routine modifies
170+
171+
! Determine a suitable calibration gain (the least squares routine modifies
172172
! applied; hence, the need for the copy)
173173
gain = linear_least_squares(output, applied_copy)
174174
@@ -207,7 +207,7 @@ For visualization purposes, here is an error plot from the data in the above exa
207207
This library can be built using CMake. For instructions on using CMake see [Running CMake](https://cmake.org/runningcmake/).
208208

209209
## Documentation
210-
Documentation can be found [here](doc/refman.pdf)
210+
Documentation can be found [here](http://htmlpreview.github.io/?https://github.com/jchristopherson/curvefit/blob/master/doc/html/index.html).
211211

212212
## External Libraries
213213
This library relies upon 3 other libraries.

curvefitConfig.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/curvefitTargets.cmake")

doc/Doxyfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Doxyfile 1.8.11
1+
# Doxyfile 1.8.13
22

33
# This file describes the settings to be used by the documentation system
44
# doxygen (www.doxygen.org) for a project.
@@ -303,6 +303,15 @@ EXTENSION_MAPPING =
303303

304304
MARKDOWN_SUPPORT = YES
305305

306+
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
307+
# to that level are automatically included in the table of contents, even if
308+
# they do not have an id attribute.
309+
# Note: This feature currently applies only to Markdown headings.
310+
# Minimum value: 0, maximum value: 99, default value: 0.
311+
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
312+
313+
TOC_INCLUDE_HEADINGS = 0
314+
306315
# When enabled doxygen tries to link words that correspond to documented
307316
# classes, or namespaces to their corresponding documentation. Such a link can
308317
# be prevented in individual cases by putting a % sign in front of the word or
@@ -803,8 +812,8 @@ INPUT_ENCODING = UTF-8
803812
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
804813
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
805814
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
806-
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
807-
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
815+
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
816+
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
808817

809818
FILE_PATTERNS = *.c \
810819
*.cc \
@@ -916,7 +925,7 @@ EXAMPLE_RECURSIVE = NO
916925
# that contain images that are to be included in the documentation (see the
917926
# \image command).
918927

919-
IMAGE_PATH =
928+
IMAGE_PATH = ../images
920929

921930
# The INPUT_FILTER tag can be used to specify a program that doxygen should
922931
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -2204,7 +2213,7 @@ HIDE_UNDOC_RELATIONS = YES
22042213
# set to NO
22052214
# The default value is: YES.
22062215

2207-
HAVE_DOT = YES
2216+
HAVE_DOT = NO
22082217

22092218
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
22102219
# to run in parallel. When set to 0 doxygen will base this on the number of
@@ -2413,6 +2422,11 @@ DIAFILE_DIRS =
24132422

24142423
PLANTUML_JAR_PATH =
24152424

2425+
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
2426+
# configuration file for plantuml.
2427+
2428+
PLANTUML_CFG_FILE =
2429+
24162430
# When using plantuml, the specified paths are searched for files specified by
24172431
# the !include statement in a plantuml block.
24182432

0 commit comments

Comments
 (0)