1 # Copyright 2019 Maciej Woźniak, Wojciech Kosior
\r
3 # This is free and unencumbered software released into the public domain.
\r
5 # Anyone is free to copy, modify, publish, use, compile, sell, or
\r
6 # distribute this software, either in source code form or as a compiled
\r
7 # binary, for any purpose, commercial or non-commercial, and by any
\r
10 # In jurisdictions that recognize copyright laws, the author or authors
\r
11 # of this software dedicate any and all copyright interest in the
\r
12 # software to the public domain. We make this dedication for the benefit
\r
13 # of the public at large and to the detriment of our heirs and
\r
14 # successors. We intend this dedication to be an overt act of
\r
15 # relinquishment in perpetuity of all present and future rights to this
\r
16 # software under copyright law.
\r
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
20 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
\r
21 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
\r
22 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
\r
23 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
\r
24 # OTHER DEALINGS IN THE SOFTWARE.
\r
26 # For more information, please refer to <http://unlicense.org/>
\r
29 cmake_minimum_required(VERSION 3.5)
\r
31 enable_language (Fortran)
\r
34 # Default to Release build
\r
35 if(NOT CMAKE_BUILD_TYPE)
\r
36 message(STATUS "No build type selected, default to Release")
\r
37 set(CMAKE_BUILD_TYPE "Release")
\r
38 # set(CMAKE_BUILD_TYPE "Debug")
\r
43 # FFLAGS depend on the compiler
\r
44 get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
\r
46 if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
\r
47 set(dialect "-std08 -module . -implicitnone -fpp -pedantic")
\r
48 set(bounds " -check bounds")
\r
49 set(realeaseopts "-funroll-all-loops -O2")
\r
50 set(debugopts "-O0 -g -traceback -check all -debug extended -debug-parameters all")
\r
53 if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
\r
54 set(dialect "-ffree-form -std=f2008 -fimplicit-none -cpp -Wall -pedantic")
\r
55 set(bounds " -fbounds-check")
\r
56 set(realeaseopts "-funroll-all-loops -O2")
\r
57 set(debugopts "-O0 -g3 -fbacktrace -fcheck=all -fdump-fortran-optimized")
\r
60 set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}")
\r
61 set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${debugopts}")
\r
62 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}")
\r
63 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_RELEASE_FLAGS} ${realeaseopts}")
\r
65 include_directories("${PROJECT_SOURCE_DIR}/src")
\r
69 ${SRC}/naivemath.F90
\r
70 ${SRC}/bettermath.F90
\r
78 add_executable(mull ${mull_SRC})
\r