Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
url = https://github.com/benedictpaten/sonLib.git
[submodule "deps/fermi-lite"]
path = deps/fermi-lite
url = https://github.com/edawson/fermi-lite.git
url = https://github.com/mr-c/fermi-lite.git
[submodule "deps/gbwt"]
path = deps/gbwt
url = https://github.com/jltsiren/gbwt.git
Expand Down Expand Up @@ -116,6 +116,9 @@
[submodule "vgteam_bbhash"]
path = deps/BBHash
url = https://github.com/vgteam/BBHash.git
[submodule "src/simde"]
path = src/simde
url = https://github.com/nemequ/simde-no-tests
[submodule "doc/wiki"]
path = doc/wiki
url = https://github.com/vgteam/vg.wiki.git
Expand Down
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

language: cpp
compiler: gcc
sudo: required
dist: bionic
# We have some shenanigans to let us cache submodules, and update changed files
# without messing up mtimes and triggering rebuilds unnecessarily. Travis checks
Expand All @@ -15,10 +14,10 @@ before_install:
- if [[ -e deps ]]; then mv deps deps_cached; fi
- git submodule update --init --recursive
- rsync -rv --links --checksum deps/ deps_cached/
- rm -Rf deps
# - rm -Rf deps
# Keep the cached deps if the right compiler version was used.
# Otherwise start fresh
- if [[ "$TRAVIS_OS_NAME" == "linux" && -e "deps_cached/gcc$(gcc -dumpversion)" ]]; then mv deps_cached deps; fi
# - if [[ "$TRAVIS_OS_NAME" == "linux" && -e "deps_cached/gcc$(gcc -dumpversion)" ]]; then mv deps_cached deps; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -e deps_cached/clang ]]; then mv deps_cached deps; fi
- (ls -lah deps/; ls -lah bin/; ls -lah lib/; ls -lah include/) || true
- git submodule update --init --recursive
Expand Down Expand Up @@ -112,8 +111,6 @@ os:
- linux
- osx
osx_image: xcode12.2
compiler:
- gcc
env:
global:
- DOCS_KEY_ENCRYPTION_LABEL=125272388526
Expand All @@ -124,3 +121,5 @@ matrix:
# We have a special entry to do the docs build
- os: linux
env: BUILD_DOCS_ONLY=1
- os: linux
arch: arm64
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ CWD:=$(shell pwd)
CXX ?= g++
PKG_CONFIG ?= pkg-config

EXE:=vg
SFX :=
EXE:=vg$(SFX)

all: $(BIN_DIR)/$(EXE)

Expand Down Expand Up @@ -182,7 +183,7 @@ else
CXXFLAGS += -fopenmp

# We care about building for SSE4.2 only and not AVX, to have vaguely portable binaries
CXXFLAGS += -msse4.2
# CXXFLAGS += -msse4.2

# Note shared libraries are so files
SHARED_SUFFIX = so
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ At present, you will need GCC version 4.9 or greater, with support for C++14, to

Other libraries may be required. Please report any build difficulties.

Note that a 64-bit OS is required. Ubuntu 18.04 should work. You will also need a CPU that supports SSE 4.2 to run VG; you can check this with `cat /proc/cpuinfo | grep sse4_2`.
Note that a 64-bit OS is required. Ubuntu 18.04 should work.

When you are ready, build with `. ./source_me.sh && make`, and run with `./bin/vg`.

Expand Down
2 changes: 1 addition & 1 deletion deps/fermi-lite
Submodule fermi-lite updated 4 files
+3 −0 .gitmodules
+1 −1 Makefile
+2 −1 ksw.c
+1 −0 simde
2 changes: 1 addition & 1 deletion src/crash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void emit_stacktrace(int signalNumber, siginfo_t *signalInfo, void *signalContex
*out << "Caught signal " << signalNumber << " raised at address " << ip << endl;
// Do our own tracing because backtrace doesn't really work on all platforms.
stacktrace_manually(*out, signalNumber, ip, bp);
#else
#elif __x86_64__
// Linux 64 bit does it this way
ip = (void*)context->uc_mcontext.gregs[REG_RIP];
bp = (void**)context->uc_mcontext.gregs[REG_RBP];
Expand Down
22 changes: 0 additions & 22 deletions src/preflight.cpp
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
#include "preflight.hpp"

#include <iostream>
#include <cstdlib>
#include <cpuid.h>

namespace vg {

using namespace std;

void preflight_check() {

// We assume we are on x86_64 on POSIX (and not Windows).
// We use the method of dlib's dlib/simd/simd_check.h

// Define a place to put the cpuid info
unsigned int cpuid_info[4];

// Call cpuid function 1 (which reports SSE4.2, and other stuff up to original AVX)
__cpuid(1, cpuid_info[0], cpuid_info[1], cpuid_info[2], cpuid_info[3]);

// Bit 20 of result 2 is the SSE 4.2 flag.
bool have_sse4_2 = cpuid_info[2] & (1 << 20);

if (!have_sse4_2) {
cerr << "error[vg::preflight_check]: The CPU does not support SSE4.2 instructions. VG cannot run here. "
<< "Please use a system with SSE4.2 support." << endl;
exit(1);
}

}

}
9 changes: 1 addition & 8 deletions src/preflight.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@

namespace vg {

/// Define a macro to tell things to be built for every architecture, if possible.
/// This *doesn't* work on Mac with GNU GCC and Apple libc++, because functions
/// for x86-64 can't use std::endl, so we exclude that combination.
#if (!defined(__GNUC__) || !defined(_LIBCPP_VERSION) || !defined(__APPLE__))
#define VG_PREFLIGHT_EVERYWHERE __attribute__((__target__("arch=x86-64")))
#else
#define VG_PREFLIGHT_EVERYWHERE
#endif
#define VG_PREFLIGHT_EVERYWHERE

/// Run a preflight check to make sure that the system is usable for this build of vg.
/// Aborts with a helpful message if this is not the case.
Expand Down
1 change: 1 addition & 0 deletions src/simde
Submodule simde added at bd48f5