From 9d4d94ec73f0cc0afd53b8443d8cb26c2e146ece Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Sun, 29 Aug 2021 17:21:45 +0200 Subject: [PATCH 1/2] Add Continuous Integration for Linux with GitHub Actions --- .github/workflows/ci.yml | 284 ++++++++++++++++++++++++++++++++++++ app/build_linux/Makefile-ui | 10 +- 2 files changed, 289 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e5ea2df --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,284 @@ +name: CI + +on: + push: + pull_request: + +jobs: + build-on-ubuntu1804: + runs-on: ubuntu-18.04 + env: + RUNS_ON: ubuntu1804 + GH_WORKSPACE: /home/runner/work/SolTrace/SolTrace #= $GITHUB_WORKSPACE + steps: + - name: Install OS dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + cmake \ + freeglut3-dev \ + g++ \ + libcurl4-openssl-dev \ + libfontconfig-dev \ + libgl1-mesa-dev \ + libgtk2.0-dev \ + mesa-common-dev \ + unzip + - name: Get GCC version + run: gcc --version + - name: Get libc version + run: ldd --version + + - name: Install wxWidgets + run: | + sudo apt-get install -y libwxgtk*-dev + sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 + wx-config-3 --cflags | grep I + # - name: Clone dependency wxWidgets + # uses: actions/checkout@v2 + # with: + # ref: v3.1.0 + # path: wxWidgets + # repository: wxWidgets/wxWidgets + # - name: Install wxWidgets-3.1.0 + # run: | + # cd wxWidgets + # mkdir release-build + # ./configure --prefix=$PWD/release-build \ + # --enable-shared=no \ + # --enable-stl=yes \ + # --enable-debug=no \ + # --with-gtk=2 \ + # --with-libjpeg=builtin \ + # --with-libpng=builtin \ + # --with-regex=builtin \ + # --with-libtiff=builtin \ + # --with-zlib=builtin \ + # --with-expat=builtin \ + # --without-libjbig \ + # --without-liblzma \ + # --without-gtkprint \ + # --with-libnotify=no \ + # --with-libmspack=no \ + # --with-gnomevfs=no \ + # --with-opengl=yes \ + # --with-sdl=no \ + # --with-cxx=11 + # make -j + # make install + # ls -lha bin/ ############### + # ls bin/ | grep wx-config ############### + # sudo ln -s $(ls bin/ | grep wx-config) /usr/bin/wx-config-3 + # wx-config-3 --cflags ############### + # wx-config-3 --cflags | grep I + # cd $GITHUB_WORKSPACE + + - name: Get git ref of sibling dependency LK + run: | + ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') + echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV + - name: Get cached build data of sibling dependency LK + uses: actions/cache@v2 + id: cachedlk + with: + path: ${{ env.GH_WORKSPACE }}/lk + key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + - name: Clone sibling dependency LK + if: steps.cachedlk.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_lk }} + path: lk + repository: NREL/lk + - name: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' + run: | + cd $GITHUB_WORKSPACE/lk + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake --build build_linux -- -j + - name: Set LKDIR and LKD_LIB envs + run: | + echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV + echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + + - name: Get git ref of sibling dependency WEX + run: | + ref=$(git ls-remote --exit-code git://github.com/NREL/wex.git refs/heads/develop | awk '{print $1}') + echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV + - name: Get cached build data of sibling dependency WEX + uses: actions/cache@v2 + id: cachedwex + with: + path: ${{ env.GH_WORKSPACE }}/wex + key: ${{ env.RUNS_ON }}-${{ env.ref_of_wex }}-WEX + - name: Clone sibling dependency WEX + if: steps.cachedwex.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_wex }} + path: wex + repository: NREL/wex + - name: Build WEX + if: steps.cachedwex.outputs.cache-hit != 'true' + run: | + cd $GITHUB_WORKSPACE/wex + + # [100%] Linking CXX executable wexsandboxd + # /usr/bin/ld: ../wexd.a(pdffontmanager.cpp.o): undefined reference to symbol 'FcPatternAddInteger' + # //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line + # collect2: error: ld returned 1 exit status + # tools/CMakeFiles/wexsandbox.dir/build.make:98: recipe for target 'tools/wexsandboxd' failed + cat tools/CMakeLists.txt | sed 's%target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})%if (UNIX AND NOT APPLE)\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES} ${FONTCONFIG_LIBRARY})\nelse ()\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})\nendif ()\n%' >tools/CMakeLists.txt~ + mv tools/CMakeLists.txt~ tools/CMakeLists.txt + + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake --build build_linux + - name: Set WEXDIR env + run: echo "WEXDIR=$GITHUB_WORKSPACE/wex/build_linux" >>$GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v2 + with: + path: SolTrace + + - name: Build coretrace + run: | + cd $GITHUB_WORKSPACE/SolTrace/coretrace/build_linux + make -j + + - name: Set app-specific envs + run: | + echo "WEXDIR=$GITHUB_WORKSPACE/wex" >>$GITHUB_ENV + echo "WEXLIB=$GITHUB_WORKSPACE/wex/build_linux/wexd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + echo "LKLIB=$GITHUB_WORKSPACE/lk/build_linux/lkd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + - name: Build desktop app + run: | + cd $GITHUB_WORKSPACE/SolTrace/app/build_linux + make -j + + - name: Save soltrace + uses: actions/upload-artifact@v2 + with: + name: soltrace-${{ env.RUNS_ON }}-x86_64 + path: ${{ env.GH_WORKSPACE }}/SolTrace/app/deploy/linux_64/soltrace + + build-on-ubuntu2004: + runs-on: ubuntu-20.04 + env: + RUNS_ON: ubuntu2004 + GH_WORKSPACE: /home/runner/work/SolTrace/SolTrace #= $GITHUB_WORKSPACE + steps: + - name: Install OS dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + cmake \ + freeglut3-dev \ + g++ \ + libcurl4-openssl-dev \ + libfontconfig-dev \ + libgl1-mesa-dev \ + libgtk2.0-dev \ + mesa-common-dev \ + unzip + - name: Get GCC version + run: gcc --version + - name: Get libc version + run: ldd --version + + - name: Install wxWidgets + run: | + sudo apt-get install -y libwxgtk*-dev + sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 + wx-config-3 --cflags | grep I + + - name: Get git ref of sibling dependency LK + run: | + ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') + echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV + - name: Get cached build data of sibling dependency LK + uses: actions/cache@v2 + id: cachedlk + with: + path: ${{ env.GH_WORKSPACE }}/lk + key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + - name: Clone sibling dependency LK + if: steps.cachedlk.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_lk }} + path: lk + repository: NREL/lk + - name: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' + run: | + cd $GITHUB_WORKSPACE/lk + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake --build build_linux -- -j + - name: Set LKDIR and LKD_LIB envs + run: | + echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV + echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + + - name: Get git ref of sibling dependency WEX + run: | + ref=$(git ls-remote --exit-code git://github.com/NREL/wex.git refs/heads/develop | awk '{print $1}') + echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV + - name: Get cached build data of sibling dependency WEX + uses: actions/cache@v2 + id: cachedwex + with: + path: ${{ env.GH_WORKSPACE }}/wex + key: ${{ env.RUNS_ON }}-${{ env.ref_of_wex }}-WEX + - name: Clone sibling dependency WEX + if: steps.cachedwex.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_wex }} + path: wex + repository: NREL/wex + - name: Build WEX + if: steps.cachedwex.outputs.cache-hit != 'true' + run: | + cd $GITHUB_WORKSPACE/wex + + # [100%] Linking CXX executable wexsandboxd + # /usr/bin/ld: ../wexd.a(pdffontmanager.cpp.o): undefined reference to symbol 'FcPatternAddInteger' + # //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line + # collect2: error: ld returned 1 exit status + # tools/CMakeFiles/wexsandbox.dir/build.make:98: recipe for target 'tools/wexsandboxd' failed + cat tools/CMakeLists.txt | sed 's%target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})%if (UNIX AND NOT APPLE)\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES} ${FONTCONFIG_LIBRARY})\nelse ()\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})\nendif ()\n%' >tools/CMakeLists.txt~ + mv tools/CMakeLists.txt~ tools/CMakeLists.txt + + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake --build build_linux + - name: Set WEXDIR env + run: echo "WEXDIR=$GITHUB_WORKSPACE/wex/build_linux" >>$GITHUB_ENV + + - name: Checkout + uses: actions/checkout@v2 + with: + path: SolTrace + + - name: Build coretrace + run: | + cd $GITHUB_WORKSPACE/SolTrace/coretrace/build_linux + make -j + + - name: Set app-specific envs + run: | + echo "WEXDIR=$GITHUB_WORKSPACE/wex" >>$GITHUB_ENV + echo "WEXLIB=$GITHUB_WORKSPACE/wex/build_linux/wexd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + echo "LKLIB=$GITHUB_WORKSPACE/lk/build_linux/lkd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug + - name: Build desktop app + run: | + cd $GITHUB_WORKSPACE/SolTrace/app/build_linux + make -j + + - name: Save soltrace + uses: actions/upload-artifact@v2 + with: + name: soltrace-${{ env.RUNS_ON }}-x86_64 + path: ${{ env.GH_WORKSPACE }}/SolTrace/app/deploy/linux_64/soltrace diff --git a/app/build_linux/Makefile-ui b/app/build_linux/Makefile-ui index eafc28c..beac1a4 100644 --- a/app/build_linux/Makefile-ui +++ b/app/build_linux/Makefile-ui @@ -1,10 +1,10 @@ VPATH = ../src/ -WEXDIR = ../../../wex -WEXLIB = $(WEXDIR)/build/wex.a -LKDIR = ../../../lk -LKLIB = $(LKDIR)/build/lk.a +WEXDIR ?= ../../../wex +WEXLIB ?= $(WEXDIR)/build/wex.a +LKDIR ?= ../../../lk +LKLIB ?= $(LKDIR)/build/lk.a CORETRACEDIR = ../../coretrace CORETRACELIB = $(CORETRACEDIR)/build_linux/coretrace.a @@ -14,7 +14,7 @@ CXX = g++ CFLAGS = -g -O2 -std=c++11 -I. -I$(LKDIR)/include -I$(WEXDIR)/include -I$(CORETRACEDIR) -DLK_USE_WXWIDGETS `wx-config-3 --cflags` CXXFLAGS = $(CFLAGS) -LDFLAGS = $(WEXLIB) $(LKLIB) $(CORETRACELIB) `wx-config-3 --libs stc` `wx-config-3 --libs aui` `wx-config-3 --libs gl` `wx-config-3 --libs` -lm -lcurl -lfontconfig -ldl +LDFLAGS = $(WEXLIB) $(LKLIB) $(CORETRACELIB) `wx-config-3 --libs stc` `wx-config-3 --libs aui` `wx-config-3 --libs gl` -lGL `wx-config-3 --libs` -lm -lcurl -lfontconfig -ldl OBJECTS = \ From f97310f57dc93d97a0d8f18427dcb06e13c7e071 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Wed, 8 Sep 2021 12:01:39 +0200 Subject: [PATCH 2/2] remove code that's now dead Signed-off-by: Pierre Fenoll --- .github/workflows/ci.yml | 56 ---------------------------------------- 1 file changed, 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5ea2df..5d67bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,44 +35,6 @@ jobs: sudo apt-get install -y libwxgtk*-dev sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 wx-config-3 --cflags | grep I - # - name: Clone dependency wxWidgets - # uses: actions/checkout@v2 - # with: - # ref: v3.1.0 - # path: wxWidgets - # repository: wxWidgets/wxWidgets - # - name: Install wxWidgets-3.1.0 - # run: | - # cd wxWidgets - # mkdir release-build - # ./configure --prefix=$PWD/release-build \ - # --enable-shared=no \ - # --enable-stl=yes \ - # --enable-debug=no \ - # --with-gtk=2 \ - # --with-libjpeg=builtin \ - # --with-libpng=builtin \ - # --with-regex=builtin \ - # --with-libtiff=builtin \ - # --with-zlib=builtin \ - # --with-expat=builtin \ - # --without-libjbig \ - # --without-liblzma \ - # --without-gtkprint \ - # --with-libnotify=no \ - # --with-libmspack=no \ - # --with-gnomevfs=no \ - # --with-opengl=yes \ - # --with-sdl=no \ - # --with-cxx=11 - # make -j - # make install - # ls -lha bin/ ############### - # ls bin/ | grep wx-config ############### - # sudo ln -s $(ls bin/ | grep wx-config) /usr/bin/wx-config-3 - # wx-config-3 --cflags ############### - # wx-config-3 --cflags | grep I - # cd $GITHUB_WORKSPACE - name: Get git ref of sibling dependency LK run: | @@ -123,15 +85,6 @@ jobs: if: steps.cachedwex.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/wex - - # [100%] Linking CXX executable wexsandboxd - # /usr/bin/ld: ../wexd.a(pdffontmanager.cpp.o): undefined reference to symbol 'FcPatternAddInteger' - # //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line - # collect2: error: ld returned 1 exit status - # tools/CMakeFiles/wexsandbox.dir/build.make:98: recipe for target 'tools/wexsandboxd' failed - cat tools/CMakeLists.txt | sed 's%target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})%if (UNIX AND NOT APPLE)\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES} ${FONTCONFIG_LIBRARY})\nelse ()\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})\nendif ()\n%' >tools/CMakeLists.txt~ - mv tools/CMakeLists.txt~ tools/CMakeLists.txt - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux - name: Set WEXDIR env @@ -243,15 +196,6 @@ jobs: if: steps.cachedwex.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/wex - - # [100%] Linking CXX executable wexsandboxd - # /usr/bin/ld: ../wexd.a(pdffontmanager.cpp.o): undefined reference to symbol 'FcPatternAddInteger' - # //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line - # collect2: error: ld returned 1 exit status - # tools/CMakeFiles/wexsandbox.dir/build.make:98: recipe for target 'tools/wexsandboxd' failed - cat tools/CMakeLists.txt | sed 's%target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})%if (UNIX AND NOT APPLE)\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES} ${FONTCONFIG_LIBRARY})\nelse ()\n target_link_libraries(wexsandbox wex ${wxWidgets_LIBRARIES})\nendif ()\n%' >tools/CMakeLists.txt~ - mv tools/CMakeLists.txt~ tools/CMakeLists.txt - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux - name: Set WEXDIR env