Arlen Cox avatar Arlen Cox committed 24381ed

Modified build files to allow compilation on Mac OS X 10.8 out of the box.

It makes use of clang++ by default (since C++11 support is required) and only uses OpenMP if it is available. Since clang does not support OpenMP, this is disabled on Mac OS X.

Comments (0)

Files changed (3)

 
 ##### Configuration #####
 CXX=@CXX@
-CPPFLAGS_CORE=@CPPFLAGS@ -I lib -fopenmp -msse -msse2 -mfpmath=sse
+CPPFLAGS_CORE=@CPPFLAGS@ -I lib @OPENMP_CXXFLAGS@ -msse -msse2 -mfpmath=sse
 CXXFLAGS_CORE=@CXXFLAGS@
 ifeq ($(MODE),)
 Z3_BUILD_MODE=external
 endif
 LIBS=@LIBS@
 ## -lrt is for timer_create and timer_settime
-LDFLAGS=@LDFLAGS@ -lpthread -fopenmp
+LDFLAGS=@LDFLAGS@ -lpthread @OPENMP_CXXFLAGS@
 LDFLAGS_EXTRA=
 #########################
 
 endif
 endif
 
-LIBFLAGS=@SLIBFLAGS@ 
+LIBFLAGS=@SLIBFLAGS@ @OPENMP_CXXFLAGS@
 
 ################################
 #
 AS_IF([test "$D2U" = "no"], [AC_MSG_ERROR(dos2unix not found)])
 AC_SUBST(D2U)
 
-AC_PROG_CXX(g++)
+AC_PROG_CXX([clang++ g++])
 AC_PROG_MAKE_SET
 
 AC_LANG_CPLUSPLUS
+AC_OPENMP
 
 host_os=`uname -s`
 
 AS_IF([test "$host_os" = "Darwin"], [
   PLATFORM=osx
   SO_EXT=dylib
-  SLIBFLAGS="-dynamiclib -fopenmp"
+  SLIBFLAGS="-dynamiclib"
   COMP_VERSIONS="-compatibility_version \$(Z3_VERSION) -current_version \$(Z3_VERSION)"
   STATIC_FLAGS=
   CPPFLAGS+=" -mmacosx-version-min=10.4"
   PLATFORM=linux
   SO_EXT=so
   LDFLAGS=-lrt
-  SLIBFLAGS="-shared -fopenmp"
+  SLIBFLAGS="-shared"
   COMP_VERSIONS=
   STATIC_FLAGS=-static
 ], [
 
 AC_PROG_CXXCPP
 
+
 AC_OUTPUT(Makefile)
 
 cat <<EOF
 #ifndef _Z3_OMP_H
 #define _Z3_OMP_H
 
+#ifndef _OPENMP
+#define _NO_OMP_
+#endif
+
 #ifndef _NO_OMP_
 #include"omp.h"
 #else
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.