Skip to content

Commit

Permalink
[BUG FIX] TravisCI : try to get cmake OK for ILP64.
Browse files Browse the repository at this point in the history
  • Loading branch information
fghoussen committed Feb 16, 2020
1 parent 71343a0 commit dfee7a2
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 43 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ jobs:
git status && \
git log -2 && \
mkdir build && cd build && \
BLAS_LIBRARIES='-I/usr/include/mkl -Wl,--no-as-needed -lmkl_sequential -lmkl_core -lpthread -lm -ldl -lmkl_gf_ilp64' \
LAPACK_LIBRARIES='-I/usr/include/mkl -Wl,--no-as-needed -lmkl_sequential -lmkl_core -lpthread -lm -ldl -lmkl_gf_ilp64' \
cmake -DEXAMPLES=ON -DICB=ON -DPYTHON2=ON .. && \
CMAKE_BUILD_TYPE='Debug' CMAKE_Fortran_FLAGS_DEBUG='-O0 -g' CMAKE_C_FLAGS_DEBUG='-O0 -g' CMAKE_CXX_FLAGS_DEBUG='-O0 -g' \
BLA_VENDOR='Intel10_64ilp' cmake -D INTERFACE64=ON -D EXAMPLES=ON -D ICB=ON -D PYTHON2=ON .. && \
export VERBOSE=1 && \
make all && \
apt-get -y install gdb && \
gdb ./TESTS/icb_arpack_cpp -ex 'r' -ex 'bt' -ex 'q' && \
make test && \
tail -n 300 ./Testing/Temporary/LastTest.log" \
&& \
Expand Down
11 changes: 5 additions & 6 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ arpack-ng - 3.7.0
* arpackmm: utility to test arpack with matrix market files.
* ICB: add ILP64 support.
The idea is:
- cmake generates arpackdef.h from arpackdef.cmake.h.in
- autoheader generates arpackdef.h from arpackdef.autotools.h[.in]
- arpack includes arpackdef.h when/where needed:
- #define provide c_int/a_int according to architecture.
- all f90 who need to include "arpackdef.h" must be moved to F90.
Note: by convention, F90 are preprocessed (f90 are not).
- cmake generates arpackdef.h from arpackdef.h.in
- autoheader generates arpackdef.h from arpackdef.h.in
- using arpackdef.h:
- in C/C++ files: arpackdef.h defines c_int/a_int according to architecture.
- in f90/F90 files: arpackdef.h must NOT be included (as it may need C header).
- MPI does not support ILP64: integer*4 must be imposed in all
calls involving MPI (f90 example/test code).
To enable ILP64 users to compile/link, arpackdef.h is added in
Expand Down
1 change: 0 additions & 1 deletion ICB/debug_icb.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ subroutine debug_c(logfil_c, ndigit_c, mgetv0_c,
bind(c, name="debug_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: logfil_c, ndigit_c, mgetv0_c
integer(kind=c_int), value, intent(in) :: msaupd_c, msaup2_c, msaitr_c, mseigt_c, msapps_c, msgets_c, mseupd_c
integer(kind=c_int), value, intent(in) :: mnaupd_c, mnaup2_c, mnaitr_c, mneigh_c, mnapps_c, mngets_c, mneupd_c
Expand Down
1 change: 0 additions & 1 deletion ICB/stat_icb.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ subroutine stat_c( nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c,
bind(c, name="stat_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(out) :: nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c
real(kind=c_float), intent(out) :: tsaupd_c, tsaup2_c, tsaitr_c, tseigt_c, tsgets_c, tsapps_c, tsconv_c,&
tnaupd_c, tnaup2_c, tnaitr_c, tneigh_c, tngets_c, tnapps_c, tnconv_c,&
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpcn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pcnaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -34,7 +33,6 @@ subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bind(c, name="pcneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpdn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine pdnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pdnaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -34,7 +33,6 @@ subroutine pdneupd_c(comm, rvec, howmny, select, &
bind(c, name="pdneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine pdsaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pdsaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine pdseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
bind(c, name="pdseupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpsn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine psnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="psnaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -34,7 +33,6 @@ subroutine psneupd_c(comm, rvec, howmny, select, &
bind(c, name="psneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpss.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine pssaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pssaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine psseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
bind(c, name="psseupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions PARPACK/SRC/MPI/icbpzn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="pznaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
Expand Down Expand Up @@ -34,7 +33,6 @@ subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bind(c, name="pzneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbacn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine cnaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="cnaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine cneupd_c(rvec, howmny, select, d, z, ldz, sigma, workev, &
bind(c, name="cneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbadn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine dnaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="dnaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine dneupd_c(rvec, howmny, select, &
bind(c, name="dneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbads.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine dsaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="dsaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand All @@ -32,7 +31,6 @@ subroutine dseupd_c(rvec, howmny, select, d, z, ldz, sigma, &
bind(c, name="dseupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbasn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine snaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="snaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine sneupd_c(rvec, howmny, select, &
bind(c, name="sneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbass.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine ssaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="ssaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand All @@ -32,7 +31,6 @@ subroutine sseupd_c(rvec, howmny, select, d, z, ldz, sigma, &
bind(c, name="sseupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
2 changes: 0 additions & 2 deletions SRC/icbazn.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ subroutine znaupd_c(ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
bind(c, name="znaupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
Expand Down Expand Up @@ -33,7 +32,6 @@ subroutine zneupd_c(rvec, howmny, select, d, z, ldz, sigma, workev, &
bind(c, name="zneupd_c")
use :: iso_c_binding
implicit none
#include "arpackdef.h"
integer(kind=c_int), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
integer(kind=c_int), dimension(ncv), intent(in) :: select
Expand Down
20 changes: 12 additions & 8 deletions TESTS/icb_arpack_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ void real_symmetric_runner(double const & tol_check) {
a_int const N = 1000;
a_int const nev = 9;

a_int const ncv = 2 * nev + 1;
a_int ncv = 2 * nev + 1;
ncv *= 3; /*ease CV: increase space dimension*/

a_int const ldv = N;

a_int const ldz = N + 1;
Expand Down Expand Up @@ -73,9 +75,9 @@ void real_symmetric_runner(double const & tol_check) {
}

// check number of ev found by arpack.
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/ || info != 0) {
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/) {
std::cout << "ERROR: iparam[4] " << iparam[4] << ", nev " << nev << ", info " << info << std::endl;
throw std::domain_error("Error inside ARPACK routines");
throw std::domain_error("real_symmetric_runner - Error: inside ARPACK routines");
}

std::vector<a_int> select(ncv);
Expand All @@ -92,7 +94,7 @@ void real_symmetric_runner(double const & tol_check) {

/*eigen value order: smallest -> biggest*/
if (std::abs(d[i] - static_cast<Real>(1000 - (nev - 1) + i)) > tol_check) {
throw std::domain_error("Correct eigenvalues not computed");
throw std::domain_error("real_symmetric_runner - Correct eigenvalues not computed");
}
}
std::cout << "------\n";
Expand All @@ -111,7 +113,9 @@ void complex_symmetric_runner(double const & tol_check) {
a_int const N = 1000;
a_int const nev = 9;

a_int const ncv = 2 * nev + 1;
a_int ncv = 2 * nev + 1;
ncv *= 3; /*ease CV: increase space dimension*/

a_int const ldv = N;

a_int const ldz = N + 1;
Expand Down Expand Up @@ -154,9 +158,9 @@ void complex_symmetric_runner(double const & tol_check) {
}

// check number of ev found by arpack.
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/ || info != 0) {
if (iparam[4] < nev /*arpack may succeed to compute more EV than expected*/) {
std::cout << "ERROR: iparam[4] " << iparam[4] << ", nev " << nev << ", info " << info << std::endl;
throw std::domain_error("Error inside ARPACK routines");
throw std::domain_error("complex_symmetric_runner - Error: inside ARPACK routines");
}

std::vector<a_int> select(ncv);
Expand All @@ -174,7 +178,7 @@ void complex_symmetric_runner(double const & tol_check) {
/*eigen value order: smallest -> biggest*/
if (std::abs(std::real(d[i]) - static_cast<Real>(1000 - (nev - 1) + i)) > tol_check ||
std::abs(std::imag(d[i]) - static_cast<Real>(1000 - (nev - 1) + i)) > tol_check) {
throw std::domain_error("Correct eigenvalues not computed");
throw std::domain_error("complex_symmetric_runner - Correct eigenvalues not computed");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions arpackdef.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define INTERFACE64 @INTERFACE64@

#if INTERFACE64
#include <stdint.h> // Include this header for int64_t, uint64_t definition.
#define c_int c_int64_t
#define a_int int64_t
#define a_uint uint64_t
Expand Down

0 comments on commit dfee7a2

Please sign in to comment.