Skip to content

Commit

Permalink
Merge pull request #4 from jchristopherson/Development-v1.4.0
Browse files Browse the repository at this point in the history
Development v1.4.0
  • Loading branch information
jchristopherson authored Apr 1, 2020
2 parents b269dd5 + 1e826f8 commit 3714305
Show file tree
Hide file tree
Showing 318 changed files with 18,592 additions and 2,303 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ Makefile
cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake

# VS Code Stuff
launch.json
settings.json
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,64 @@ before_install:
- sudo apt-get update -qq

install:
# Install gfortran
- sudo apt-get install -qq gfortran-7
- sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 90

# Install git
- sudo apt install git

# Use the default version of CMake to build a newer version
- sudo apt install cmake

# Download and install a newer version of CMake
- sudo git clone https://github.com/Kitware/CMake.git
- pushd CMake
- sudo mkdir build
- pushd build
- sudo cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/CMake ..
- sudo cmake
- sudo make
- sudo make install
- popd
- popd

# Download and install LAPACK
- sudo git clone https://github.com/Reference-LAPACK/lapack.git
- pushd lapack
- sudo mkdir build
- pushd build
- sudo cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/lapack ..
- sudo cmake
- sudo make
- sudo make install
- popd
- popd

# Download and install FERROR
- sudo git clone https://github.com/jchristopherson/ferror.git
- pushd ferror
- sudo mkdir build
- pushd build
- sudo cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/ferror ..
- sudo cmake
- sudo make
- sudo make install
- popd
- popd

# Download and install LINALG
- sudo git clone https://github.com/jchristopherson/linalg.git
- pushd linalg
- sudo mkdir build
- pushd build
- sudo cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/linalg ..
- sudo cmake
- sudo make
- sudo make install
- popd
- popd

before_script:
- mkdir build
- cd build
Expand Down
66 changes: 26 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,26 @@
# Master CMAKE Build Script
cmake_minimum_required(VERSION 3.7)
project(nonlin Fortran)
project(nonlin C CXX Fortran)

# Define version information
set(NONLIN_MAJOR_VERSION 1)
set(NONLIN_MINOR_VERSION 3)
set(NONLIN_MINOR_VERSION 4)
set(NONLIN_PATCH_VERSION 0)
set(NONLIN_VERSION ${NONLIN_MAJOR_VERSION}.${NONLIN_MINOR_VERSION}.${NONLIN_PATCH_VERSION})

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()

# By default, shared library
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

# Locate Dependencies
find_package(ferror 1.3.0)
find_package(linalg 1.5.0)

# If FERROR is not installed on the system, build the default implementation
if (${ferror_FOUND})
message(STATUS "An acceptable version of FERROR (v" ${ferror_VERSION} ") was found, and will be utilized.")
set(FERROR_LIBRARIES ferror)
get_target_property(ferror_LibLocation ferror LOCATION)
endif()

# If LINALG is not installed on the system, build the default implementation
if (${linalg_FOUND})
message(STATUS "An acceptable version of LINALG (v" ${linalg_VERSION} ") was found, and will be utilized.")
set(LINALG_LIBRARIES linalg)
get_target_property(linalg_LibLocation linalg LOCATION)
else()
message(STATUS "LINALG not found. The default implementation will be used.")
add_subdirectory(src/external/linalg)
set(linalg_INCLUDE_DIRS src/external/linalg/include)
set(LINALG_LIBRARIES linalg)
set(linalg_LibLocation ${linalg_BINARY_DIR})
include_directories(src/external/linalg/src/external/ferror/include)
endif()

# Include the dependency module files
include_directories(${linalg_INCLUDE_DIRS} ${ferror_INCLUDE_DIRS})
# Get compiler info
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

# Export all symbols on Windows when building shared libraries
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Expand Down Expand Up @@ -92,13 +67,10 @@ if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
endif()
endif()

# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# gfortran
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall -Wno-c-binding-type")
set(CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -Wl,--allow-multiple-definition")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -Wall -Wno-c-binding-type -Wl,--allow-multiple-definition")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort (untested)
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")
Expand All @@ -107,9 +79,23 @@ else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("No optimized Fortran compiler flags are known, we just try -O2...")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -Wall")
endif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2 -Wl,--allow-multiple-definition")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -Wall -Wl,--allow-multiple-definition")
endif ()

# Locate Dependencies
find_package(ferror 1.3.0)
find_package(linalg 1.6.0)

if (ferror_FOUND)
message(STATUS "FERROR library found.")
set(ferror_LIBRARIES ferror)
endif()

if (linalg_FOUND)
message(STATUS "LINALG library found.")
set(linalg_LIBRARIES linalg)
endif()

# Locate the source directory
add_subdirectory(src)
Expand Down
Loading

0 comments on commit 3714305

Please sign in to comment.