From 116cbd050b5f731b711529a053f73bb1ec275620 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 1 Mar 2012 23:42:37 -0600 Subject: Update lib/Makefile for Boost 1.49 --- lib/Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/Makefile') diff --git a/lib/Makefile b/lib/Makefile index d7b1071b..7210c517 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -6,7 +6,7 @@ STOW_ROOT = /usr/local/stow PRODUCTS = $(HOME)/Products GCC_VERSION = 4.6 -BOOST_VERSION = 1_48_0 +BOOST_VERSION = 1_49_0 CC = gcc-mp-$(GCC_VERSION) ifeq ($(CC),clang) @@ -20,22 +20,20 @@ LD = gcc-mp-$(GCC_VERSION) DIR_SUFFIX = gcc$(subst .,,$(GCC_VERSION)) OPTJ = #-j8 endif -#CPPFLAGS = -D_GLIBCXX_FULLY_DYNAMIC_STRING=1 -#ifneq ($(CC),clang) -#CPPFLAGS += -D_GLIBCXX_DEBUG=1 -#endif CFLAGS = $(CPPFLAGS) -g2 -ggdb LDFLAGS = -g2 -ggdb BOOST_SOURCE = boost-release -#BOOST_DEFINES = define=_GLIBCXX_FULLY_DYNAMIC_STRING=1 +ifeq ($(GCC_VERSION),4.7) +BOOST_DEFINES = define=_GLIBCXX__PTHREADS=1 +else +BOOST_DEFINES = +endif ifeq ($(CC),clang) BOOST_TOOLSET = clang else BOOST_TOOLSET = darwin -#BOOST_DEFINES += define=_GLIBCXX_DEBUG=1 endif -#BOOST_FLAGS = --architecture=x86 --address_model=32_64 BOOST_FLAGS = toolset=$(BOOST_TOOLSET) --layout=versioned \ link=shared threading=single $(BOOST_DEFINES) BOOST_DIR = boost_$(BOOST_VERSION)-$(DIR_SUFFIX) -- cgit v1.2.3 From 823f76eaf0d12ca7280d5f3d0045b78fb7f3713b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 22 Apr 2012 23:32:28 -0500 Subject: Upgrade GCC_VERSION to 4.7 --- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Makefile') diff --git a/lib/Makefile b/lib/Makefile index 7210c517..0f740996 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -5,7 +5,7 @@ STOW_ROOT = /usr/local/stow PRODUCTS = $(HOME)/Products -GCC_VERSION = 4.6 +GCC_VERSION = 4.7 BOOST_VERSION = 1_49_0 CC = gcc-mp-$(GCC_VERSION) -- cgit v1.2.3 From 6af3f0448fe8b3bf3472504a3ee547a816ab381a Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 23 Apr 2012 00:22:12 -0500 Subject: More support for building with Clang --- acprep | 10 ++++++++-- lib/Makefile | 1 + lib/build.sh | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 lib/build.sh (limited to 'lib/Makefile') diff --git a/acprep b/acprep index 1eccef64..fa61ba98 100755 --- a/acprep +++ b/acprep @@ -1016,8 +1016,14 @@ class PrepareBuild(CommandLineApp): self.envvars['PYTHON_HOME'] = '/opt/local' if self.options.use_clang: - self.boost_inc_ident = "clang" - self.boost_lib_ident = "clang-darwin28" + self.log.info('Setting up for using Clang') + + self.boost_inc_ident = "clang31" + self.boost_lib_ident = "clang-darwin42" + + #self.CXXFLAGS.append('-std=c++11') + #self.CXXFLAGS.append('-stdlib=libc++') + #self.LDFLAGS.append('-stdlib=libc++') global search_prefixes search_prefixes = [ '/opt/local', '/usr/local', '/sw', '/usr' ] diff --git a/lib/Makefile b/lib/Makefile index 0f740996..ba7f5ffa 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -49,6 +49,7 @@ all: boost-build #icu-build boost-icu-build prepare-boost: perl -i -pe 's/local command = \[ common\.get-invocation-command darwin : g\+\+ : .*/local command = [ common.get-invocation-command darwin : g++ : $(CXX) ] ;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam perl -i -pe 's/flags darwin\.compile OPTIONS : -no-cpp-precomp -gdwarf-2 (-fexceptions )?;/flags darwin\.compile OPTIONS : -gdwarf-2 \1;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam + perl -i -pe 's/command = \[ common\.get-invocation-command clang-darwin : clang\+\+ $$/command = [ common.get-invocation-command clang-darwin : clang++-mp-3.1/;' $(BOOST_SOURCE)/tools/build/v2/tools/clang-darwin.jam boost-build: prepare-boost (cd $(BOOST_SOURCE) && \ diff --git a/lib/build.sh b/lib/build.sh new file mode 100755 index 00000000..2d18dc58 --- /dev/null +++ b/lib/build.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# This build script is for OS X Lion users who have compiled openmpi and +# clang-3.1 from MacPorts. I build my own Boost instead of using MacPorts' +# Boost in order to get better debugging support, and to link with libc++. + +export PATH=$PATH:/opt/local/lib/openmpi/bin + +cat > ~/user-config.jam <-std=c++11 ; +EOF + +make CXX=clang++-mp-3.1 LD=clang++-mp-3.1 CC=clang-mp-3.1 OPTJ=-j16 \ + CXXFLAGS="-g -std=c++11 -stdlib=libc++" \ + LDFLAGS="-g -stdlib=libc++" \ + BOOST_TOOLSET=clang DIR_SUFFIX=clang31 \ + BOOST_DEFINES="include=/opt/local/include -sICU_PATH=/opt/local -sICONV_PATH=/opt/local cxxflags=\"-g -std=c++11 -stdlib=libc++\" linkflags=\"-g -stdlib=libc++\"" \ No newline at end of file -- cgit v1.2.3 From 72d10112512278b219220458a13dbc53f5b646f5 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 25 Apr 2012 03:08:03 -0500 Subject: Build-related changes --- acprep | 48 +++++++++++++++++++++++++++--------------------- lib/Makefile | 3 +-- lib/build.sh | 12 ++++++------ 3 files changed, 34 insertions(+), 29 deletions(-) (limited to 'lib/Makefile') diff --git a/acprep b/acprep index fa61ba98..5915b3d3 100755 --- a/acprep +++ b/acprep @@ -535,9 +535,9 @@ class PrepareBuild(CommandLineApp): op.add_option('', '--gcc48', action='store_true', dest='gcc48', default=False, help='Require the use of gcc 4.8') - op.add_option('', '--cpp0x', action='store_true', - dest='cpp0x', default=False, - help='Use C++0x extensions (requires Clang or gcc 4.6/7/8)') + op.add_option('', '--cpp11', action='store_true', + dest='use_cpp11', default=False, + help='Use C++11 extensions (requires Clang or gcc 4.6/7/8)') op.add_option('', '--output', metavar='DIR', action="callback", callback=self.option_output, help='Build in the specified directory') @@ -1019,14 +1019,21 @@ class PrepareBuild(CommandLineApp): self.log.info('Setting up for using Clang') self.boost_inc_ident = "clang31" - self.boost_lib_ident = "clang-darwin42" - - #self.CXXFLAGS.append('-std=c++11') - #self.CXXFLAGS.append('-stdlib=libc++') - #self.LDFLAGS.append('-stdlib=libc++') - - global search_prefixes - search_prefixes = [ '/opt/local', '/usr/local', '/sw', '/usr' ] + self.boost_lib_ident = "clang-darwin" + + if self.options.use_cpp11: + self.CXXFLAGS.append('-std=c++11') + self.CXXFLAGS.append('-stdlib=libc++') + self.CXXFLAGS.append('-nostdlibinc') + self.CXXFLAGS.append('-isystem /usr/local/include') + self.CXXFLAGS.append('-isystem /usr/local/include/c++/v1') + self.CXXFLAGS.append('-isystem /usr/include') + + self.LDFLAGS.append('-stdlib=libc++') + self.LDFLAGS.append('/usr/local/lib/libc++.dylib') + else: + global search_prefixes + search_prefixes = [ '/opt/local', '/usr/local', '/sw', '/usr' ] self.log.debug('Using Clang ident: %s/%s' % (self.boost_inc_ident, self.boost_lib_ident)) @@ -1077,14 +1084,14 @@ class PrepareBuild(CommandLineApp): elif system == 'Darwin': if self.options.use_clang: - if exists('/opt/local/bin/clang++-mp-3.1'): - self.envvars['CC'] = '/opt/local/bin/clang-mp-3.1' - self.envvars['CXX'] = '/opt/local/bin/clang++-mp-3.1' - self.envvars['LD'] = '/opt/local/bin/clang++-mp-3.1' - elif exists('/usr/local/bin/clang++'): + if exists('/usr/local/bin/clang++'): self.envvars['CC'] = '/usr/local/bin/clang' self.envvars['CXX'] = '/usr/local/bin/clang++' self.envvars['LD'] = '/usr/local/bin/clang++' + elif exists('/opt/local/bin/clang++-mp-3.1'): + self.envvars['CC'] = '/opt/local/bin/clang-mp-3.1' + self.envvars['CXX'] = '/opt/local/bin/clang++-mp-3.1' + self.envvars['LD'] = '/opt/local/bin/clang++-mp-3.1' else: self.envvars['CC'] = 'clang' self.envvars['CXX'] = 'clang++' @@ -1143,9 +1150,6 @@ class PrepareBuild(CommandLineApp): if self.options.no_python: self.configure_args.remove('--enable-python') - if self.options.cpp0x: - self.CXXFLAGS.append('-std=c++0x') - if exists('/Users/johnw/Projects/ledger/plan/TODO'): self.setup_for_johnw() self.setup_system_directories() @@ -1323,7 +1327,8 @@ class PrepareBuild(CommandLineApp): def locate_darwin_libraries(self): if self.current_flavor == 'debug': - if not self.options.use_clang and self.boost_info.configure( + if (not self.options.use_clang or self.options.use_cpp11) and \ + self.boost_info.configure( home_path = '/usr/local/stow/boost_%s-%s' % \ (self.boost_version, self.boost_inc_ident), suffix = '-%s-d-%s' % \ @@ -1337,7 +1342,8 @@ class PrepareBuild(CommandLineApp): else: if self.boost_info.configure(): pass - elif not self.options.use_clang and self.boost_info.configure( + elif (not self.options.use_clang or self.options.use_cpp11) and \ + self.boost_info.configure( home_path = '/usr/local/stow/boost_%s-%s' % \ (self.boost_version, self.boost_inc_ident), suffix = '-%s-%s' % \ diff --git a/lib/Makefile b/lib/Makefile index ba7f5ffa..cb05e44d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -49,12 +49,11 @@ all: boost-build #icu-build boost-icu-build prepare-boost: perl -i -pe 's/local command = \[ common\.get-invocation-command darwin : g\+\+ : .*/local command = [ common.get-invocation-command darwin : g++ : $(CXX) ] ;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam perl -i -pe 's/flags darwin\.compile OPTIONS : -no-cpp-precomp -gdwarf-2 (-fexceptions )?;/flags darwin\.compile OPTIONS : -gdwarf-2 \1;/;' $(BOOST_SOURCE)/tools/build/v2/tools/darwin.jam - perl -i -pe 's/command = \[ common\.get-invocation-command clang-darwin : clang\+\+ $$/command = [ common.get-invocation-command clang-darwin : clang++-mp-3.1/;' $(BOOST_SOURCE)/tools/build/v2/tools/clang-darwin.jam boost-build: prepare-boost (cd $(BOOST_SOURCE) && \ sh bootstrap.sh && \ - ./b2 $(OPTJ) debug --prefix=$(BOOST_STOW) \ + ./b2 $(OPTJ) debug release --prefix=$(BOOST_STOW) \ --build-dir=$(BOOST_BUILD) $(BOOST_FLAGS) install) icu-build: diff --git a/lib/build.sh b/lib/build.sh index 2d18dc58..28408d73 100755 --- a/lib/build.sh +++ b/lib/build.sh @@ -7,11 +7,11 @@ export PATH=$PATH:/opt/local/lib/openmpi/bin cat > ~/user-config.jam <-std=c++11 ; +using clang-darwin : : "/usr/local/bin/clang++" : -std=c++11 /usr/local/include ; EOF -make CXX=clang++-mp-3.1 LD=clang++-mp-3.1 CC=clang-mp-3.1 OPTJ=-j16 \ - CXXFLAGS="-g -std=c++11 -stdlib=libc++" \ - LDFLAGS="-g -stdlib=libc++" \ - BOOST_TOOLSET=clang DIR_SUFFIX=clang31 \ - BOOST_DEFINES="include=/opt/local/include -sICU_PATH=/opt/local -sICONV_PATH=/opt/local cxxflags=\"-g -std=c++11 -stdlib=libc++\" linkflags=\"-g -stdlib=libc++\"" \ No newline at end of file +# jww (2012-04-24): This is still linking against /usr/lib/libc++.1.dylib +# instead of /usr/local/lib/libc++.1.dylib +make CXX=clang++ LD=clang++ CC=clang OPTJ=-j20 \ + BOOST_TOOLSET=clang-darwin DIR_SUFFIX=clang31 \ + BOOST_DEFINES="-sICU_PATH=/usr/local cxxflags=\"-g -std=c++11 -nostdlibinc -I/usr/local/include -I/usr/local/include/c++/v1 -I/opt/local/include -I/usr/include -stdlib=libc++\" linkflags=\"-g -Z -L/usr/local/lib -L/opt/local/lib -L/usr/lib /usr/local/lib/libc++.dylib -stdlib=libc++\"" -- cgit v1.2.3