From 15aeac75752eb5a3665e0e668443633b25cf9e86 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 05:54:52 -0600 Subject: [PATCH 1/9] fix shared library build --- .github/workflows/Linux_options.yml | 2 +- src/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 9458bbdd..49a6c41c 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -20,7 +20,7 @@ jobs: CC: gcc-11 strategy: matrix: - options: [-DBUILD_D=OFF, -DBUILD_4=OFF, '-D-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF'] + options: [-DBUILD_D=OFF, -DBUILD_4=OFF, '-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF'] steps: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aeced74f..33628557 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,8 +48,10 @@ endif() # This is the C source code. set(c_src summary.c) - add_library(c_obj_lib OBJECT ${c_src}) +if(BUILD_SHARED_LIBS) + set_property(TARGET c_obj_lib PROPERTY POSITION_INDEPENDENT_CODE 1) +endif() # We buld a _4 and a _d by default. foreach(kind ${kinds}) From 5b2ed75af45997a4d4eba1413a6da5a42100fbc7 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 05:57:42 -0600 Subject: [PATCH 2/9] fix shared library build --- .github/workflows/Linux_options.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 49a6c41c..a80cdf2c 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -80,10 +80,11 @@ jobs: cd w3emc mkdir build cd build - cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} .. + cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} -DCMAKE_INSTALL_PREFIX="~/w3emc/install" .. make -j2 VERBOSE=1 - name: test-w3emc run: | cd w3emc/build ctest --output-on-failure --rerun-failed --verbose + make install From b0f310a7d29085a1930f466c176da4c76c7350e0 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 09:55:02 -0600 Subject: [PATCH 3/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index a80cdf2c..465ff2ec 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -36,14 +36,20 @@ jobs: uses: actions/cache@v2 with: path: ~/bacio - key: bacio-Linux_options_${{ runner.os }}-v2.5.0 + key: bacio-Linux_options_${{ runner.os }}-v2.5.0-${{ matrix.options }} - name: build-bacio if: steps.cache-bacio.outputs.cache-hit != 'true' run: | cd bacio mkdir build && cd build - cmake -DCMAKE_INSTALL_PREFIX=~/bacio .. + if [ ${{ matrix.options }} = '-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF' ] + then + cmake -DCMAKE_INSTALL_PREFIX=~/bacio -DBUILD_SHARED_LIBS=ON .. + else + cmake -DCMAKE_INSTALL_PREFIX=~/bacio .. + fi + make -j2 VERBOSE=1 make install @@ -59,14 +65,19 @@ jobs: uses: actions/cache@v2 with: path: ~/bufr - key: bufr-Linux_options_${{ runner.os }}-v11.7.1 + key: bufr-Linux_options_${{ runner.os }}-v11.7.1-${{ matrix.options }} - name: build-bufr if: steps.cache-bufr.outputs.cache-hit != 'true' run: | cd bufr mkdir build && cd build - cmake -DCMAKE_INSTALL_PREFIX=~/bufr .. + if [ ${{ matrix.options }} = '-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF' ] + then + cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_SHARED_LIBS=ON .. + else + cmake -DCMAKE_INSTALL_PREFIX=~/bufr .. + fi make -j2 VERBOSE=1 make install @@ -80,11 +91,10 @@ jobs: cd w3emc mkdir build cd build - cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} -DCMAKE_INSTALL_PREFIX="~/w3emc/install" .. + cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} -DBUILD_SHARED_LIBS=ON .. make -j2 VERBOSE=1 - name: test-w3emc run: | cd w3emc/build ctest --output-on-failure --rerun-failed --verbose - make install From 75e95c70c0091c86dd549f37e2ef141ddb58a2c4 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:02:29 -0600 Subject: [PATCH 4/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 465ff2ec..3dc019ed 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -91,7 +91,7 @@ jobs: cd w3emc mkdir build cd build - cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} -DBUILD_SHARED_LIBS=ON .. + cmake -DCMAKE_PREFIX_PATH="~/bacio;~/bufr" ${{ matrix.options }} .. make -j2 VERBOSE=1 - name: test-w3emc From 0bd819e330641eb7e27af22e86879dc5a61b169c Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:07:50 -0600 Subject: [PATCH 5/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 3dc019ed..5222885f 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -70,9 +70,10 @@ jobs: - name: build-bufr if: steps.cache-bufr.outputs.cache-hit != 'true' run: | + set -x cd bufr mkdir build && cd build - if [ ${{ matrix.options }} = '-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF' ] + if [ ${{ matrix.options }} = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] then cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_SHARED_LIBS=ON .. else @@ -88,6 +89,7 @@ jobs: - name: build-w3emc run: | + set -x cd w3emc mkdir build cd build From 7abf0f11c67f88fee37c9ef879a1b1bd7219fbd4 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:08:18 -0600 Subject: [PATCH 6/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 5222885f..bedd5a02 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -73,7 +73,7 @@ jobs: set -x cd bufr mkdir build && cd build - if [ ${{ matrix.options }} = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] + if [ "${{ matrix.options }}" = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] then cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_SHARED_LIBS=ON .. else From 847d6bfe6812f58582b88c52794474d6998ec12b Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:12:48 -0600 Subject: [PATCH 7/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index bedd5a02..7b905127 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -43,7 +43,7 @@ jobs: run: | cd bacio mkdir build && cd build - if [ ${{ matrix.options }} = '-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF' ] + if [ "${{ matrix.options }}" = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] then cmake -DCMAKE_INSTALL_PREFIX=~/bacio -DBUILD_SHARED_LIBS=ON .. else @@ -75,9 +75,9 @@ jobs: mkdir build && cd build if [ "${{ matrix.options }}" = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] then - cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_SHARED_LIBS=ON .. + cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON .. else - cmake -DCMAKE_INSTALL_PREFIX=~/bufr .. + cmake -DCMAKE_INSTALL_PREFIX=~/bufr -DBUILD_TESTING=OFF .. fi make -j2 VERBOSE=1 make install From 651a81ba661fea1639ac1bb9fabf90e1115417ff Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:18:36 -0600 Subject: [PATCH 8/9] fixing shared libraries in workflow --- .github/workflows/Linux_options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index 7b905127..bc1d7592 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -41,6 +41,7 @@ jobs: - name: build-bacio if: steps.cache-bacio.outputs.cache-hit != 'true' run: | + set -x cd bacio mkdir build && cd build if [ "${{ matrix.options }}" = "-DBUILD_SHARED_LIBS=ON -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=OFF" ] @@ -49,7 +50,6 @@ jobs: else cmake -DCMAKE_INSTALL_PREFIX=~/bacio .. fi - make -j2 VERBOSE=1 make install From 1f5ef7cd61bb8baa200e05081bb39840792018e1 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Tue, 26 Sep 2023 10:26:05 -0600 Subject: [PATCH 9/9] fixed bacio version number in CI build --- .github/workflows/Linux_options.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Linux_options.yml b/.github/workflows/Linux_options.yml index bc1d7592..dfa83f94 100644 --- a/.github/workflows/Linux_options.yml +++ b/.github/workflows/Linux_options.yml @@ -29,7 +29,7 @@ jobs: with: repository: NOAA-EMC/NCEPLIBS-bacio path: bacio - ref: v2.5.0 + ref: v2.6.0 - name: cache-bacio id: cache-bacio