From f44ff52a81650cf5f2a6b1e11f0194e468756672 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Wed, 28 Feb 2018 15:46:43 +0100 Subject: OS detection, and version script generator selection via VGEN --- Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f8bacbf..23b834f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,19 @@ GEMMA_VERSION = $(shell cat ./VERSION) # Set this variable to either LNX or MAC -SYS = LNX # LNX|MAC (Linux is the default) +ifeq ($(OS),Windows_NT) + SYS = WIN + VGEN = scripts/gen_version_info.cmd +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Darwin) + SYS = MAC + else + SYS = LNX # default to linux + endif + VGEN = scripts/gen_version_info.sh +endif + # Leave blank after "=" to disable; put "= 1" to enable DIST_NAME = gemma-$(GEMMA_VERSION) DEBUG = 1 # DEBUG mode, set DEBUG=0 for a release @@ -149,7 +161,7 @@ OBJS = $(SOURCES:.cpp=.o) all: $(OUTPUT) ./src/version.h: - ./scripts/gen_version_info.sh > src/version.h + $(VGEN) > src/version.h $(OUTPUT): $(OBJS) $(CPP) $(CPPFLAGS) $(OBJS) $(LIBS) -o $(OUTPUT) -- cgit v1.2.3 From 2fc39eb39792384f797bc29002a0a6b3ef2d50d3 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Wed, 28 Feb 2018 16:07:43 +0100 Subject: Windows compilation paths, and restructuring the -isystem --- Makefile | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 23b834f..a1b9b76 100644 --- a/Makefile +++ b/Makefile @@ -65,8 +65,20 @@ OPENBLAS_LEGACY = # Using older OpenBlas FORCE_STATIC = # Static linking of libraries GCC_FLAGS = -Wall -O3 -std=gnu++11 # extra flags -Wl,--allow-multiple-definition TRAVIS_CI = # used by TRAVIS for testing -EIGEN_INCLUDE_PATH = /usr/include/eigen3 -OPENBLAS_INCLUDE_PATH = /usr/local/opt/openblas/include + +GSL_INCLUDE_PATH = +ifeq ($(SYS), WIN) + GSL_INCLUDE_PATH = -Ic:/GnuWin32/include + EIGEN_INCLUDE_PATH = -I../eigen-git-mirror + OPENBLAS_INCLUDE_PATH = -I../OpenBLAS-v0.2.19-Win64-int32/include +else + OPENBLAS_INCLUDE_PATH = -isystem//usr/local/opt/openblas/include + ifeq ($(SYS), MAC) + EIGEN_INCLUDE_PATH = -isystem//usr/local/include/eigen3 + else + EIGEN_INCLUDE_PATH = -isystem//usr/include/eigen3 + endif +endif # -------------------------------------------------------------------- # Edit below this line with caution @@ -85,13 +97,13 @@ endif ifeq ($(CPP), clang++) # macOS Homebrew settings (as used on Travis-CI) - GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ -isystem/$(OPENBLAS_INCLUDE_PATH) -isystem//usr/local/include/eigen3 -Wl,-L/usr/local/opt/openblas/lib + GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ $(OPENBLAS_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Wl,-L/usr/local/opt/openblas/lib endif ifdef WITH_OPENBLAS OPENBLAS=1 # WITH_LAPACK = # OPENBLAS usually includes LAPACK - CPPFLAGS += -DOPENBLAS -isystem/$(OPENBLAS_INCLUDE_PATH) + CPPFLAGS += -DOPENBLAS $(OPENBLAS_INCLUDE_PATH) ifdef OPENBLAS_LEGACY # Legacy version (mostly for Travis-CI) CPPFLAGS += -DOPENBLAS_LEGACY @@ -99,10 +111,14 @@ ifdef WITH_OPENBLAS endif ifdef DEBUG - CPPFLAGS += -g $(GCC_FLAGS) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc else # release mode - CPPFLAGS += -DNDEBUG $(GCC_FLAGS) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -DNDEBUG $(GCC_FLAGS) $(GSL_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc +endif + +ifeq ($(SYS), WIN) + CPPFLAGS += -Duint="unsigned int" -D__CRT__NO_INLINE -D__STRING="__STRINGIFY" endif ifdef SHOW_COMPILER_WARNINGS -- cgit v1.2.3 From 9b6cc6e0955d9b6acc88ee8801729ae6fcc60d8b Mon Sep 17 00:00:00 2001 From: DannyArends Date: Wed, 28 Feb 2018 23:37:52 +0100 Subject: Makefile changes, to compile under windows --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a1b9b76..235d1b6 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,9 @@ TRAVIS_CI = # used by TRAVIS for testing GSL_INCLUDE_PATH = ifeq ($(SYS), WIN) - GSL_INCLUDE_PATH = -Ic:/GnuWin32/include - EIGEN_INCLUDE_PATH = -I../eigen-git-mirror - OPENBLAS_INCLUDE_PATH = -I../OpenBLAS-v0.2.19-Win64-int32/include + GSL_INCLUDE_PATH = -isystemc:/MinGW/include -LC:/MinGW/lib + EIGEN_INCLUDE_PATH = -isystem../eigen-git-mirror + OPENBLAS_INCLUDE_PATH = -isystem../OpenBLAS-v0.2.19-Win64-int32/include -L../OpenBLAS-v0.2.19-Win64-int32/lib else OPENBLAS_INCLUDE_PATH = -isystem//usr/local/opt/openblas/include ifeq ($(SYS), MAC) @@ -118,7 +118,7 @@ else endif ifeq ($(SYS), WIN) - CPPFLAGS += -Duint="unsigned int" -D__CRT__NO_INLINE -D__STRING="__STRINGIFY" + CPPFLAGS += -Duint="unsigned int" -D__CRT__NO_INLINE -D__STRING="__STRINGIFY" -DWINDOWS -DWITH_GSLCBLAS=1 endif ifdef SHOW_COMPILER_WARNINGS -- cgit v1.2.3 From 64799368da26440c014ecfcf435f7ca3a44d8d15 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Thu, 1 Mar 2018 15:55:10 +0100 Subject: Trying to fix the -isystem/ failure of travis --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 235d1b6..e7fe655 100644 --- a/Makefile +++ b/Makefile @@ -68,15 +68,15 @@ TRAVIS_CI = # used by TRAVIS for testing GSL_INCLUDE_PATH = ifeq ($(SYS), WIN) - GSL_INCLUDE_PATH = -isystemc:/MinGW/include -LC:/MinGW/lib - EIGEN_INCLUDE_PATH = -isystem../eigen-git-mirror - OPENBLAS_INCLUDE_PATH = -isystem../OpenBLAS-v0.2.19-Win64-int32/include -L../OpenBLAS-v0.2.19-Win64-int32/lib + GSL_INCLUDE_PATH = -isystem/c:/MinGW/include -LC:/MinGW/lib + EIGEN_INCLUDE_PATH = ../eigen-git-mirror + OPENBLAS_INCLUDE_PATH = ../OpenBLAS-v0.2.19-Win64-int32/include -L../OpenBLAS-v0.2.19-Win64-int32/lib else - OPENBLAS_INCLUDE_PATH = -isystem//usr/local/opt/openblas/include + OPENBLAS_INCLUDE_PATH = /usr/local/opt/openblas/include ifeq ($(SYS), MAC) - EIGEN_INCLUDE_PATH = -isystem//usr/local/include/eigen3 + EIGEN_INCLUDE_PATH = /usr/local/include/eigen3 else - EIGEN_INCLUDE_PATH = -isystem//usr/include/eigen3 + EIGEN_INCLUDE_PATH = /usr/include/eigen3 endif endif @@ -97,13 +97,13 @@ endif ifeq ($(CPP), clang++) # macOS Homebrew settings (as used on Travis-CI) - GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ $(OPENBLAS_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Wl,-L/usr/local/opt/openblas/lib + GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ -isystem/$(OPENBLAS_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Wl,-L/usr/local/opt/openblas/lib endif ifdef WITH_OPENBLAS OPENBLAS=1 # WITH_LAPACK = # OPENBLAS usually includes LAPACK - CPPFLAGS += -DOPENBLAS $(OPENBLAS_INCLUDE_PATH) + CPPFLAGS += -DOPENBLAS -isystem/$(OPENBLAS_INCLUDE_PATH) ifdef OPENBLAS_LEGACY # Legacy version (mostly for Travis-CI) CPPFLAGS += -DOPENBLAS_LEGACY @@ -111,10 +111,10 @@ ifdef WITH_OPENBLAS endif ifdef DEBUG - CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc else # release mode - CPPFLAGS += -DNDEBUG $(GCC_FLAGS) $(GSL_INCLUDE_PATH) $(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -DNDEBUG $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc endif ifeq ($(SYS), WIN) -- cgit v1.2.3 From dd3ca7014de2d8f1a2cec36cc22ff93b1e929cc4 Mon Sep 17 00:00:00 2001 From: DannyArends Date: Thu, 1 Mar 2018 15:58:04 +0100 Subject: Early morning extra fwd slash failure, fixed in this commit --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e7fe655..bdb58b2 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ TRAVIS_CI = # used by TRAVIS for testing GSL_INCLUDE_PATH = ifeq ($(SYS), WIN) - GSL_INCLUDE_PATH = -isystem/c:/MinGW/include -LC:/MinGW/lib + GSL_INCLUDE_PATH = -isystemc:/MinGW/include -LC:/MinGW/lib EIGEN_INCLUDE_PATH = ../eigen-git-mirror OPENBLAS_INCLUDE_PATH = ../OpenBLAS-v0.2.19-Win64-int32/include -L../OpenBLAS-v0.2.19-Win64-int32/lib else @@ -97,13 +97,13 @@ endif ifeq ($(CPP), clang++) # macOS Homebrew settings (as used on Travis-CI) - GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ -isystem/$(OPENBLAS_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Wl,-L/usr/local/opt/openblas/lib + GCC_FLAGS=-O3 -std=c++11 -stdlib=libc++ -isystem$(OPENBLAS_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH) -Wl,-L/usr/local/opt/openblas/lib endif ifdef WITH_OPENBLAS OPENBLAS=1 # WITH_LAPACK = # OPENBLAS usually includes LAPACK - CPPFLAGS += -DOPENBLAS -isystem/$(OPENBLAS_INCLUDE_PATH) + CPPFLAGS += -DOPENBLAS -isystem$(OPENBLAS_INCLUDE_PATH) ifdef OPENBLAS_LEGACY # Legacy version (mostly for Travis-CI) CPPFLAGS += -DOPENBLAS_LEGACY @@ -111,10 +111,10 @@ ifdef WITH_OPENBLAS endif ifdef DEBUG - CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -g $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc else # release mode - CPPFLAGS += -DNDEBUG $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem/$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc + CPPFLAGS += -DNDEBUG $(GCC_FLAGS) $(GSL_INCLUDE_PATH) -isystem$(EIGEN_INCLUDE_PATH) -Icontrib/catch-1.9.7 -Isrc endif ifeq ($(SYS), WIN) -- cgit v1.2.3