Skip to content

Commit

Permalink
Merge pull request #6 from jchristopherson/Development-v1.6.0
Browse files Browse the repository at this point in the history
Development v1.6.0
  • Loading branch information
jchristopherson authored Mar 22, 2020
2 parents eb76a6e + 3f1fe37 commit 786a74d
Show file tree
Hide file tree
Showing 338 changed files with 39,522 additions and 2,340 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "src/external/ferror"]
path = src/external/ferror
url = https://github.com/jchristopherson/ferror.git
[submodule "src/external/lapack"]
path = src/external/lapack
url = https://github.com/Reference-LAPACK/lapack.git
24 changes: 23 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,29 @@ before_install:
install:
- sudo apt-get install -qq gfortran-7
- sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-7 90

- sudo apt install git
- sudo apt install cmake
- 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
- 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

before_script:
- mkdir build
- cd build
Expand Down
70 changes: 30 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,24 @@ project(linalg C CXX Fortran)

# Define version information
set(linalg_VERSION_MAJOR 1)
set(linalg_VERSION_MINOR 5)
set(linalg_VERSION_MINOR 6)
set(linalg_VERSION_PATCH 0)
set(linalg_VERSION ${linalg_VERSION_MAJOR}.${linalg_VERSION_MINOR}.${linalg_VERSION_PATCH})

# 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)

# Get compiler info
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

# Locate Dependencies
find_package(ferror 1.3.0)

# If FERROR is not installed on the system, build the default implementation
if (NOT ${ferror_FOUND})
if (NOT TARGET ferror)
message(STATUS "FERROR not found. The default implementation will be used.")
add_subdirectory(src/external/ferror)
set(ferror_INCLUDE_DIRS src/external/ferror/include)
include_directories(${ferror_INCLUDE_DIRS})
set(FERROR_LIBRARIES ferror)
set(ferror_LibLocation ${ferror_BINARY_DIR})
else()
include_directories(${ferror_INCLUDE_DIRS})
set(FERROR_LIBRARIES ferror)
set(ferror_LibLocation ${ferror_BINARY_DIR})
endif()
else()
message(STATUS "An acceptable version of FERROR (v" ${ferror_VERSION} ") was found, and will be utilized.")
include_directories(${ferror_INCLUDE_DIRS})
set(FERROR_LIBRARIES ferror)
get_target_property(ferror_LibLocation ferror LOCATION)
endif()

# Export all symbols on Windows when building shared libraries
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

Expand Down Expand Up @@ -102,8 +78,8 @@ endif()
# FFLAGS depend on the compiler
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 @@ -112,26 +88,40 @@ 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")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -Wl,--allow-multiple-definition")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -Wall -Wl,--allow-multiple-definition")
endif()

# What else to build
option(BUILD_LINALG_EXAMPLES "Build LINALG examples?" OFF)
option(BUILD_LINALG_TESTS "Build LINALG tests?" OFF)

# Locate the dependencies
find_package(BLAS)
find_package(LAPACK)
find_package(ferror 1.3.0)

if (BLAS_FOUND)
message(STATUS "BLAS library found.")
endif()

if (LAPACK_FOUND)
message(STATUS "LAPACK library found.")
endif()

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

# Locate the files
add_subdirectory(src)

# ------------------------------------------------------------------------------
# EXAMPLES
# ------------------------------------------------------------------------------
option(BUILD_LINALG_EXAMPLES "Build LINALG examples?" OFF)
if (BUILD_LINALG_EXAMPLES)
message(STATUS "Building LINALG examples.")
add_subdirectory(examples)
endif()

# ------------------------------------------------------------------------------
# TESTS
# ------------------------------------------------------------------------------
option(BUILD_LINALG_TESTS "Build LINALG tests?" OFF)
if (BUILD_LINALG_TESTS)
message(STATUS "Building LINALG tests.")
add_subdirectory(tests)
Expand Down
Loading

0 comments on commit 786a74d

Please sign in to comment.