Skip to content

Commit 4661170

Browse files
authored
Update SWIG version and other minor cmake changes (#24)
* Fix standalone version script * Add cmake policy to silence warnings and update build script * Regenerate code with SWIG 4.0.2+fortran release * Update travis yaml definitions
1 parent c7c356e commit 4661170

18 files changed

+33
-32
lines changed

.travis.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
dist: bionic
2-
sudo: required # apt-get done in before_install.sh
3-
language: minimal
2+
language: shell
3+
os: linux
44

55
# Only build master or PRs merging into master
66
branches:
77
only:
88
- master
99

1010
# List of configurations to check
11-
matrix:
11+
jobs:
1212
include:
13-
- os: linux
14-
env: FLIBCPP_DEV=ON GENERATOR=ninja
13+
- env: FLIBCPP_DEV=ON GENERATOR=ninja
1514
addons:
1615
apt:
1716
packages:
1817
- python3-sphinx
1918
- valgrind
20-
- os: linux
21-
env: FLIBCPP_DEV=OFF GENERATOR=make
19+
- env: FLIBCPP_DEV=OFF GENERATOR=make
2220
FLIBCPP_FORTRAN_STD=03
2321
GCC_VERSION=8
24-
- os: linux
25-
env: FLIBCPP_DEV=OFF GENERATOR=make
22+
- env: FLIBCPP_DEV=OFF GENERATOR=make
2623
FLIBCPP_FORTRAN_STD=08
2724
GCC_VERSION=9
2825
# Build phases

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/cmake/FlibcppVersion.cmake")
1212
flibcpp_find_version(Flibcpp "${CMAKE_CURRENT_LIST_DIR}/cmake/git-version.txt")
1313

1414
project(Flibcpp VERSION "${Flibcpp_VERSION}" LANGUAGES CXX Fortran)
15+
cmake_policy(VERSION 3.8...3.19)
1516

1617
#---------------------------------------------------------------------------#
1718
# OPTIONS
@@ -34,7 +35,6 @@ option(FLIBCPP_BUILD_TESTS "Build Flibcpp tests" ${_DEFAULT_BUILD_TESTS})
3435
if(FLIBCPP_BUILD_TESTS OR FLIBCPP_BUILD_EXAMPLES)
3536
set(_DEFAULT_BUILD_TESTING ON)
3637
endif()
37-
option(BUILD_TESTING "Enable CTest" ${_DEFAULT_BUILD_TESTING})
3838

3939
#---------------------------------------------------------------------------#
4040
# FLAGS
@@ -102,8 +102,10 @@ if(FLIBCPP_USE_SWIG)
102102
include(UseSWIG)
103103
endif()
104104

105-
# Enable testing based on BUILD_TESTING flag
106-
include(CTest)
105+
# Load CTest if applicable
106+
if(FLIBCPP_BUILD_TESTS OR FLIBCPP_BUILD_EXAMPLES)
107+
include(CTest)
108+
endif()
107109

108110
#---------------------------------------------------------------------------#
109111
# LIBRARY

cmake/FlibcppVersion.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ if(CMAKE_SCRIPT_MODE_FILE)
126126
message(FATAL_ERROR "Run this script with "
127127
"cmake -D GIT_VERSION_FILE=git-version.txt -P FlibcppVersion.cmake")
128128
endif()
129-
flibcpp_find_version(local ${GIT_VERSION_FILE})
129+
flibcpp_find_version(LOCAL ${GIT_VERSION_FILE})
130130
message(STATUS "${LOCAL_VERSION}")
131131
message(STATUS "${LOCAL_VERSION_STRING}")
132132
endif()

scripts/build/vostok.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ cd ${BUILD}
99
CMAKE=cmake
1010
${CMAKE} --version
1111

12+
# NOTE: gcc 10.2 incorrectly warns about logical conversions, see
13+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96319
14+
module load swig/4.0.2-fortran gcc/10
15+
1216
${CMAKE} \
1317
-G Ninja \
1418
-D FLIBCPP_DEV=ON \
15-
-D SWIG_EXECUTABLE="/rnsdhpc/code/_build/swig-debug/swig" \
16-
-D SWIG_DIR="/rnsdhpc/code/swig/Lib" \
1719
-D BUILD_SHARED_LIBS=ON \
18-
-D CMAKE_Fortran_FLAGS="-Wall -Wextra -Wimplicit-procedure -Wimplicit-interface -Wno-compare-reals" \
19-
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic" \
20+
-D CMAKE_Fortran_FLAGS="-Wall -Wextra -pedantic -Wimplicit-procedure -Wimplicit-interface -Wno-compare-reals" \
21+
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
2022
-D CMAKE_INSTALL_PREFIX="${PREFIX}" \
2123
${SOURCE}
2224
ninja -v

src/flc.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flcFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_algorithm.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_algorithmFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_map.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_mapFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_random.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_randomFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_set.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_setFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_string.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_stringFORTRAN_wrap.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make

src/flc_vector.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! This file was automatically generated by SWIG (http://www.swig.org).
2-
! Version 4.0.2
2+
! Version 4.0.2+fortran
33
!
44
! Do not make changes to this file unless you know what you are doing--modify
55
! the SWIG interface file instead.

src/flc_vectorFORTRAN_wrap.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------------
22
* This file was automatically generated by SWIG (http://www.swig.org).
3-
* Version 4.0.2
3+
* Version 4.0.2+fortran
44
*
55
* This file is not intended to be easily readable and contains a number of
66
* coding conventions designed to improve portability and efficiency. Do not make
@@ -604,7 +604,7 @@ typedef struct {
604604
} SwigComplex_double;
605605
}
606606

607-
SwigComplex_double SWIG_create_complex_double(double real, double imag) {
607+
SWIGINTERN SwigComplex_double SWIG_create_complex_double(double real, double imag) {
608608
SwigComplex_double result;
609609
result.real = real;
610610
result.imag = imag;

0 commit comments

Comments
 (0)