From e4ca9eb2bf7371fa9c1ac8951d298c989cb5aa28 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 23 Jan 2017 11:58:19 +0100 Subject: Let autogen.sh use either glibtoolize or libtoolize on macOS This is necessary since conda's libtool installs libtoolize on macOS. --- build/linux/autogen.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/autogen.sh b/build/linux/autogen.sh index 544fdeb..bb3b5cc 100755 --- a/build/linux/autogen.sh +++ b/build/linux/autogen.sh @@ -12,8 +12,11 @@ if test $? -ne 0; then exit 1 fi -case `uname` in Darwin*) LIBTOOLIZEBIN=glibtoolize ;; - *) LIBTOOLIZEBIN=libtoolize ;; esac +case `uname` in + Darwin*) + test -x "`which glibtoolize 2>/dev/null`" && LIBTOOLIZEBIN=glibtoolize || LIBTOOLIZEBIN=libtoolize ;; + *) + LIBTOOLIZEBIN=libtoolize ;; esac $LIBTOOLIZEBIN --install --force > /dev/null 2>&1 if test $? -ne 0; then -- cgit v1.2.3 From 0f6c2fdc899b19000c3fcfa3f4e2129dd16a44ce Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 23 Jan 2017 12:32:10 +0100 Subject: Change lib/lib64 logic macOS CUDA uses lib even on 64 bit --- build/linux/configure.ac | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 46c84a5..43cb1a8 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -102,14 +102,7 @@ if test x"$NVCC" != xno; then HAVECUDA=yes BACKUP_CUDA_LDFLAGS="$LDFLAGS" if test x"$with_cuda" != x -a x"$with_cuda" != xyes; then - case $host_cpu in - x86_64) - LDFLAGS_CUDA="-L$with_cuda/lib64" - ;; - *) - LDFLAGS_CUDA="-L$with_cuda/lib" - ;; - esac + test -d $with_cuda/lib64 && LDFLAGS_CUDA="-L$with_cuda/lib64" || LDFLAGS_CUDA="-L$with_cuda/lib" CPPFLAGS_CUDA="-I$with_cuda/include" LDFLAGS="$LDFLAGS $LDFLAGS_CUDA" fi -- cgit v1.2.3 From 99718ef1734c0db06034127da703f70a1c30f1a3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 3 Feb 2017 16:57:54 +0100 Subject: Disable openmp on macOS --- build/linux/Makefile.in | 3 +++ build/linux/configure.ac | 3 +++ 2 files changed, 6 insertions(+) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 9066f0a..ae3dec8 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -4,6 +4,7 @@ cuda=@HAVECUDA@ matlab=@HAVEMATLAB@ python=@HAVEPYTHON@ boostutf=@HAVEBOOSTUTF@ +macos=@IS_MACOS@ MATLAB_ROOT=@MATLAB_ROOT@ octave=@HAVEOCTAVE@ @@ -64,9 +65,11 @@ endif ifeq ($(matlab),yes) # TODO: Do we also want -fopenmp for octave? CPPFLAGS+=-I$(MATLAB_ROOT)/extern/include -DMATLAB_MEX_FILE +ifeq ($(macos),no) CXXFLAGS+=-fopenmp LDFLAGS+=-fopenmp endif +endif # MODLDFLAGS are the base LDFLAGS for matlab, octave, python modules MODLDFLAGS=$(LDFLAGS) -L$(abs_top_builddir)/.libs diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 43cb1a8..813b462 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -251,13 +251,16 @@ AC_CANONICAL_HOST case $host_os in darwin* ) CPPFLAGS_OS="-stdlib=libstdc++ -mmacosx-version-min=10.6" + IS_MACOS=yes ;; *) CPPFLAGS_OS="" + IS_MACOS=no ;; esac AC_SUBST(CPPFLAGS_OS) +AC_SUBST(IS_MACOS) # For some reason, some older versions of autoconf produce a config.status # that disables all lines looking like VPATH=@srcdir@ -- cgit v1.2.3 From a3336fc3445fca283be97528d60f2f55501491b0 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 3 Feb 2017 16:58:36 +0100 Subject: Use @loader_path to make mex files find libastra.0.dylib in cwd --- build/linux/Makefile.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index ae3dec8..0120d60 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -304,6 +304,12 @@ mex: $(MATLAB_MEX) %.$(MEXSUFFIX): %.o $(MATLAB_CXX_OBJECTS) libastra.la $(MEX) LDFLAGS="$(MEXLDFLAGS)" $(MEXFLAGS) $(LIBS) $(MEXLIBS) -lastra -output $* $*.o $(MATLAB_CXX_OBJECTS) +ifeq ($(install_type),module) +ifeq ($(macos),yes) + @# tell macOS dynamic loader to look in mex directory for libastra.0.dylib + install_name_tool -change `otool -DX .libs/$(SONAME)` @loader_path/$(SONAME) $@ +endif +endif ifeq ($(python),yes) matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX): matlab/mex/astra_mex_plugin_c.o $(MATLAB_CXX_OBJECTS) libastra.la -- cgit v1.2.3 From f5c25084f09a8f35c4e3d01eb84de984778ae8a9 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 3 Feb 2017 16:58:56 +0100 Subject: Set stdlib to libstdc++ on macOS consistently --- build/linux/Makefile.in | 3 ++- build/linux/configure.ac | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 0120d60..1c0c56a 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -50,7 +50,8 @@ CXXFLAGS+=-g -O3 -Wall -Wshadow LIBS+=-lpthread LDFLAGS+=-g -CPPFLAGS+=@CPPFLAGS_OS@ +CXXFLAGS+=@CXXFLAGS_OS@ +LDFLAGS+=@LDFLAGS_OS@ BOOSTUTF_LIBS=@LIBS_BOOSTUTF@ diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 813b462..b95d94f 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -250,16 +250,19 @@ AC_SUBST(HAVEPYTHON) AC_CANONICAL_HOST case $host_os in darwin* ) - CPPFLAGS_OS="-stdlib=libstdc++ -mmacosx-version-min=10.6" + CXXFLAGS_OS="-stdlib=libstdc++ -mmacosx-version-min=10.6" + LDFLAGS_OS="-stdlib=libstdc++" IS_MACOS=yes ;; *) - CPPFLAGS_OS="" + CXXFLAGS_OS="" + LDFLAGS_OS="" IS_MACOS=no ;; esac -AC_SUBST(CPPFLAGS_OS) +AC_SUBST(CXXFLAGS_OS) +AC_SUBST(LDFLAGS_OS) AC_SUBST(IS_MACOS) # For some reason, some older versions of autoconf produce a config.status -- cgit v1.2.3