new test for lapack added, all fc tests fixed for PGI Fortran
This commit is contained in:
parent
f7b1b854aa
commit
7d192205aa
@ -1,6 +1,6 @@
|
||||
language: cpp
|
||||
install:
|
||||
- sudo apt-get install g++ cmake gfortran libblas-dev
|
||||
- sudo apt-get install g++ cmake gfortran libblas-dev liblapack-dev
|
||||
- sudo pip install pytest pep8
|
||||
script:
|
||||
- pep8 --ignore=E501 update.py
|
||||
|
@ -1 +1,5 @@
|
||||
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
|
||||
# remove -rdynamic flag offensive to PGI Fortran
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
|
||||
endif()
|
||||
add_executable(example example.f90 module.f90)
|
||||
|
@ -1,4 +1,10 @@
|
||||
if(BLAS_FOUND)
|
||||
|
||||
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
|
||||
# remove -rdynamic flag offensive to PGI Fortran
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
|
||||
endif()
|
||||
|
||||
add_executable(example example.f90)
|
||||
target_link_libraries(example ${MATH_LIBS})
|
||||
else()
|
||||
|
20
test/fc_lapack/cmake/autocmake.cfg
Normal file
20
test/fc_lapack/cmake/autocmake.cfg
Normal file
@ -0,0 +1,20 @@
|
||||
[project]
|
||||
name: example
|
||||
|
||||
[fc]
|
||||
source: ../../../modules/fc.cmake
|
||||
|
||||
[static]
|
||||
source: ../../../modules/static_linking.cmake
|
||||
|
||||
[int64]
|
||||
source: ../../../modules/int64.cmake
|
||||
|
||||
[math_libs]
|
||||
source: ../../../modules/math_libs.cmake
|
||||
|
||||
[default_build_paths]
|
||||
source: ../../../modules/default_build_paths.cmake
|
||||
|
||||
[src]
|
||||
source: ../../../modules/src.cmake
|
10
test/fc_lapack/src/CMakeLists.txt
Normal file
10
test/fc_lapack/src/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
if(LAPACK_FOUND)
|
||||
if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
|
||||
# remove -rdynamic flag offensive for PGI Fortran
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
|
||||
endif()
|
||||
add_executable(example example.F90)
|
||||
target_link_libraries(example ${MATH_LIBS})
|
||||
else()
|
||||
message(FATAL_ERROR "LAPACK/BLAS libraries not found for the test fc_lapack!")
|
||||
endif()
|
24
test/fc_lapack/src/example.F90
Normal file
24
test/fc_lapack/src/example.F90
Normal file
@ -0,0 +1,24 @@
|
||||
program example
|
||||
implicit none
|
||||
integer, parameter :: n = 3
|
||||
integer :: info
|
||||
real(8) :: a(n, n)
|
||||
real(8) :: b(n)
|
||||
integer :: ipiv(n)
|
||||
logical :: roots_ok=.false.
|
||||
|
||||
data a /2,1,3,2,6,8,6,8,18/
|
||||
data b /1,3,5/
|
||||
|
||||
call dgesv( n, 1, a, n, ipiv, b, n , info )
|
||||
if (info.gt.0) stop "error in dgesv routine !"
|
||||
|
||||
! roots are -0.5, 0.25, 0.25
|
||||
roots_ok=dabs(b(1)+0.5).le.1d-12.and.dabs(b(2)-0.25).le.1d-12.and.dabs(b(3)-0.25).le.1d-12
|
||||
|
||||
if (roots_ok) then
|
||||
print *, 'dgesv test ok'
|
||||
else
|
||||
stop 'dgesv test failed!'
|
||||
endif
|
||||
end program
|
12
test/test.py
12
test/test.py
@ -137,7 +137,17 @@ def test_fc():
|
||||
|
||||
def test_fc_blas():
|
||||
if sys.platform != 'win32':
|
||||
stdout, stderr = configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran --blas=auto')
|
||||
stdout, stderr = configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran')
|
||||
assert 'dgemm test ok' in stdout
|
||||
else:
|
||||
pass
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_fc_lapack():
|
||||
if sys.platform != 'win32':
|
||||
stdout, stderr = configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran')
|
||||
assert 'dgesv test ok' in stdout
|
||||
else:
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user