Browse code

Attempt to fix clang error on Mac OS ElCapitan; version number not bumped (not yet)

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/msa@128017 bc3139a8-67e5-0310-9ffc-ced21a209358

Ulrich Bodenhofer authored on 04/04/2017 07:43:41
Showing3 changed files

... ...
@@ -5,6 +5,9 @@ CONFIGURE_FLAGS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript -e "if (Sys.info()['sysname'
5 5
 ## Variant 3: let the configure script determine whether OpenMP is available
6 6
 #CONFIGURE_FLAGS=
7 7
 
8
+## Additional flag for compatibility on Mac OS
9
+MAC_FLAGS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript -e "if (Sys.info()['sysname'] == 'Darwin') cat('-DMATH_H_CLIB')"`
10
+
8 11
 CPPNames=\
9 12
 exceptions4c/e4c_lite.c \
10 13
 argtable2/argtable2.c argtable2/arg_end.c argtable2/arg_rem.c argtable2/arg_lit.c argtable2/arg_int.c \
... ...
@@ -44,7 +47,7 @@ all: clustalomega
44 47
 clustalomega:
45 48
 	./configure $(CONFIGURE_FLAGS); \
46 49
 	export PKG_LIBS="$(PKG_LIBS) $(SHLIB_OPENMP_CFLAGS)"; \
47
-	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) $(SHLIB_OPENMP_CXXFLAGS) -std=c++98 -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include"; \
50
+	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) $(SHLIB_OPENMP_CXXFLAGS) $(MAC_FLAGS) -std=c++98 -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include"; \
48 51
 	export PKG_CFLAGS="$(PKG_CFLAGS) $(SHLIB_OPENMP_CFLAGS) -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include"; \
49 52
 	cd src; \
50 53
 	${R_HOME}/bin${R_ARCH_BIN}/R CMD SHLIB -o libClustalOmega.so $(CPPNames) && \
... ...
@@ -38,7 +38,7 @@ clustalomega:
38 38
 	cp windows/src/config.h src/; \
39 39
 	cp windows/src/clustal-omega-config.h src/; \
40 40
 	export PKG_LIBS="$(PKG_LIBS) -L"../../gc-7.2" -lgccpp72 -lgc72"; \
41
-	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) -std=c++98 -DWINMATHH -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include"; \
41
+	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) -std=c++98 -DMATH_H_CLIB -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include"; \
42 42
 	export PKG_CFLAGS="$(PKG_CFLAGS) -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-7.2/include -lgccpp -lgc"; \
43 43
 	cd src; \
44 44
 	${R_HOME}/bin${R_ARCH_BIN}/R.exe CMD SHLIB -o ClustalOmega.dll $(CPPNames) && \
... ...
@@ -37,7 +37,7 @@
37 37
 #include <stdio.h>    // printf
38 38
 #include <stdlib.h>   // exit
39 39
 
40
-#ifdef WINMATHH
40
+#ifdef MATH_H_CLIB
41 41
 #include <math.h>     // sqrt, pow
42 42
 #else
43 43
 #include <cmath>     // sqrt, pow