From d512770b41794656a542eb66ad6943fbe91f51d1 Mon Sep 17 00:00:00 2001 From: Parham Kazemi Date: Tue, 16 May 2023 15:09:22 -0700 Subject: [PATCH] Fix build failure on macOS 12 and 13 (#468) * Replace nested .a files with wildcards * Add GCC on macOS-latest to azure-pipelines.yml * Fix gtest uninitialized warning * Fix gtest macOS warning * Fix library paths --- Assembly/Makefile.am | 2 +- DataBase/Makefile.am | 2 +- RResolver/Makefile.am | 4 ++-- azure-pipelines.yml | 33 +++++++++++++++++++++++++++++++-- vendor/gtest-1.7.0/Makefile.am | 4 ++-- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Assembly/Makefile.am b/Assembly/Makefile.am index 50c04a779..022d01182 100644 --- a/Assembly/Makefile.am +++ b/Assembly/Makefile.am @@ -22,4 +22,4 @@ libassembly_a_SOURCES = \ SplitAlgorithm.h \ TrimAlgorithm.h -libassembly_a_LIBADD = $(top_builddir)/Common/libcommon.a +libassembly_a_LIBADD = $(wildcard $(top_builddir)/Common/*.o) diff --git a/DataBase/Makefile.am b/DataBase/Makefile.am index 6a055ceab..ce0ef2282 100644 --- a/DataBase/Makefile.am +++ b/DataBase/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libdb.a libdb_a_SOURCES = DB.cc DB.h Options.h libdb_a_CPPFLAGS = -I$(top_srcdir) -libdb_a_LIBADD = $(top_builddir)/Common/libcommon.a +libdb_a_LIBADD = $(wildcard $(top_builddir)/Common/*.o) if HAVE_SQLITE3 bin_PROGRAMS = abyss-db-csv diff --git a/RResolver/Makefile.am b/RResolver/Makefile.am index 774bb9a95..4201034dd 100644 --- a/RResolver/Makefile.am +++ b/RResolver/Makefile.am @@ -31,6 +31,6 @@ libralgorithmsshort_a_SOURCES = \ RUtils.cpp RUtils.h libralgorithmsshort_a_LIBADD = \ - $(top_builddir)/DataLayer/libdatalayer.a \ - $(top_builddir)/Common/libcommon.a + $(wildcard $(top_builddir)/DataLayer/*.o) \ + $(wildcard $(top_builddir)/Common/*.o) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e56c4b94f..07e76802b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ jobs: -- job: mac_gcc +- job: mac11_gcc pool: vmImage: macOS-11 steps: @@ -23,6 +23,35 @@ jobs: make -j12 distcheck displayName: Compiling ABySS with gcc-12 +- job: mac_latest_gcc + pool: + vmImage: macOS-latest + steps: + - script: | + rm -f /usr/local/bin/2to3 # brew is having issues with installing Python + brew update + brew install automake boost openmpi google-sparsehash make pandoc ghc gcc@12 llvm + displayName: Install common + - script: | + wget https://github.com/bcgsc/btllib/releases/download/v1.5.1/btllib-1.5.1.tar.gz + export CC=gcc-12 + export CXX=g++-12 + tar xzf btllib-1.5.1.tar.gz + cd btllib-1.5.1 + ./compile + displayName: Install btllib + - script: | + ./autogen.sh + export CXXFLAGS="$CXXFLAGS -fuse-ld=lld" + echo $CXXFLAGS + export CFLAGS="$CFLAGS -fuse-ld=lld" + export OBJCFLAGS="$OBJCFLAGS -fuse-ld=lld" + export OBJCXXFLAGS="$OBJCXXFLAGS -fuse-ld=lld" + export DISTCHECK_CONFIGURE_FLAGS="CC=gcc-12 CXX=g++-12 --with-boost=/usr/local/opt/boost --with-sparsehash=/usr/local/opt/google-sparsehash --with-mpi=/usr/local/opt/openmpi --with-btllib=/Users/runner/work/1/s/btllib-1.5.1/install" + ./configure CC=gcc-12 CXX=g++-12 --with-boost=/usr/local/opt/boost --with-sparsehash=/usr/local/opt/google-sparsehash --with-mpi=/usr/local/opt/openmpi --with-btllib=/Users/runner/work/1/s/btllib-1.5.1/install + make -j12 distcheck + displayName: Compiling ABySS with gcc-12 + - job: displayName: mac_latest-compilers-clang pool: @@ -303,4 +332,4 @@ jobs: ./configure make -j12 distcheck AM_CXXFLAGS=-Wall CXXFLAGS='-pthread' displayName: Compiling ABySS with gcc - \ No newline at end of file + diff --git a/vendor/gtest-1.7.0/Makefile.am b/vendor/gtest-1.7.0/Makefile.am index 99c0e7c5c..f7e45603f 100644 --- a/vendor/gtest-1.7.0/Makefile.am +++ b/vendor/gtest-1.7.0/Makefile.am @@ -34,9 +34,9 @@ EXTRA_DIST = \ include/gtest/internal/gtest-type-util.h libgtest_a_CPPFLAGS = -I$(top_srcdir) -isystem $(top_srcdir)/vendor/gtest-1.7.0/include -libgtest_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-missing-field-initializers -Wno-error=unused-result +libgtest_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-missing-field-initializers -Wno-uninitialized -Wno-error=unused-result libgtest_a_SOURCES = src/gtest-all.cc libgtest_main_a_CPPFLAGS = -I$(top_srcdir) -isystem $(top_srcdir)/vendor/gtest-1.7.0/include -libgtest_main_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-missing-field-initializers -Wno-error=unused-result +libgtest_main_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-missing-field-initializers -Wno-uninitialized -Wno-error=unused-result libgtest_main_a_SOURCES = src/gtest_main.cc src/gtest-all.cc