New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
23-build-omp.t in vendors/FCM-2017.10.0/t/fcm-make – NEMO

source: vendors/FCM-2017.10.0/t/fcm-make/23-build-omp.t @ 11668

Last change on this file since 11668 was 10672, checked in by nicolasmartin, 5 years ago

Reimport latest FCM release

File size: 3.5 KB
Line 
1#!/bin/bash
2#-------------------------------------------------------------------------------
3# (C) British Crown Copyright 2006-17 Met Office.
4#
5# This file is part of FCM, tools for managing and building source code.
6#
7# FCM is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# FCM is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with FCM. If not, see <http://www.gnu.org/licenses/>.
19#-------------------------------------------------------------------------------
20# Tests "fcm make", build detects dependencies in OMP sentinels.
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24tests 16
25cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/* .
26yes 6.0 | head -n 100 >"$TEST_KEY_BASE.exe.on.out"
27yes 1.0 | head -n 100 >"$TEST_KEY_BASE.exe.off.out"
28#-------------------------------------------------------------------------------
29TEST_KEY=$TEST_KEY_BASE-on # fc.flag-omp on in new mode
30run_pass "$TEST_KEY" fcm make
31grep ' !\$' fcm-make.log | sort >"$TEST_KEY.log.deps"
32sort >"${TEST_KEY}.log.deps.expected" <<'__LOG__'
33[info]              -> (  include) !$i1.f90
34[info]              -> (  include) !$i2.f90
35[info]              -> ( f.module) !$m1
36[info]              -> ( f.module) !$m2
37__LOG__
38file_cmp "${TEST_KEY}.log.deps" \
39    "${TEST_KEY}.log.deps" "${TEST_KEY}.log.deps.expected"
40run_pass "$TEST_KEY.exe" $PWD/build/bin/p1.exe
41file_cmp "$TEST_KEY.exe.out" "$TEST_KEY_BASE.exe.on.out" "$TEST_KEY.exe.out"
42#-------------------------------------------------------------------------------
43TEST_KEY=$TEST_KEY_BASE-on-off # fc.flag-omp on->off in incremental mode
44echo 'build.prop{fc.flag-omp}=' >>fcm-make.cfg
45run_pass "$TEST_KEY" fcm make
46run_pass "$TEST_KEY.exe" $PWD/build/bin/p1.exe
47file_cmp "$TEST_KEY.exe.out" "$TEST_KEY_BASE.exe.off.out" "$TEST_KEY.exe.out"
48#-------------------------------------------------------------------------------
49TEST_KEY=$TEST_KEY_BASE-on-off-on # fc.flag-omp on->off->on in incremental mode
50echo 'build.prop{fc.flag-omp}=-fopenmp' >>fcm-make.cfg
51run_pass "$TEST_KEY" fcm make
52run_pass "$TEST_KEY.exe" $PWD/build/bin/p1.exe
53file_cmp "$TEST_KEY.exe.out" "$TEST_KEY_BASE.exe.on.out" "$TEST_KEY.exe.out"
54#-------------------------------------------------------------------------------
55TEST_KEY=$TEST_KEY_BASE-off # fc.flag-omp off in new mode
56cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/fcm-make.cfg .
57echo 'build.prop{fc.flag-omp}=' >>fcm-make.cfg
58run_pass "$TEST_KEY" fcm make --new
59run_pass "$TEST_KEY.exe" $PWD/build/bin/p1.exe
60file_cmp "$TEST_KEY.exe.out" "$TEST_KEY_BASE.exe.off.out" "$TEST_KEY.exe.out"
61#-------------------------------------------------------------------------------
62TEST_KEY=$TEST_KEY_BASE-off-on # fc.flag-omp off->on in incremental mode
63cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/fcm-make.cfg .
64run_pass "$TEST_KEY" fcm make
65run_pass "$TEST_KEY.exe" $PWD/build/bin/p1.exe
66file_cmp "$TEST_KEY.exe.out" "$TEST_KEY_BASE.exe.on.out" "$TEST_KEY.exe.out"
67#-------------------------------------------------------------------------------
68exit
Note: See TracBrowser for help on using the repository browser.