-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
1060 lines (871 loc) · 35.5 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ---------------------------------------------------------------
# $Revision: 4517 $
# $Date: 2015-07-29 16:16:53 -0700 (Wed, 29 Jul 2015) $
# ---------------------------------------------------------------
# Programmer: Radu Serban @ LLNL
# ---------------------------------------------------------------
# LLNS Copyright Start
# Copyright (c) 2014, Lawrence Livermore National Security
# This work was performed under the auspices of the U.S. Department
# of Energy by Lawrence Livermore National Laboratory in part under
# Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344.
# Produced at the Lawrence Livermore National Laboratory.
# All rights reserved.
# For details, see the LICENSE file.
# LLNS Copyright End
# ---------------------------------------------------------------
# Top level CMakeLists.txt for SUNDIALS (for cmake build system)
# -------------------------------------------------------------
# Initial commands
# -------------------------------------------------------------
# Require a fairly recent cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1)
# Set CMake policy to allow examples to build
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# Project SUNDIALS (initially only C supported)
PROJECT(sundials C)
# Set some variables with info on the SUNDIALS project
SET(PACKAGE_BUGREPORT "woodward6@llnl.gov")
SET(PACKAGE_NAME "SUNDIALS")
SET(PACKAGE_STRING "SUNDIALS 2.6.2")
SET(PACKAGE_TARNAME "sundials")
SET(PACKAGE_VERSION "2.6.2")
#
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Prohibit in-source build
IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
MESSAGE(FATAL_ERROR "In-source build prohibited.")
ENDIF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
# Hide/show some cache variables
MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
MARK_AS_ADVANCED(CLEAR
CMAKE_C_COMPILER
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEB)
# Specify the VERSION and SOVERSION for shared libraries
SET(arkodelib_VERSION "1.0.0")
SET(arkodelib_SOVERSION "1")
SET(cvodelib_VERSION "1.0.0")
SET(cvodelib_SOVERSION "1")
SET(cvodeslib_VERSION "2.0.0")
SET(cvodeslib_SOVERSION "2")
SET(idalib_VERSION "2.0.0")
SET(idalib_SOVERSION "2")
SET(idaslib_VERSION "0.0.0")
SET(idaslib_SOVERSION "0")
SET(kinsollib_VERSION "1.0.0")
SET(kinsollib_SOVERSION "1")
SET(cpodeslib_VERSION "0.0.0")
SET(cpodeslib_SOVERSION "0")
SET(nveclib_VERSION "0.0.2")
SET(nveclib_SOVERSION "0")
# Specify the location of additional CMAKE modules
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/config)
# -------------------------------------------------------------
# MACRO definitions
# -------------------------------------------------------------
# Macros to hide/show cached variables.
# These two macros can be used to "hide" or "show" in the
# list of cached variables various variables and/or options
# that depend on other options.
# Note that once a variable is modified, it will preserve its
# value (hidding it merely makes it internal)
MACRO(HIDE_VARIABLE var)
IF(DEFINED ${var})
SET(${var} "${${var}}" CACHE INTERNAL "")
ENDIF(DEFINED ${var})
ENDMACRO(HIDE_VARIABLE)
MACRO(SHOW_VARIABLE var type doc default)
IF(DEFINED ${var})
SET(${var} "${${var}}" CACHE "${type}" "${doc}" FORCE)
ELSE(DEFINED ${var})
SET(${var} "${default}" CACHE "${type}" "${doc}")
ENDIF(DEFINED ${var})
ENDMACRO(SHOW_VARIABLE)
# Macros to append a common suffix or prefix to the elements of a list
MACRO(ADD_SUFFIX rootlist suffix)
SET(outlist )
FOREACH(root ${${rootlist}})
LIST(APPEND outlist ${root}${suffix})
ENDFOREACH(root)
SET(${rootlist} ${outlist})
ENDMACRO(ADD_SUFFIX)
MACRO(ADD_PREFIX prefix rootlist)
SET(outlist )
FOREACH(root ${${rootlist}})
LIST(APPEND outlist ${prefix}${root})
ENDFOREACH(root)
SET(${rootlist} ${outlist})
ENDMACRO(ADD_PREFIX)
# Macro to print warning that some features will be disabled
# due to some failure.
MACRO(PRINT_WARNING message action)
MESSAGE("WARNING: ${message}.\n ${action}.")
ENDMACRO(PRINT_WARNING)
# Returns an unquoted string. Note that CMake will readily turn such
# strings back into lists, due to the duality of lists and
# semicolon-separated strings. So be careful how you use it.
MACRO(LIST2STRING alist astring)
FOREACH(elem ${${alist}})
SET(${astring} "${${astring}} ${elem}")
ENDFOREACH(elem)
ENDMACRO(LIST2STRING)
# -------------------------------------------------------------
# Which modules to build?
# -------------------------------------------------------------
# For each SUNDIALS solver available (i.e. for which we have the
# sources), give the user the option of enabling/disabling it.
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/arkode")
OPTION(BUILD_ARKODE "Build the ARKODE library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/arkode")
SET(BUILD_ARKODE OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/arkode")
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvode")
OPTION(BUILD_CVODE "Build the CVODE library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvode")
SET(BUILD_CVODE OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvode")
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvodes")
OPTION(BUILD_CVODES "Build the CVODES library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvodes")
SET(BUILD_CVODES OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cvodes")
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/ida")
OPTION(BUILD_IDA "Build the IDA library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/ida")
SET(BUILD_IDA OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/ida")
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/idas")
OPTION(BUILD_IDAS "Build the IDAS library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/idas")
SET(BUILD_IDAS OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/idas")
IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/kinsol")
OPTION(BUILD_KINSOL "Build the KINSOL library" ON)
ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/kinsol")
SET(BUILD_KINSOL OFF)
ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/kinsol")
# CPODES is alway OFF for now. (commented out for Release); ToDo: better way to do this?
#IF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cpodes")
# OPTION(BUILD_CPODES "Build the CPODES library" OFF)
#ELSE(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cpodes")
# SET(BUILD_CPODES OFF)
#ENDIF(IS_DIRECTORY "${sundials_SOURCE_DIR}/src/cpodes")
# -------------------------------------------------------------
# Other configuration options
# -------------------------------------------------------------
# Option that allows users to build static and/or shared libraries
# ----------------------------------------------------------------
OPTION(BUILD_STATIC_LIBS "Build static libraries" ON)
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
# Prepare substitution variable SUNDIALS_EXPORT for sundials_config.h
# When building shared SUNDIALS libraries under Windows, use
# #define SUNDIALS_EXPORT __declspec(dllexport)
# When linking to shared SUNDIALS libraries under Windows, use
# #define SUNDIALS_EXPORT __declspec(dllimport)
# In all other cases (other platforms or static libraries
# under Windows), the SUNDIALS_EXPORT macro is empty
IF(BUILD_SHARED_LIBS AND WIN32)
SET(SUNDIALS_EXPORT
"#ifdef BUILD_SUNDIALS_LIBRARY
#define SUNDIALS_EXPORT __declspec(dllexport)
#else
#define SUNDIALS_EXPORT __declspec(dllimport)
#endif")
ELSE(BUILD_SHARED_LIBS AND WIN32)
SET(SUNDIALS_EXPORT "#define SUNDIALS_EXPORT")
ENDIF(BUILD_SHARED_LIBS AND WIN32)
# Make sure we build at least one type of libraries
IF(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
PRINT_WARNING("Both static and shared library generation were disabled"
"Building static libraries was re-enabled")
SET(BUILD_STATIC_LIBS ON CACHE BOOL "Build static libraries" FORCE)
ENDIF(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
# Option to specify precision
# ---------------------------
SET(SUNDIALS_PRECISION "double" CACHE STRING "double, single or extended")
# prepare substitution variable PRECISION_LEVEL for sundials_config.h
STRING(TOUPPER ${SUNDIALS_PRECISION} SUNDIALS_PRECISION)
SET(PRECISION_LEVEL "#define SUNDIALS_${SUNDIALS_PRECISION}_PRECISION 1")
# Option to use the generic math libraries (UNIX only)
# ----------------------------------------------------
IF(UNIX)
OPTION(USE_GENERIC_MATH "Use generic (std-c) math libraries" ON)
IF(USE_GENERIC_MATH)
# executables will be linked against -lm
SET(EXTRA_LINK_LIBS -lm)
# prepare substitution variable for sundials_config.h
SET(SUNDIALS_USE_GENERIC_MATH TRUE)
ENDIF(USE_GENERIC_MATH)
ENDIF(UNIX)
## clock-monotonic, see if we need to link with rt
include(CheckSymbolExists)
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES rt)
CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" SUNDIALS_POSIX_TIMERS)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
if(SUNDIALS_POSIX_TIMERS)
find_library(SUNDIALS_RT_LIBRARY NAMES rt)
mark_as_advanced(SUNDIALS_RT_LIBRARY)
if(SUNDIALS_RT_LIBRARY)
# sundials_config.h symbol
SET(SUNDIALS_HAVE_POSIX_TIMERS TRUE)
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${SUNDIALS_RT_LIBRARY})
endif()
endif()
# -------------------------------------------------------------
# Enable Fortran support?
# -------------------------------------------------------------
# FCMIX support is an option only if at least one solver that
# provides such an interface is built.
IF(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA OR BUILD_KINSOL)
SHOW_VARIABLE(FCMIX_ENABLE BOOL "Enable Fortran-C support" OFF)
ELSE(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA OR BUILD_KINSOL)
HIDE_VARIABLE(FCMIX_ENABLE)
ENDIF(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA OR BUILD_KINSOL)
# -------------------------------------------------------------
# Enable Fortran90 support?
# -------------------------------------------------------------
# F90 support is an option only if ARKode is built and
# examples are enabled
IF(BUILD_ARKODE AND EXAMPLES_ENABLE AND FCMIX_ENABLE)
SHOW_VARIABLE(F90_ENABLE BOOL "Enable Fortran90 ARKode examples" OFF)
ELSE(BUILD_ARKODE AND EXAMPLES_ENABLE AND FCMIX_ENABLE)
# set back to OFF (in case was ON)
SET(F90_ENABLE OFF)
HIDE_VARIABLE(F90_ENABLE AND FCMIX_ENABLE)
ENDIF(BUILD_ARKODE AND EXAMPLES_ENABLE AND FCMIX_ENABLE)
# -------------------------------------------------------------
# Enable C++ support?
# -------------------------------------------------------------
# C++ support is an option only if ARKode is built and
# examples are enabled
IF(BUILD_ARKODE AND EXAMPLES_ENABLE)
SHOW_VARIABLE(CXX_ENABLE BOOL "Enable C++ ARKode examples" OFF)
ELSE(BUILD_ARKODE AND EXAMPLES_ENABLE)
HIDE_VARIABLE(CXX_ENABLE)
ENDIF(BUILD_ARKODE AND EXAMPLES_ENABLE)
# -------------------------------------------------------------
# Enable BLAS/LAPACK support?
# -------------------------------------------------------------
OPTION(LAPACK_ENABLE "Enable Lapack support" OFF)
IF(NOT LAPACK_ENABLE)
HIDE_VARIABLE(SUNDIALS_F77_FUNC_CASE)
HIDE_VARIABLE(SUNDIALS_F77_FUNC_UNDERSCORES)
HIDE_VARIABLE(LAPACK_LIBRARIES)
ENDIF(NOT LAPACK_ENABLE)
# -------------------------------------------------------------
# Enable SUPERLUMT support?
# -------------------------------------------------------------
OPTION(SUPERLUMT_ENABLE "Enable SUPERLUMT support" OFF)
IF(NOT SUPERLUMT_ENABLE)
HIDE_VARIABLE(SUPERLUMT_THREAD_TYPE)
HIDE_VARIABLE(SUPERLUMT_LIBRARY_DIR)
HIDE_VARIABLE(SUPERLUMT_INCLUDE_DIR)
ENDIF(NOT SUPERLUMT_ENABLE)
# -------------------------------------------------------------
# Enable KLU support?
# -------------------------------------------------------------
OPTION(KLU_ENABLE "Enable KLU support" OFF)
IF(NOT KLU_ENABLE)
HIDE_VARIABLE(KLU_LIBRARY_DIR)
HIDE_VARIABLE(KLU_INCLUDE_DIR)
ENDIF(NOT KLU_ENABLE)
# -------------------------------------------------------------
# Enable MPI support?
# -------------------------------------------------------------
OPTION(MPI_ENABLE "Enable MPI support" OFF)
IF(NOT MPI_ENABLE)
HIDE_VARIABLE(MPI_INCLUDE_PATH)
HIDE_VARIABLE(MPI_LIBRARIES)
HIDE_VARIABLE(MPI_EXTRA_LIBRARIES)
HIDE_VARIABLE(MPI_MPICC)
HIDE_VARIABLE(MPI_MPICXX)
HIDE_VARIABLE(MPI_MPIF77)
HIDE_VARIABLE(MPI_MPIF90)
ENDIF(NOT MPI_ENABLE)
# -------------------------------------------------------------
# Enable OpenMP support?
# -------------------------------------------------------------
OPTION(OPENMP_ENABLE "Enable OpenMP support" OFF)
IF(OPENMP_ENABLE)
FIND_PACKAGE(OpenMP)
IF(NOT OPENMP_FOUND)
message(STATUS "Disabling OpenMP support, could not determine compiler flags")
ENDIF(NOT OPENMP_FOUND)
ENDIF(OPENMP_ENABLE)
# -------------------------------------------------------------
# Enable Pthread support?
# -------------------------------------------------------------
OPTION(PTHREAD_ENABLE "Enable Pthreads support" OFF)
IF(PTHREAD_ENABLE)
FIND_PACKAGE(Threads)
IF(CMAKE_USE_PTHREADS_INIT)
message(STATUS "Using Pthreads")
SET(PTHREADS_FOUND TRUE)
# SGS
ELSE()
message(STATUS "Disabling Pthreads support, could not determine compiler flags")
endif()
ENDIF(PTHREAD_ENABLE)
# -------------------------------------------------------------
# Enable examples?
# -------------------------------------------------------------
OPTION(EXAMPLES_ENABLE "Build the SUNDIALS examples" ON)
IF(EXAMPLES_ENABLE)
# If examples are enabled, set different options
# The examples will be linked with the library corresponding to the build type.
# Whenever building shared libraries, use them to link the examples.
IF(BUILD_SHARED_LIBS)
SET(LINK_LIBRARY_TYPE "shared")
ELSE(BUILD_SHARED_LIBS)
SET(LINK_LIBRARY_TYPE "static")
ENDIF(BUILD_SHARED_LIBS)
# Check if example files are to be exported
SHOW_VARIABLE(EXAMPLES_INSTALL BOOL "Install example files" ON)
# If examples are to be exported, check where we should install them.
IF(EXAMPLES_INSTALL)
SHOW_VARIABLE(EXAMPLES_INSTALL_PATH STRING
"Output directory for installing example files" "${CMAKE_INSTALL_PREFIX}/examples")
IF(NOT EXAMPLES_INSTALL_PATH)
PRINT_WARNING("The example installation path is empty"
"Example installation path was reset to its default value")
SET(EXAMPLES_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/examples" CACHE STRING
"Output directory for installing example files" FORCE)
ENDIF(NOT EXAMPLES_INSTALL_PATH)
ELSE(EXAMPLES_INSTALL)
HIDE_VARIABLE(EXAMPLES_INSTALL_PATH)
ENDIF(EXAMPLES_INSTALL)
ELSE(EXAMPLES_ENABLE)
# If examples are disabled, hide all options related to
# building and installing the SUNDIALS examples
HIDE_VARIABLE(EXAMPLES_INSTALL)
HIDE_VARIABLE(EXAMPLES_INSTALL_PATH)
ENDIF(EXAMPLES_ENABLE)
# -------------------------------------------------------------
# Add any other necessary compiler flags & definitions
# -------------------------------------------------------------
# Under Windows, add compiler directive to inhibit warnings
# about use of unsecure functions
IF(WIN32)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ENDIF(WIN32)
IF(APPLE)
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup")
ENDIF(APPLE)
# -------------------------------------------------------------
# A Fortran compiler is needed if:
# (a) FCMIX is enabled
# (b) LAPACK is enabled (for the name-mangling scheme)
# -------------------------------------------------------------
IF(FCMIX_ENABLE OR LAPACK_ENABLE)
INCLUDE(SundialsFortran)
IF(NOT F77_FOUND AND FCMIX_ENABLE)
PRINT_WARNING("Fortran compiler not functional"
"FCMIX support will not be provided")
ENDIF(NOT F77_FOUND AND FCMIX_ENABLE)
ENDIF(FCMIX_ENABLE OR LAPACK_ENABLE)
# -------------------------------------------------------------
# A Fortran90 compiler is needed if:
# (a) F90 is enabled, and
# (b) ARKODE examples are enabled
# -------------------------------------------------------------
IF(F90_ENABLE AND BUILD_ARKODE)
INCLUDE(SundialsFortran90)
IF(NOT F90_FOUND AND F90_ENABLE)
PRINT_WARNING("Fortran90 compiler not functional"
"F90 support will not be provided")
ENDIF(NOT F90_FOUND AND F90_ENABLE)
ENDIF(F90_ENABLE AND BUILD_ARKODE)
# -------------------------------------------------------------
# A C++ compiler is needed if:
# (a) C++ is enabled, and
# (b) ARKODE examples are enabled
# -------------------------------------------------------------
IF(CXX_ENABLE AND BUILD_ARKODE)
INCLUDE(SundialsCXX)
IF(NOT CXX_FOUND AND CXX_ENABLE)
PRINT_WARNING("C++ compiler not functional"
"C++ support will not be provided")
ENDIF(NOT CXX_FOUND AND CXX_ENABLE)
ENDIF(CXX_ENABLE AND BUILD_ARKODE)
# -------------------------------------------------------------
# Check if we need an alternate way of specifying the Fortran
# name-mangling scheme if we were unable to infer it using a
# compiler.
# Ask the user to specify the case and number of appended underscores
# corresponding to the Fortran name-mangling scheme of symbol names
# that do not themselves contain underscores (recall that this is all
# we really need for the interfaces to LAPACK).
# Note: the default scheme is lower case - one underscore
# -------------------------------------------------------------
IF(LAPACK_ENABLE AND NOT F77SCHEME_FOUND)
# Specify the case for the Fortran name-mangling scheme
SHOW_VARIABLE(SUNDIALS_F77_FUNC_CASE STRING
"case of Fortran function names (lower/upper)"
"lower")
# Specify the number of appended underscores for the Fortran name-mangling scheme
SHOW_VARIABLE(SUNDIALS_F77_FUNC_UNDERSCORES STRING
"number of underscores appended to Fortran function names"
"one")
# Based on the given case and number of underscores,
# set the C preprocessor macro definition
IF(${SUNDIALS_F77_FUNC_CASE} MATCHES "lower")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "none")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "mysub")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "none")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "one")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "mysub_")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "one")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "two")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "mysub__")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "two")
ELSE(${SUNDIALS_F77_FUNC_CASE} MATCHES "lower")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "none")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "MYSUB")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "none")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "one")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "MYSUB_")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "one")
IF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "two")
SET(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "MYSUB__")
ENDIF(${SUNDIALS_F77_FUNC_UNDERSCORES} MATCHES "two")
ENDIF(${SUNDIALS_F77_FUNC_CASE} MATCHES "lower")
# Since the SUNDIALS codes never use symbol names containing
# underscores, set a default scheme (probably wrong) for symbols
# with underscores.
SET(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES "my_sub_")
# We now "have" a scheme.
SET(F77SCHEME_FOUND TRUE)
ENDIF(LAPACK_ENABLE AND NOT F77SCHEME_FOUND)
# -------------------------------------------------------------
# If we have a name-mangling scheme (either automatically
# inferred or provided by the user), set the SUNDIALS
# compiler preprocessor macro definitions.
# -------------------------------------------------------------
SET(F77_MANGLE_MACRO1 "")
SET(F77_MANGLE_MACRO2 "")
IF(F77SCHEME_FOUND)
# Symbols WITHOUT underscores
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## _")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## __")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## _")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__")
SET(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## __")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__")
# Symbols with underscores
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub_")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## _")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub_")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub__")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## __")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "my_sub__")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB_")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## _")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB_")
IF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB__")
SET(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## __")
ENDIF(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MY_SUB__")
ENDIF(F77SCHEME_FOUND)
# -------------------------------------------------------------
# Find (and test) the Lapack libraries
# -------------------------------------------------------------
# If LAPACK is needed, first try to find the appropriate
# libraries and linker flags needed to link against them.
IF(LAPACK_ENABLE)
# find BLAS and LAPACK Libraries
INCLUDE(SundialsLapack)
SHOW_VARIABLE(LAPACK_LIBRARIES STRING "Blas and Lapack libraries" "${LAPACK_LIBRARIES}")
IF(LAPACK_LIBRARIES AND NOT LAPACK_FOUND)
PRINT_WARNING("LAPACK not functional"
"Blas/Lapack support will not be provided")
ELSE(LAPACK_LIBRARIES AND NOT LAPACK_FOUND)
#set sundials_config.h symbol via sundials_config.in
SET(SUNDIALS_BLAS_LAPACK TRUE)
ENDIF(LAPACK_LIBRARIES AND NOT LAPACK_FOUND)
ELSE(LAPACK_ENABLE)
HIDE_VARIABLE(LAPACK_LIBRARIES)
ENDIF(LAPACK_ENABLE)
# -------------------------------------------------------------
# Find (and test) the SUPERLUMT libraries
# -------------------------------------------------------------
# If SUPERLUMT is needed, first try to find the appropriate
# libraries to link against them.
IF(SUPERLUMT_ENABLE)
# get thread type for SUPERLUMT (OpenMP or Pthreads(default))
SET(SUPERLUMT_THREAD_TYPE "Pthread" CACHE STRING "OpenMP or Pthread (leave blank for no threading)")
SHOW_VARIABLE(SUPERLUMT_THREAD_TYPE STRING "SUPERLUMT threading type: OpenMP or Pthread (blank for no threading)" "${SUPERLUMT_THREAD_TYPE}")
SHOW_VARIABLE(SUPERLUMT_INCLUDE_DIR STRING "SUPERLUMT include directory" "${SUPERLUMT_INCLUDE_DIR}")
SHOW_VARIABLE(SUPERLUMT_LIBRARY_DIR STRING "SUPERLUMT library directory" "${SUPERLUMT_LIBRARY_DIR}")
INCLUDE(SundialsSuperLUMT)
IF(SUPERLUMT_FOUND)
# sundials_config.h symbol
SET(SUNDIALS_SUPERLUMT TRUE)
ENDIF(SUPERLUMT_FOUND)
IF(SUPERLUMT_LIBRARIES AND NOT SUPERLUMT_FOUND)
PRINT_WARNING("SUPERLUMT not functional - support will not be provided"
"Double check spelling specified libraries (search is case sensitive)")
ENDIF(SUPERLUMT_LIBRARIES AND NOT SUPERLUMT_FOUND)
ELSE(SUPERLUMT_ENABLE)
HIDE_VARIABLE(SUPERLUMT_THREAD_TYPE)
HIDE_VARIABLE(SUPERLUMT_INCLUDE_DIR)
HIDE_VARIABLE(SUPERLUMT_LIBRARY_DIR)
ENDIF(SUPERLUMT_ENABLE)
# -------------------------------------------------------------
# Find (and test) the KLU libraries
# -------------------------------------------------------------
# If KLU is requested, first try to find the appropriate libraries to
# link against them.
IF(KLU_ENABLE)
SHOW_VARIABLE(KLU_INCLUDE_DIR STRING "KLU include directory"
"${KLU_INCLUDE_DIR}")
SHOW_VARIABLE(KLU_LIBRARY_DIR STRING
"Klu library directory" "${KLU_LIBRARY_DIR}")
INCLUDE(SundialsKLU)
IF(KLU_FOUND)
# sundials_config.h symbol
SET(SUNDIALS_KLU TRUE)
INCLUDE_DIRECTORIES(${KLU_INCLUDE_DIR})
ENDIF(KLU_FOUND)
IF(KLU_LIBRARIES AND NOT KLU_FOUND)
PRINT_WARNING("KLU not functional - support will not be provided"
"Double check spelling specified libraries (search is case sensitive)")
ENDIF(KLU_LIBRARIES AND NOT KLU_FOUND)
ENDIF(KLU_ENABLE)
# -------------------------------------------------------------
# Decide how to compile MPI codes.
# -------------------------------------------------------------
IF(MPI_ENABLE)
# get run command for mpi (openmpi or OpenMP or Pthreads(default))
SET(MPI_RUN_COMMAND "mpirun" CACHE STRING "mpirun or srun")
SHOW_VARIABLE(MPI_RUN_COMMAND STRING "MPI run command: mpirun or srun" "${MPI_RUN_COMMAND}")
INCLUDE(SundialsMPIC)
IF(NOT MPIC_FOUND)
PRINT_WARNING("MPI not functional"
"Parallel support will not be provided")
ENDIF(NOT MPIC_FOUND)
IF(MPIC_MPI2)
SET(F77_MPI_COMM_F2C "#define SUNDIALS_MPI_COMM_F2C 1")
ELSE(MPIC_MPI2)
SET(F77_MPI_COMM_F2C "#define SUNDIALS_MPI_COMM_F2C 0")
ENDIF(MPIC_MPI2)
IF(MPIC_FOUND AND FCMIX_ENABLE)
INCLUDE(SundialsMPIF)
ENDIF(MPIC_FOUND AND FCMIX_ENABLE)
IF(MPIC_FOUND AND CXX_ENABLE)
INCLUDE(SundialsMPICXX)
ENDIF(MPIC_FOUND AND CXX_ENABLE)
IF(MPIC_FOUND AND F90_ENABLE)
INCLUDE(SundialsMPIF90)
ENDIF(MPIC_FOUND AND F90_ENABLE)
ENDIF(MPI_ENABLE)
# -------------------------------------------------------------
# If using MPI with C++, disable C++ extensions (for known wrappers)
# -------------------------------------------------------------
# IF(MPICXX_FOUND)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -DLAM_BUILDING")
# ENDIF(MPICXX_FOUND)
# -------------------------------------------------------------
# Configure the header file sundials_config.h
# -------------------------------------------------------------
# All required substitution variables should be available at this point.
# Generate the header file and place it in the binary dir.
CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/include/sundials/sundials_config.in
${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h
)
# Add the include directory in the source tree and the one in
# the binary tree (for the header file sundials_config.h)
IF(SUPERLUMT_FOUND)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${SUPERLUMT_INCLUDE_DIR})
ELSE(SUPERLUMT_FOUND)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include)
ENDIF(SUPERLUMT_FOUND)
# -------------------------------------------------------------
# Add selected modules to the build system
# -------------------------------------------------------------
# Shared components
ADD_SUBDIRECTORY(src/sundials)
ADD_SUBDIRECTORY(src/nvec_ser)
IF(MPIC_FOUND)
ADD_SUBDIRECTORY(src/nvec_par)
ENDIF(MPIC_FOUND)
IF(OPENMP_FOUND)
ADD_SUBDIRECTORY(src/nvec_openmp)
ENDIF(OPENMP_FOUND)
IF(PTHREADS_FOUND)
ADD_SUBDIRECTORY(src/nvec_pthreads)
ENDIF(PTHREADS_FOUND)
# ARKODE library
IF(BUILD_ARKODE)
ADD_SUBDIRECTORY(src/arkode)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(src/arkode/fcmix)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
ENDIF(BUILD_ARKODE)
# CVODE library
IF(BUILD_CVODE)
ADD_SUBDIRECTORY(src/cvode)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(src/cvode/fcmix)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
ENDIF(BUILD_CVODE)
# CVODES library
IF(BUILD_CVODES)
ADD_SUBDIRECTORY(src/cvodes)
ENDIF(BUILD_CVODES)
# IDA library
IF(BUILD_IDA)
ADD_SUBDIRECTORY(src/ida)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(src/ida/fcmix)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
ENDIF(BUILD_IDA)
# IDAS library
IF(BUILD_IDAS)
ADD_SUBDIRECTORY(src/idas)
ENDIF(BUILD_IDAS)
# KINSOL library
IF(BUILD_KINSOL)
ADD_SUBDIRECTORY(src/kinsol)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(src/kinsol/fcmix)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
ENDIF(BUILD_KINSOL)
# CPODES library
IF(BUILD_CPODES)
ADD_SUBDIRECTORY(src/cpodes)
ENDIF(BUILD_CPODES)
# -------------------------------------------------------------
# Include the subdirectories corresponding to various examples
# -------------------------------------------------------------
# If building and installing the examples is enabled, include
# the subdirectories for those examples that will be built.
# Also, if we will generate exported example Makefiles, set
# variables needed in generating them from templates.
# For now, TestRunner is not being distributed.
# So:
# - Don't show TESTRUNNER variable
# - Don't enable testing if TestRunner if not found.
# - There will be no 'make test' target
INCLUDE(SundialsAddTest)
HIDE_VARIABLE(TESTRUNNER)
IF(EXAMPLES_ENABLE)
IF(TESTRUNNER)
ENABLE_TESTING()
ENDIF(TESTRUNNER)
IF(EXAMPLES_INSTALL)
SET(SHELL "sh")
SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(exec_prefix "${CMAKE_INSTALL_PREFIX}")
SET(includedir "${prefix}/include")
SET(libdir "${exec_prefix}/lib")
SET(CPP "${CMAKE_C_COMPILER}")
SET(CC "${CMAKE_C_COMPILER}")
SET(CPPFLAGS "${CMAKE_C_FLAGS_RELEASE}")
SET(CFLAGS "${CMAKE_C_FLAGS_RELEASE}")
SET(LDFLAGS "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
LIST2STRING(EXTRA_LINK_LIBS LIBS)
IF(CXX_FOUND)
SET(CXX "${CMAKE_CXX_COMPILER}")
SET(CXX_LNKR "${CMAKE_CXX_COMPILER}")
SET(CXXFLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
SET(CXX_LDFLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
LIST2STRING(EXTRA_LINK_LIBS CXX_LIBS)
ENDIF(CXX_FOUND)
IF(F77_FOUND)
SET(F77 "${CMAKE_Fortran_COMPILER}")
SET(F77_LNKR "${CMAKE_Fortran_COMPILER}")
SET(FFLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
SET(F77_LDFLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
LIST2STRING(EXTRA_LINK_LIBS F77_LIBS)
ENDIF(F77_FOUND)
IF(F90_FOUND)
SET(F90 "${CMAKE_Fortran_COMPILER}")
SET(F90_LNKR "${CMAKE_Fortran_COMPILER}")
SET(F90FLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
SET(F90_LDFLAGS "${CMAKE_Fortran_FLAGS_RELEASE}")
LIST2STRING(EXTRA_LINK_LIBS F90_LIBS)
ENDIF(F90_FOUND)
IF(SUPERLUMT_FOUND)
LIST2STRING(SUPERLUMT_LIBRARIES SUPERLUMT_LIBS)
SET(SUPERLUMT_LIBS "${SUPERLUMT_LINKER_FLAGS} ${SUPERLUMT_LIBS}")
ENDIF(SUPERLUMT_FOUND)
IF(LAPACK_FOUND)
LIST2STRING(LAPACK_LIBRARIES BLAS_LAPACK_LIBS)
ENDIF(LAPACK_FOUND)
IF(MPIC_FOUND)
IF(MPI_MPICC)
SET(MPICC "${MPI_MPICC}")
SET(MPI_INC_DIR ".")
SET(MPI_LIB_DIR ".")
SET(MPI_LIBS "")
SET(MPI_FLAGS "")
ELSE(MPI_MPICC)
SET(MPICC "${CMAKE_C_COMPILER}")
SET(MPI_INC_DIR "${MPI_INCLUDE_PATH}")
SET(MPI_LIB_DIR ".")
LIST2STRING(MPI_LIBRARIES MPI_LIBS)
ENDIF(MPI_MPICC)
ENDIF(MPIC_FOUND)
IF(MPICXX_FOUND)
IF(MPI_MPICXX)
SET(MPICXX "${MPI_MPICXX}")
ELSE(MPI_MPICXX)
SET(MPICXX "${CMAKE_CXX_COMPILER}")
LIST2STRING(MPI_LIBRARIES MPI_LIBS)
ENDIF(MPI_MPICXX)
ENDIF(MPICXX_FOUND)
IF(MPIF_FOUND)
IF(MPI_MPIF77)
SET(MPIF77 "${MPI_MPIF77}")
SET(MPIF77_LNKR "${MPI_MPIF77}")
ELSE(MPI_MPIF77)
SET(MPIF77 "${CMAKE_Fortran_COMPILER}")
SET(MPIF77_LNKR "${CMAKE_Fortran_COMPILER}")
SET(MPI_INC_DIR "${MPI_INCLUDE_PATH}")
SET(MPI_LIB_DIR ".")
LIST2STRING(MPI_LIBRARIES MPI_LIBS)
ENDIF(MPI_MPIF77)
ENDIF(MPIF_FOUND)
IF(MPIF90_FOUND)
IF(MPI_MPIF90)
SET(MPIF90 "${MPI_MPIF90}")
SET(MPIF90_LNKR "${MPI_MPIF90}")
ELSE(MPI_MPIF90)
SET(MPIF90 "${CMAKE_Fortran_COMPILER}")
SET(MPIF90_LNKR "${CMAKE_Fortran_COMPILER}")
LIST2STRING(MPI_LIBRARIES MPI_LIBS)
ENDIF(MPI_MPIF90)
ENDIF(MPIF90_FOUND)
ENDIF(EXAMPLES_INSTALL)
IF(BUILD_ARKODE)
ADD_SUBDIRECTORY(examples/arkode/C_serial)
IF(OPENMP_FOUND)
ADD_SUBDIRECTORY(examples/arkode/C_openmp)
ENDIF(OPENMP_FOUND)
IF(CXX_ENABLE AND CXX_FOUND)
ADD_SUBDIRECTORY(examples/arkode/CXX_serial)
ENDIF(CXX_ENABLE AND CXX_FOUND)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(examples/arkode/F77_serial)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
IF(F90_ENABLE AND F90_FOUND)
ADD_SUBDIRECTORY(examples/arkode/F90_serial)
ENDIF(F90_ENABLE AND F90_FOUND)
IF(MPIC_FOUND)
ADD_SUBDIRECTORY(examples/arkode/C_parallel)
ENDIF(MPIC_FOUND)
IF(MPICXX_FOUND)
ADD_SUBDIRECTORY(examples/arkode/CXX_parallel)
ENDIF(MPICXX_FOUND)
IF(MPIF_FOUND)
ADD_SUBDIRECTORY(examples/arkode/F77_parallel)
ENDIF(MPIF_FOUND)
IF(MPIF90_FOUND)
ADD_SUBDIRECTORY(examples/arkode/F90_parallel)
ENDIF(MPIF90_FOUND)
ENDIF(BUILD_ARKODE)
IF(BUILD_CVODE)
ADD_SUBDIRECTORY(examples/cvode/serial)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(examples/cvode/fcmix_serial)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
IF(MPIC_FOUND)
ADD_SUBDIRECTORY(examples/cvode/parallel)
ENDIF(MPIC_FOUND)
IF(MPIF_FOUND)
ADD_SUBDIRECTORY(examples/cvode/fcmix_parallel)
ENDIF(MPIF_FOUND)
ENDIF(BUILD_CVODE)
IF(BUILD_CVODES)
ADD_SUBDIRECTORY(examples/cvodes/serial)
IF(MPIC_FOUND)
ADD_SUBDIRECTORY(examples/cvodes/parallel)
ENDIF(MPIC_FOUND)
ENDIF(BUILD_CVODES)
IF(BUILD_IDA)
ADD_SUBDIRECTORY(examples/ida/serial)
IF(FCMIX_ENABLE AND F77_FOUND)
ADD_SUBDIRECTORY(examples/ida/fcmix_serial)
IF(OPENMP_FOUND)
ADD_SUBDIRECTORY(examples/ida/fcmix_openmp)
ENDIF(OPENMP_FOUND)
IF(PTHREADS_FOUND)
ADD_SUBDIRECTORY(examples/ida/fcmix_pthreads)
ENDIF(PTHREADS_FOUND)
ENDIF(FCMIX_ENABLE AND F77_FOUND)
IF(MPIC_FOUND)
ADD_SUBDIRECTORY(examples/ida/parallel)