Skip to content

Commit fed768f

Browse files
authored
Update CI (#252)
- GitHub actions: Fix Environment Variables See https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ - Linker language for Cray
1 parent c590561 commit fed768f

File tree

4 files changed

+17
-46
lines changed

4 files changed

+17
-46
lines changed

Diff for: .github/workflows/CI.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
- name: Set defaults
2828
run: |
2929
export GCC_VERSION=$(echo ${{ matrix.compiler }} | cut -d'-' -f2)
30-
echo "::set-env name=FC::gfortran-${GCC_VERSION}"
31-
echo "::set-env name=TEST_FORTRAN::OFF" # default will be overwritten in the next step
30+
echo "FC=gfortran-${GCC_VERSION}" >> $GITHUB_ENV
31+
echo "TEST_FORTRAN=OFF" >> $GITHUB_ENV # default will be overwritten in the next step
3232
- name: Enable Fortran
3333
if: startsWith(matrix.compiler, 'gcc')
34-
run: echo "::set-env name=TEST_FORTRAN::ON"
34+
run: echo "TEST_FORTRAN=ON" >> $GITHUB_ENV
3535
- name: Install python modules
3636
run: pip3 install --user nose numpy
3737
- name: Cache pFUnit
@@ -62,11 +62,11 @@ jobs:
6262
message("::set-output name=timestamp::${current_date}")
6363
- name: Set ccache environment
6464
run: |
65-
echo "::set-env name=CCACHE_MAXSIZE::400M"
66-
echo "::set-env name=CCACHE_BASEDIR::$GITHUB_WORKSPACE"
67-
echo "::set-env name=CCACHE_DIR::$GITHUB_WORKSPACE/.ccache"
68-
echo "::set-env name=CCACHE_COMPRESS::true"
69-
echo "::set-env name=CCACHE_COMPRESSLEVEL::6"
65+
echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV
66+
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
67+
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
68+
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
69+
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
7070
- name: ccache cache files
7171
uses: actions/cache@v1
7272
with:

Diff for: examples/fortran/perturbation/CMakeLists.txt

+3-14
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ find_package(Serialbox REQUIRED COMPONENTS Fortran)
3131
#
3232
add_definitions(-DSERIALIZE)
3333

34-
#
35-
# Use the CXX linker with the cray compiler
36-
#
37-
set(example_linker_language "")
38-
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray")
39-
set(example_linker_language CXX)
40-
else()
41-
set(example_linker_language Fortran)
42-
endif()
43-
4434
#
4535
# Here we preprocess all the source files, using the preprocesser script pp_ser.py, and store them
4636
# in ${PROJECT_SOURCE_DIR}/pp.
@@ -58,20 +48,19 @@ target_link_libraries(m_ser Serialbox::SerialboxFortranStatic)
5848
## Producer
5949
add_executable(fortran_producer ${PP_OUTPUT}/main_producer.F90 )
6050
target_link_libraries(fortran_producer m_ser)
61-
set_target_properties(fortran_producer PROPERTIES LINKER_LANGUAGE ${example_linker_language})
51+
set_target_properties(fortran_producer PROPERTIES LINKER_LANGUAGE Fortran)
6252

6353
## Consumer
6454
add_executable(fortran_consumer ${PP_OUTPUT}/main_consumer.F90)
6555
target_link_libraries(fortran_consumer m_ser)
66-
set_target_properties(fortran_consumer PROPERTIES LINKER_LANGUAGE ${example_linker_language})
56+
set_target_properties(fortran_consumer PROPERTIES LINKER_LANGUAGE Fortran)
6757

6858
## Perturbed Consumer
6959
add_executable(fortran_consumer_perturb ${PP_OUTPUT}/main_consumer_perturb.F90)
7060
target_link_libraries(fortran_consumer_perturb m_ser)
71-
set_target_properties(fortran_consumer_perturb PROPERTIES LINKER_LANGUAGE ${example_linker_language})
61+
set_target_properties(fortran_consumer_perturb PROPERTIES LINKER_LANGUAGE Fortran)
7262

7363
#
7464
# Finally, copy our run script to the build directory
7565
#
7666
file(COPY ${PROJECT_SOURCE_DIR}/run.sh DESTINATION ${PROJECT_BINARY_DIR})
77-

Diff for: examples/fortran/perturbation_netcdf/CMakeLists.txt

+3-14
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ endif()
3535
#
3636
add_definitions(-DSERIALIZE)
3737

38-
#
39-
# Use the CXX linker with the cray compiler
40-
#
41-
set(example_linker_language "")
42-
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray")
43-
set(example_linker_language CXX)
44-
else()
45-
set(example_linker_language Fortran)
46-
endif()
47-
4838
#
4939
# Here we preprocess all the source files, using the preprocesser script pp_ser.py, and store them
5040
# in ${PROJECT_SOURCE_DIR}/pp.
@@ -63,20 +53,19 @@ target_link_libraries(m_ser Serialbox::SerialboxFortranStatic)
6353
## Producer
6454
add_executable(fortran_producer_netcdf ${PP_OUTPUT}/main_producer.F90)
6555
target_link_libraries(fortran_producer_netcdf m_ser)
66-
set_target_properties(fortran_producer_netcdf PROPERTIES LINKER_LANGUAGE ${example_linker_language})
56+
set_target_properties(fortran_producer_netcdf PROPERTIES LINKER_LANGUAGE Fortran)
6757

6858
## Consumer
6959
add_executable(fortran_consumer_netcdf ${PP_OUTPUT}/main_consumer.F90)
7060
target_link_libraries(fortran_consumer_netcdf m_ser)
71-
set_target_properties(fortran_consumer_netcdf PROPERTIES LINKER_LANGUAGE ${example_linker_language})
61+
set_target_properties(fortran_consumer_netcdf PROPERTIES LINKER_LANGUAGE Fortran)
7262

7363
## Perturbed Consumer
7464
add_executable(fortran_consumer_perturb_netcdf ${PP_OUTPUT}/main_consumer_perturb.F90)
7565
target_link_libraries(fortran_consumer_perturb_netcdf m_ser)
76-
set_target_properties(fortran_consumer_perturb_netcdf PROPERTIES LINKER_LANGUAGE ${example_linker_language})
66+
set_target_properties(fortran_consumer_perturb_netcdf PROPERTIES LINKER_LANGUAGE Fortran)
7767

7868
#
7969
# Finally, copy our run script to the build directory
8070
#
8171
file(COPY ${PROJECT_SOURCE_DIR}/run.sh DESTINATION ${PROJECT_BINARY_DIR})
82-

Diff for: examples/fortran/simple/CMakeLists.txt

+3-10
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,14 @@ target_link_libraries( simple_m_ser
1414
${CMAKE_THREAD_LIBS_INIT}
1515
)
1616
target_include_directories(simple_m_ser PUBLIC ${PROJECT_BINARY_DIR}/src/serialbox-fortran)
17-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
18-
set_target_properties( simple_m_ser PROPERTIES LINKER_LANGUAGE Fortran)
19-
endif()
17+
set_target_properties( simple_m_ser PROPERTIES LINKER_LANGUAGE Fortran)
2018

2119
add_executable(fortran_producer main_producer.F90)
2220
target_link_libraries(fortran_producer simple_m_ser)
2321
install(TARGETS fortran_producer DESTINATION bin)
24-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
25-
set_target_properties(fortran_producer PROPERTIES LINKER_LANGUAGE Fortran)
26-
endif()
22+
set_target_properties(fortran_producer PROPERTIES LINKER_LANGUAGE Fortran)
2723

2824
add_executable(fortran_consumer main_consumer.F90)
2925
target_link_libraries(fortran_consumer simple_m_ser)
3026
install(TARGETS fortran_consumer DESTINATION bin)
31-
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
32-
set_target_properties(fortran_consumer PROPERTIES LINKER_LANGUAGE Fortran)
33-
endif()
34-
27+
set_target_properties(fortran_consumer PROPERTIES LINKER_LANGUAGE Fortran)

0 commit comments

Comments
 (0)