Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: Increase portability by using SIMD Everywhere library
Forwarded: https://github.com/vgteam/gssw/pull/27
Forwarded: https://github.com/ocxtal/dozeu/pull/2
Forwarded: https://github.com/vgteam/libbdsg/pull/72
Forwarded: https://github.com/vgteam/structures/pull/11
Forwarded: https://github.com/vgteam/vg/pull/2867
--- vg.orig/deps/dozeu/dozeu.h
+++ vg/deps/dozeu/dozeu.h
@@ -44,7 +44,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <string.h>
-#include <x86intrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse4.1.h"
 
 #ifndef DZ_INCLUDE_ONCE
 
--- vg.orig/deps/gssw/Makefile
+++ vg/deps/gssw/Makefile
@@ -1,5 +1,5 @@
 CC:=gcc
-CFLAGS+=-Wall -O3 -msse4 -g
+CFLAGS+=-Wall -O3 -g
 OBJ_DIR:=obj
 BIN_DIR:=bin
 SRC_DIR:=src
--- vg.orig/deps/gssw/src/gssw.c
+++ vg/deps/gssw/src/gssw.c
@@ -29,7 +29,8 @@
  *  Created by Mengyao Zhao on 6/22/10.
  *  Generalized to operate on graphs by Erik Garrison and renamed gssw.c
  */
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse2.h"
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
--- vg.orig/deps/gssw/src/gssw.h
+++ vg/deps/gssw/src/gssw.h
@@ -13,7 +13,8 @@
 #include <stdint.h>
 #include <string.h>
 #include <stdbool.h>
-#include <smmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse4.1.h"
 
 /*!	@typedef	structure of the query profile	*/
 struct gssw_profile;
--- vg.orig/deps/gssw/src/main.c
+++ vg/deps/gssw/src/main.c
@@ -6,7 +6,8 @@
 
 #include <stdlib.h>
 #include <stdint.h>
-#include <emmintrin.h>
+#define SIMDE_ENABLE_NATIVE_ALIASES
+#include "simde/x86/sse2.h"
 #include <zlib.h>
 #include <stdio.h>
 #include <time.h>
--- vg.orig/deps/libbdsg/Makefile
+++ vg/deps/libbdsg/Makefile
@@ -12,7 +12,7 @@
 
 OBJS:=$(OBJ_DIR)/eades_algorithm.o $(OBJ_DIR)/hash_graph.o $(OBJ_DIR)/is_single_stranded.o $(OBJ_DIR)/node.o $(OBJ_DIR)/odgi.o $(OBJ_DIR)/packed_graph.o $(OBJ_DIR)/packed_structs.o $(OBJ_DIR)/path_position_overlays.o $(OBJ_DIR)/packed_path_position_overlay.o $(OBJ_DIR)/vectorizable_overlays.o $(OBJ_DIR)/strand_split_overlay.o $(OBJ_DIR)/utility.o
 
-CXXFLAGS :=-O3 -Werror=return-type -std=c++14 -ggdb -g -msse4.2 -I$(INC_DIR) $(CXXFLAGS)
+CXXFLAGS :=-O3 -Werror=return-type -std=c++14 -ggdb -g -I$(INC_DIR) $(CXXFLAGS)
 
 ifeq ($(shell uname -s),Darwin)
 	CXXFLAGS := $(CXXFLAGS) -Xpreprocessor -fopenmp
--- vg.orig/deps/sdsl-lite/CMakeLists.txt
+++ vg/deps/sdsl-lite/CMakeLists.txt
@@ -82,19 +82,6 @@
   endif()
 endif()
 
-include(CheckSSE4_2)
-if( BUILTIN_POPCNT )
-  if( CMAKE_COMPILER_IS_GNUCXX )
-    append_cxx_compiler_flags("-msse4.2 -march=native" "GCC" CMAKE_CXX_OPT_FLAGS)
-  endif()
-  if( CMAKE_COMPILER_IS_GNUCXX )
-    append_cxx_compiler_flags("-msse4.2 -march=native" "CLANG" CMAKE_CXX_OPT_FLAGS)
-  endif()
-  if( CMAKE_COMPILER_IS_INTEL )
-    append_cxx_compiler_flags("-msse4.2 -march=native" "INTEL" CMAKE_CXX_FLAGS)
-  endif()
-endif()
-
 # check for demangle support to get pretty C++ class names
 include(FindCxaDemangle)
 if( HAVE_CXA_DEMANGLE )
--- vg.orig/Makefile
+++ vg/Makefile
@@ -16,7 +16,8 @@
 CWD:=$(shell pwd)
 CXX ?= g++
 
-EXE:=vg
+SFX :=
+EXE:=vg$(SFX)
 
 all: $(BIN_DIR)/$(EXE)
 
@@ -616,7 +617,6 @@
 	$(RM) -f $(INC_DIR)/vg_system_version.hpp
 
 clean:
-	$(RM) -r $(BIN_DIR)
 	$(RM) -r $(LIB_DIR)
 	$(RM) -r $(UNITTEST_OBJ_DIR)
 	$(RM) -r $(SUBCOMMAND_OBJ_DIR)
--- vg.orig/deps/structures/Makefile
+++ vg/deps/structures/Makefile
@@ -9,7 +9,7 @@
 TESTOBJ =$(OBJDIR)/tests.o
 HEADERS = $(INCDIR)/suffix_tree.hpp $(INCDIR)/union_find.hpp $(INCDIR)/min_max_heap.hpp $(INCDIR)/immutable_list.hpp $(INCDIR)/stable_double.hpp $(INCDIR)/rank_pairing_heap.hpp
 CXX = g++
-CPPFLAGS += -std=c++11 -m64 -g -O3 -I$(INCSEARCHDIR)
+CPPFLAGS += -std=c++11 -g -O3 -I$(INCSEARCHDIR)
 
 
 all: 
