From ba0895b5299512e5028429e9e0111ab9944899cc Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 26 Apr 2016 16:45:33 +0200 Subject: Add SIRT plugin --- build/linux/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index f10f482..14027e1 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -399,8 +399,10 @@ ifeq ($(python),yes) install-python: py $(INSTALL_SH) -m 755 -d @prefix@/python $(INSTALL_SH) -m 755 -d @prefix@/python/astra + $(INSTALL_SH) -m 755 -d @prefix@/python/astra/plugins $(INSTALL_SH) -m 644 python/finalbuild/astra/*.so @prefix@/python/astra $(INSTALL_SH) -m 644 python/finalbuild/astra/*.py @prefix@/python/astra + $(INSTALL_SH) -m 644 python/finalbuild/astra/plugins/*.py @prefix@/python/astra/plugins $(INSTALL_SH) -m 644 python/finalbuild/*.egg-info @prefix@/python/ @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @echo "To use ASTRA in Python, add @prefix@/python/ to your PYTHONPATH" -- cgit v1.2.3 From 64a48bea80b909311351dc3b1345a17c693ddb69 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 28 Sep 2016 14:58:41 +0200 Subject: Add experimental support for Octave Based on initial patch by @kalvdans. --- build/linux/Makefile.in | 51 +++++++++++++++++++++++++++++++++++++++++++++++- build/linux/configure.ac | 23 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 14027e1..076cfd1 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -5,6 +5,7 @@ boostutf=@HAVEBOOSTUTF@ MATLAB_ROOT=@MATLAB_ROOT@ +octave=@HAVEOCTAVE@ TARGETS=libastra.la @@ -16,6 +17,10 @@ ifeq ($(python),yes) TARGETS+=py endif +ifeq ($(octave),yes) +TARGETS+=oct +endif + all: $(TARGETS) prefix=@prefix@ @@ -46,6 +51,16 @@ LIBS += -lcudart -lcufft NVCC = @NVCC@ endif +ifeq ($(octave),yes) +OCTLDFLAGS:=$(LDFLAGS) +CPPFLAGS += @OCTAVE_CPPFLAGS@ +ifeq ($(cuda),yes) +OCTFLAGS=-DASTRA_CUDA +else +OCTFLAGS= +endif +endif + ifeq ($(matlab),yes) CPPFLAGS+=-I$(MATLAB_ROOT)/extern/include -DMATLAB_MEX_FILE CXXFLAGS+=-fopenmp @@ -259,6 +274,20 @@ ifeq ($(python),yes) MATLAB_MEX+=matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX) endif +OCTAVE_CXX_OBJECTS=\ + matlab/mex/octave_support.o + +OCTAVE_MEX=\ + matlab/mex/astra_mex_algorithm_c.mex \ + matlab/mex/astra_mex_data2d_c.mex \ + matlab/mex/astra_mex_c.mex \ + matlab/mex/astra_mex_matrix_c.mex \ + matlab/mex/astra_mex_projector_c.mex \ + matlab/mex/astra_mex_projector3d_c.mex \ + matlab/mex/astra_mex_log_c.mex \ + matlab/mex/astra_mex_data3d_c.mex \ + matlab/mex/astra_mex_direct_c.mex + OBJECT_DIRS = src/ tests/ cuda/2d/ cuda/3d/ matlab/mex/ ./ DEPDIRS = $(addsuffix $(DEPDIR),$(OBJECT_DIRS)) -include $(wildcard $(addsuffix /*.d,$(DEPDIRS))) @@ -294,6 +323,13 @@ python-root-install: libastra.la endif +ifeq ($(octave),yes) +oct: $(OCTAVE_MEX) + +%.mex: %.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) libastra.la + mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) -L.libs -lastra --output $* $*.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) +endif + libastra.la: $(ALL_OBJECTS) ./libtool --mode=link --tag=CXX $(LD) -rpath $(LIBDIR) -o $@ $(LDFLAGS) $(LIBS) $+ @@ -374,7 +410,7 @@ distclean: clean rm -rf $(srcdir)/autom4te.cache rm -f $(srcdir)/configure Makefile -install: install-libraries install-matlab install-python +install: install-libraries install-matlab install-python install-octave install-libraries: libastra.la $(INSTALL_SH) -m 755 -d @libdir@ @@ -413,6 +449,19 @@ else install-python: endif +ifeq ($(octave),yes) +# TODO: This install location doesn't work well for /usr or /usr/local +install-octave: $(OCTAVE_MEX) + $(INSTALL_SH) -m 755 -d @prefix@/octave + $(INSTALL_SH) -m 755 -d @prefix@/octave/mex + $(INSTALL_SH) -m 755 -d @prefix@/octave/tools + $(INSTALL_SH) -m 644 $(OCTAVE_MEX) @prefix@/octave/mex + $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m @prefix@/octave/tools +# TODO: docs +else +install-octave: +endif + Makefile: $(srcdir)/Makefile.in config.status CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=$@ $(SHELL) ./config.status diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 630b08d..0d80cec 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -175,6 +175,28 @@ fi AC_SUBST(HAVEMATLAB) +# octave + +AC_ARG_ENABLE(octave, [[ --disable-octave disable Octave support]]) +if test x"$enable_octave" != xno; then + AC_PATH_PROG([HAVEOCTAVE], [octave-config], [no], [$PATH]) + AC_MSG_CHECKING([for octave]) + if test x"HAVEOCTAVE" != xno -a $HAVEMATLAB = yes; then + HAVEOCTAVE=no + AC_MSG_RESULT([no (since Matlab support is enabled)]) + else + if test x"$HAVEOCTAVE" != xno; then + OCTAVE_CPPFLAGS="-I`octave-config -p OCTINCLUDEDIR`" + AC_SUBST(OCTAVE_CPPFLAGS) + HAVEOCTAVE=yes + fi + AC_MSG_RESULT($HAVEOCTAVE) + fi +else + HAVEOCTAVE=no +fi +AC_SUBST(HAVEOCTAVE) + # python AC_ARG_WITH(python, [[ --with-python=path path of Python binary (optional)]],,) @@ -271,6 +293,7 @@ echo echo "Summary of ASTRA Toolbox build options:" echo " CUDA : $HAVECUDA" echo " Matlab : $HAVEMATLAB" +echo " Octave : $HAVEOCTAVE" echo " Python : $HAVEPYTHON" echo echo " prefix : $prefix" -- cgit v1.2.3 From d93769add0fc322c051614d610f1aa645cb859da Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 21 Nov 2016 10:29:38 +0100 Subject: Add install-octave to .PHONY --- build/linux/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 076cfd1..50afc1c 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -474,7 +474,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac @echo "configure.ac has been changed. Regenerating configure script" cd $(srcdir) && $(SHELL) ./autogen.sh -.PHONY: all mex test clean distclean install install-libraries py python-root-install install-python +.PHONY: all mex test clean distclean install install-libraries py python-root-install install-python install-octave # don't remove intermediate files: .SECONDARY: -- cgit v1.2.3 From 6282fbe29bd2a8594bbc589e3996030e882b84f5 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 21 Nov 2016 12:16:40 +0100 Subject: Show NVCCFLAGS help --- build/linux/configure.ac | 2 ++ 1 file changed, 2 insertions(+) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 0d80cec..96be24c 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -141,6 +141,8 @@ if test x"$HAVECUDA" = xyes; then AC_MSG_RESULT([$NVCCARCHS]) fi +AC_ARG_VAR(NVCCFLAGS, [CUDA nvcc flags]) + AC_SUBST(HAVECUDA) AC_SUBST(LDFLAGS_CUDA) -- cgit v1.2.3 From fab3c9ab472f1044f8aaf5d08f398f08995ba338 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 21 Nov 2016 13:27:46 +0100 Subject: Separate python build and install steps --- build/linux/Makefile.in | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 50afc1c..865a936 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -309,14 +309,10 @@ endif ifeq ($(python),yes) py: libastra.la $(MKDIR) python/build - $(MKDIR) python/finalbuild # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. - cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install \ - --install-base=$(abs_top_builddir)/python/finalbuild --install-headers=$(abs_top_builddir)/python/finalbuild --install-purelib=$(abs_top_builddir)/python/finalbuild \ - --install-platlib=$(abs_top_builddir)/python/finalbuild --install-scripts=$(abs_top_builddir)/python/finalbuild --install-data=$(abs_top_builddir)/python/finalbuild + cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build -python-root-install: libastra.la - $(MKDIR) python/build +python-root-install: py # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install @@ -433,6 +429,11 @@ endif ifeq ($(python),yes) # TODO: This install location doesn't work well for /usr or /usr/local install-python: py + $(MKDIR) python/finalbuild + # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. + cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install \ + --install-base=$(abs_top_builddir)/python/finalbuild --install-headers=$(abs_top_builddir)/python/finalbuild --install-purelib=$(abs_top_builddir)/python/finalbuild \ + --install-platlib=$(abs_top_builddir)/python/finalbuild --install-scripts=$(abs_top_builddir)/python/finalbuild --install-data=$(abs_top_builddir)/python/finalbuild $(INSTALL_SH) -m 755 -d @prefix@/python $(INSTALL_SH) -m 755 -d @prefix@/python/astra $(INSTALL_SH) -m 755 -d @prefix@/python/astra/plugins -- cgit v1.2.3 From 88ef7076c710c4482d923d1f8a33ec0dec031d7f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 21 Nov 2016 16:59:34 +0100 Subject: Update tested cuda compute capabilities --- build/linux/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 96be24c..7ccc8f5 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -133,9 +133,9 @@ fi AC_ARG_WITH(cuda_compute, [[ --with-cuda-compute=archs comma separated list of CUDA compute models (optional)]],,) if test x"$HAVECUDA" = xyes; then AC_MSG_CHECKING([for nvcc archs]) - dnl 10 11 12 13 20 30 32 35 37 50 + dnl 10 11 12 13 20 21 30 32 35 37 50 52 53 60 61 if test x"$with_cuda_compute" = x; then - with_cuda_compute="10,12,20,30,35,50" + with_cuda_compute="20,30,35,50,60" fi ASTRA_FIND_NVCC_ARCHS([$with_cuda_compute],NVCCFLAGS_EXTRA,NVCCARCHS) AC_MSG_RESULT([$NVCCARCHS]) -- cgit v1.2.3 From 7e10c16eee71c608a1dba1dd2fec8471567f6b61 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 21 Nov 2016 17:00:50 +0100 Subject: Overhaul package installation There are now three ways of installing from configure/make: ./configure --with-install-type=prefix (default) libraries go into @libdir@ matlab tools/mex go into @datadir@/astra/matlab octave tools/mex go into @datadir@/astra/octave python module goes into site-packages ./configure --with-install-type=dir libraries go into @prefix@/lib matlab tools/mex go into @prefix@/matlab octave tools/mex go into @prefix@/octave python module goes into @prefix@/python ./configure --with-install-type=module matlab tools/mex go into @prefix@/matlab octave tools/mex go into @prefix@/octave python module goes into site-packages library is installed along with the matlab/octave/python module(s), with rpath --- build/linux/Makefile.in | 183 +++++++++++++++++++++++++++++------------------ build/linux/configure.ac | 12 +++- 2 files changed, 125 insertions(+), 70 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 865a936..1c7088e 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -1,12 +1,19 @@ +install_type=@INSTALL_TYPE@ + cuda=@HAVECUDA@ matlab=@HAVEMATLAB@ python=@HAVEPYTHON@ boostutf=@HAVEBOOSTUTF@ - MATLAB_ROOT=@MATLAB_ROOT@ octave=@HAVEOCTAVE@ +MKDIR=mkdir -p +CXX=@CXX@ +LD=@CXX@ +SHELL=@SHELL@ +INSTALL_SH=$(SHELL) $(srcdir)/install-sh + TARGETS=libastra.la ifeq ($(matlab),yes) @@ -25,6 +32,7 @@ all: $(TARGETS) prefix=@prefix@ exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ srcdir=@srcdir@ abs_top_builddir=@abs_top_builddir@ @@ -43,6 +51,8 @@ LDFLAGS+=-g CPPFLAGS+=@CPPFLAGS_OS@ +BOOSTUTF_LIBS=@LIBS_BOOSTUTF@ + ifeq ($(cuda),yes) CPPFLAGS += @CPPFLAGS_CUDA@ -DASTRA_CUDA NVCCFLAGS += @NVCCFLAGS_EXTRA@ @CPPFLAGS_CUDA@ -I$(srcdir)/../.. -I$(srcdir)/../../include -DASTRA_CUDA @@ -51,58 +61,38 @@ LIBS += -lcudart -lcufft NVCC = @NVCC@ endif -ifeq ($(octave),yes) -OCTLDFLAGS:=$(LDFLAGS) -CPPFLAGS += @OCTAVE_CPPFLAGS@ -ifeq ($(cuda),yes) -OCTFLAGS=-DASTRA_CUDA -else -OCTFLAGS= -endif -endif - ifeq ($(matlab),yes) +# TODO: Do we also want -fopenmp for octave? CPPFLAGS+=-I$(MATLAB_ROOT)/extern/include -DMATLAB_MEX_FILE CXXFLAGS+=-fopenmp LDFLAGS+=-fopenmp endif +# MODLDFLAGS are the base LDFLAGS for matlab, octave, python modules +MODLDFLAGS=$(LDFLAGS) -L$(abs_top_builddir)/.libs +ifeq ($(install_type),module) +MODLDFLAGS+=-Wl,-rpath,'\$$ORIGIN' +endif + ifeq ($(python),yes) PYTHON = @PYTHON@ -PYLIBDIR = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_config_var; import six; six.print_(get_config_var("LIBDIR"))') -PYINCDIR = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_inc; import six; six.print_(get_python_inc())') +PYLIBDIR := $(shell $(PYTHON) -c 'from distutils.sysconfig import get_config_var; import six; six.print_(get_config_var("LIBDIR"))') +PYINCDIR := $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_inc; import six; six.print_(get_python_inc())') PYLIBVER = `basename $(PYINCDIR)` CPPFLAGS += -DASTRA_PYTHON -I$(PYINCDIR) PYCPPFLAGS := $(CPPFLAGS) PYCPPFLAGS += -I../include -PYLDFLAGS = $(LDFLAGS) -PYLDFLAGS += -L$(abs_top_builddir)/.libs +PYLDFLAGS = $(MODLDFLAGS) endif # This is below where PYCPPFLAGS copies CPPFLAGS. The python code is built # from a different directory, so these relative includes would be wrong. CPPFLAGS+=-I$(srcdir)/../.. -I$(srcdir)/../../include -I$(srcdir)/../../lib/include -BOOST_CPPFLAGS= -BOOST_LDFLAGS= - -BOOSTUTF_LIBS=@LIBS_BOOSTUTF@ - - -CPPFLAGS+=$(BOOST_CPPFLAGS) -LDFLAGS+=$(BOOST_LDFLAGS) - - -MKDIR=mkdir -p -CXX=@CXX@ -LD=@CXX@ -SHELL=@SHELL@ -INSTALL_SH=$(SHELL) $(srcdir)/install-sh - ifeq ($(matlab),yes) MEXFLAGS = -cxx -MEXLDFLAGS='$$LDFLAGS $(LDFLAGS)' -MEXLIBS = -L.libs -lut +MEXLDFLAGS=\$$LDFLAGS $(MODLDFLAGS) +MEXLIBS = -lut MEXSUFFIX = @MEXSUFFIX@ MEX = @MEX@ @@ -111,13 +101,23 @@ MEXFLAGS += -DASTRA_CUDA endif ifeq ($(python),yes) -MEXPYLDFLAGS='$$LDFLAGS $(LDFLAGS) -L$(PYLIBDIR)' +# TODO: Why PYLIBDIR? +MEXPYLDFLAGS=\$$LDFLAGS $(MODLDFLAGS) -L$(PYLIBDIR) MEXPYLIBS=$(MEXLIBS) -l$(PYLIBVER) endif endif -LIBDIR=/usr/local/lib + +ifeq ($(octave),yes) +OCTLDFLAGS:=$(MODLDFLAGS) +CPPFLAGS += @OCTAVE_CPPFLAGS@ +ifeq ($(cuda),yes) +OCTFLAGS=-DASTRA_CUDA +else +OCTFLAGS= +endif +endif DEPDIR=.deps @@ -293,28 +293,28 @@ DEPDIRS = $(addsuffix $(DEPDIR),$(OBJECT_DIRS)) -include $(wildcard $(addsuffix /*.d,$(DEPDIRS))) LIBDIRS = $(addsuffix .libs,./ src/ cuda/2d/ cuda/3d/) +SONAME=$(shell . ${abs_top_builddir}/libastra.la; echo $$dlname) ifeq ($(matlab),yes) mex: $(MATLAB_MEX) %.$(MEXSUFFIX): %.o $(MATLAB_CXX_OBJECTS) libastra.la - $(MEX) LDFLAGS=$(MEXLDFLAGS) $(MEXFLAGS) $(LIBS) $(MEXLIBS) -lastra -output $* $*.o $(MATLAB_CXX_OBJECTS) + $(MEX) LDFLAGS="$(MEXLDFLAGS)" $(MEXFLAGS) $(LIBS) $(MEXLIBS) -lastra -output $* $*.o $(MATLAB_CXX_OBJECTS) ifeq ($(python),yes) matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX): matlab/mex/astra_mex_plugin_c.o $(MATLAB_CXX_OBJECTS) libastra.la - $(MEX) LDFLAGS=$(MEXPYLDFLAGS) $(MEXFLAGS) $(LIBS) $(MEXPYLIBS) -lastra -output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) + $(MEX) LDFLAGS="$(MEXPYLDFLAGS)" $(MEXFLAGS) $(LIBS) $(MEXPYLIBS) -lastra -output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) endif endif ifeq ($(python),yes) py: libastra.la $(MKDIR) python/build - # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. - cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build - -python-root-install: py - # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. - cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install +# TODO: Avoid writing into source dir + ln -s $(abs_top_builddir)/.libs/$(SONAME) $(srcdir)/../../python/astra +# Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. + cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS='${PYLDFLAGS}' $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build + rm $(srcdir)/../../python/astra/$(SONAME) endif @@ -327,7 +327,7 @@ oct: $(OCTAVE_MEX) endif libastra.la: $(ALL_OBJECTS) - ./libtool --mode=link --tag=CXX $(LD) -rpath $(LIBDIR) -o $@ $(LDFLAGS) $(LIBS) $+ + ./libtool --mode=link --tag=CXX $(LD) -rpath @libdir@ -o $@ $(LDFLAGS) $(LIBS) $+ %.o: %.cpp $(MKDIR) $(*D)/$(DEPDIR) @@ -406,32 +406,64 @@ distclean: clean rm -rf $(srcdir)/autom4te.cache rm -f $(srcdir)/configure Makefile -install: install-libraries install-matlab install-python install-octave - install-libraries: libastra.la $(INSTALL_SH) -m 755 -d @libdir@ ./libtool --mode=install $(INSTALL_SH) -m 644 libastra.la @libdir@ ./libtool --mode=finish @libdir@ -ifeq ($(matlab),yes) -# TODO: This install location doesn't work well for /usr or /usr/local -install-matlab: $(MATLAB_MEX) - $(INSTALL_SH) -m 755 -d @prefix@/matlab - $(INSTALL_SH) -m 755 -d @prefix@/matlab/mex - $(INSTALL_SH) -m 755 -d @prefix@/matlab/tools - $(INSTALL_SH) -m 644 $(MATLAB_MEX) @prefix@/matlab/mex - $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m @prefix@/matlab/tools -# TODO: docs + +# ------------------------ +# INSTALLATION +# ------------------------ + +ifeq ($(install_type),prefix) +# libraries into @libdir@, python into site-packages, mex into @datadir@ +install: install-libraries install-matlab python-root-install install-octave + +PYPKGDATA= +MATLABBASE=@datadir@/astra/matlab +OCTAVEBASE=@datadir@/astra/octave +endif + +ifeq ($(install_type),dir) +# everything into @prefix@ +install: install-libraries install-matlab install-python install-octave + +PYPKGDATA= +MATLABBASE=@prefix@/matlab +OCTAVEBASE=@prefix@/octave +PYTHONBASE=@prefix@/python +endif + +ifeq ($(install_type),module) +# python into site-packages, mex into @datadir@ +# library copied into python/mex directories +# modules built with rpath=$ORIGIN +install: install-matlab python-root-install install-octave + +PYPKGDATA=$(SONAME) +MATLABBASE=@prefix@/matlab +OCTAVEBASE=@prefix@/octave + +install-matlab-so: libastra.la + $(INSTALL_SH) -m 755 -d $(MATLABBASE)/mex + $(INSTALL_SH) -m 644 $(abs_top_builddir)/.libs/$(SONAME) $(MATLABBASE)/mex +install-octave-so: libastra.la + $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/mex + $(INSTALL_SH) -m 644 $(abs_top_builddir)/.libs/$(SONAME) $(OCTAVEBASE)/mex else -install-matlab: +install-matlab-so: +install-octave-so: endif + + ifeq ($(python),yes) # TODO: This install location doesn't work well for /usr or /usr/local install-python: py $(MKDIR) python/finalbuild # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. - cd $(srcdir)/../../python; CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install \ + cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install \ --install-base=$(abs_top_builddir)/python/finalbuild --install-headers=$(abs_top_builddir)/python/finalbuild --install-purelib=$(abs_top_builddir)/python/finalbuild \ --install-platlib=$(abs_top_builddir)/python/finalbuild --install-scripts=$(abs_top_builddir)/python/finalbuild --install-data=$(abs_top_builddir)/python/finalbuild $(INSTALL_SH) -m 755 -d @prefix@/python @@ -441,23 +473,36 @@ install-python: py $(INSTALL_SH) -m 644 python/finalbuild/astra/*.py @prefix@/python/astra $(INSTALL_SH) -m 644 python/finalbuild/astra/plugins/*.py @prefix@/python/astra/plugins $(INSTALL_SH) -m 644 python/finalbuild/*.egg-info @prefix@/python/ - @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - @echo "To use ASTRA in Python, add @prefix@/python/ to your PYTHONPATH" - @echo "and @libdir@ to your LD_LIBRARY_PATH." - @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" # TODO: docs + +python-root-install: py +# Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. + cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install else +python-root-install: install-python: endif +ifeq ($(matlab),yes) +install-matlab: $(MATLAB_MEX) install-matlab-so + $(INSTALL_SH) -m 755 -d $(MATLABBASE) + $(INSTALL_SH) -m 755 -d $(MATLABBASE)/mex + $(INSTALL_SH) -m 755 -d $(MATLABBASE)/tools + $(INSTALL_SH) -m 644 $(MATLAB_MEX) $(MATLABBASE)/mex + $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m $(MATLABBASE)/tools +# TODO: docs +else +install-matlab: +endif + + ifeq ($(octave),yes) -# TODO: This install location doesn't work well for /usr or /usr/local -install-octave: $(OCTAVE_MEX) - $(INSTALL_SH) -m 755 -d @prefix@/octave - $(INSTALL_SH) -m 755 -d @prefix@/octave/mex - $(INSTALL_SH) -m 755 -d @prefix@/octave/tools - $(INSTALL_SH) -m 644 $(OCTAVE_MEX) @prefix@/octave/mex - $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m @prefix@/octave/tools +install-octave: $(OCTAVE_MEX) install-octave-so + $(INSTALL_SH) -m 755 -d $(OCTAVEBASE) + $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/mex + $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/tools + $(INSTALL_SH) -m 644 $(OCTAVE_MEX) $(OCTAVEBASE)/mex + $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m $(OCTAVEBASE)/tools # TODO: docs else install-octave: @@ -475,7 +520,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac @echo "configure.ac has been changed. Regenerating configure script" cd $(srcdir) && $(SHELL) ./autogen.sh -.PHONY: all mex test clean distclean install install-libraries py python-root-install install-python install-octave +.PHONY: all mex test clean distclean install install-libraries py python-root-install install-python install-octave install-matlab-so install-octave-so # don't remove intermediate files: .SECONDARY: diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 7ccc8f5..26fa215 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -24,7 +24,7 @@ dnl dnl ----------------------------------------------------------------------- dnl $Id$ -AC_INIT(astra_toolbox, 1.7.1) +AC_INIT(astra, 1.7.1) AC_CONFIG_SRCDIR([Makefile.in]) LT_INIT([disable-static]) @@ -274,6 +274,15 @@ AC_SUBST(CPPFLAGS_OS) VPATH_SRCDIR="$srcdir" AC_SUBST(VPATH_SRCDIR) + +# Installation type +AC_ARG_WITH(install-type, [[ --with-install-type=prefix|module|dir type of installation (default prefix)]],,with_install_type=prefix) + +INSTALL_TYPE=$with_install_type +AC_SUBST(INSTALL_TYPE) + + + # TODO: # Detection of tools: @@ -299,4 +308,5 @@ echo " Octave : $HAVEOCTAVE" echo " Python : $HAVEPYTHON" echo echo " prefix : $prefix" +echo " install: $with_install_type" echo -- cgit v1.2.3 From bb01a88b5176c13c6881489887ec789dd10849a0 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 09:45:51 +0100 Subject: Build astra_mex_plugin for octave --- build/linux/Makefile.in | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 1c7088e..ecc3903 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -117,6 +117,12 @@ OCTFLAGS=-DASTRA_CUDA else OCTFLAGS= endif +ifeq ($(python),yes) +OCTPYLIBS=-l$(PYLIBVER) +else +OCTPYLIBS= +endif + endif DEPDIR=.deps @@ -270,10 +276,6 @@ MATLAB_MEX=\ matlab/mex/astra_mex_data3d_c.$(MEXSUFFIX) \ matlab/mex/astra_mex_direct_c.$(MEXSUFFIX) -ifeq ($(python),yes) -MATLAB_MEX+=matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX) -endif - OCTAVE_CXX_OBJECTS=\ matlab/mex/octave_support.o @@ -288,6 +290,12 @@ OCTAVE_MEX=\ matlab/mex/astra_mex_data3d_c.mex \ matlab/mex/astra_mex_direct_c.mex +ifeq ($(python),yes) +MATLAB_MEX+=matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX) +OCTAVE_MEX+=matlab/mex/astra_mex_plugin_c.mex +endif + + OBJECT_DIRS = src/ tests/ cuda/2d/ cuda/3d/ matlab/mex/ ./ DEPDIRS = $(addsuffix $(DEPDIR),$(OBJECT_DIRS)) -include $(wildcard $(addsuffix /*.d,$(DEPDIRS))) @@ -323,7 +331,12 @@ ifeq ($(octave),yes) oct: $(OCTAVE_MEX) %.mex: %.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) libastra.la - mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) -L.libs -lastra --output $* $*.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) + mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) -lastra --output $* $*.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) + +ifeq ($(python),yes) +matlab/mex/astra_mex_plugin_c.mex: matlab/mex/astra_mex_plugin_c.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) libastra.la + mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) $(OCTPYLIBS) -lastra --output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) +endif endif libastra.la: $(ALL_OBJECTS) -- cgit v1.2.3 From a71a219ae5e0faded0c6161e17d8e17d39b01883 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 09:46:05 +0100 Subject: Disable octave interface by default --- build/linux/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 26fa215..785b698 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -179,8 +179,8 @@ AC_SUBST(HAVEMATLAB) # octave -AC_ARG_ENABLE(octave, [[ --disable-octave disable Octave support]]) -if test x"$enable_octave" != xno; then +AC_ARG_ENABLE(octave, [[ --enable-octave enable Octave support]]) +if test x"$enable_octave" = xyes; then AC_PATH_PROG([HAVEOCTAVE], [octave-config], [no], [$PATH]) AC_MSG_CHECKING([for octave]) if test x"HAVEOCTAVE" != xno -a $HAVEMATLAB = yes; then -- cgit v1.2.3 From e69de5d1f5c80c58f9351617bb9ea117fcc6cad3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 15:24:22 +0100 Subject: Clean up linking against libpython for oct/mex --- build/linux/Makefile.in | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index ecc3903..d760a8e 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -83,6 +83,7 @@ CPPFLAGS += -DASTRA_PYTHON -I$(PYINCDIR) PYCPPFLAGS := $(CPPFLAGS) PYCPPFLAGS += -I../include PYLDFLAGS = $(MODLDFLAGS) +MODPYLIBS=-l$(PYLIBVER) endif # This is below where PYCPPFLAGS copies CPPFLAGS. The python code is built @@ -100,12 +101,6 @@ ifeq ($(cuda),yes) MEXFLAGS += -DASTRA_CUDA endif -ifeq ($(python),yes) -# TODO: Why PYLIBDIR? -MEXPYLDFLAGS=\$$LDFLAGS $(MODLDFLAGS) -L$(PYLIBDIR) -MEXPYLIBS=$(MEXLIBS) -l$(PYLIBVER) -endif - endif @@ -117,14 +112,10 @@ OCTFLAGS=-DASTRA_CUDA else OCTFLAGS= endif -ifeq ($(python),yes) -OCTPYLIBS=-l$(PYLIBVER) -else -OCTPYLIBS= -endif endif + DEPDIR=.deps BASE_OBJECTS=\ @@ -311,7 +302,7 @@ mex: $(MATLAB_MEX) ifeq ($(python),yes) matlab/mex/astra_mex_plugin_c.$(MEXSUFFIX): matlab/mex/astra_mex_plugin_c.o $(MATLAB_CXX_OBJECTS) libastra.la - $(MEX) LDFLAGS="$(MEXPYLDFLAGS)" $(MEXFLAGS) $(LIBS) $(MEXPYLIBS) -lastra -output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) + $(MEX) LDFLAGS="$(MEXLDFLAGS)" $(MEXFLAGS) $(LIBS) $(MEXLIBS) $(MODPYLIBS) -lastra -output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) endif endif @@ -335,7 +326,7 @@ oct: $(OCTAVE_MEX) ifeq ($(python),yes) matlab/mex/astra_mex_plugin_c.mex: matlab/mex/astra_mex_plugin_c.o $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) libastra.la - mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) $(OCTPYLIBS) -lastra --output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) + mkoctfile --mex $(OCTFLAGS) $(OCTLDFLAGS) $(LIBS) $(MODPYLIBS) -lastra --output matlab/mex/astra_mex_plugin_c $< $(MATLAB_CXX_OBJECTS) $(OCTAVE_CXX_OBJECTS) endif endif -- cgit v1.2.3 From bc03dad9393d6fd9aad1ba22c98c223edecc918b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 16:25:24 +0100 Subject: Show installation paths at end of configure --- build/linux/configure.ac | 49 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 785b698..e562e77 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -302,11 +302,46 @@ AC_OUTPUT echo echo "Summary of ASTRA Toolbox build options:" -echo " CUDA : $HAVECUDA" -echo " Matlab : $HAVEMATLAB" -echo " Octave : $HAVEOCTAVE" -echo " Python : $HAVEPYTHON" -echo -echo " prefix : $prefix" -echo " install: $with_install_type" +echo " CUDA : $HAVECUDA" +echo " Matlab: $HAVEMATLAB" +echo " Octave: $HAVEOCTAVE" +echo " Python: $HAVEPYTHON" echo +echo "Installation type: $with_install_type" +case $with_install_type in + prefix) + echo " Library : "$(eval echo `eval echo $libdir`) + if test $HAVEMATLAB = yes; then + echo " Matlab files: "$(eval echo `eval echo $datadir`)"/astra/matlab" + fi + if test $HAVEOCTAVE = yes; then + echo " Octave files: "$(eval echo `eval echo $datadir`)"/astra/octave" + fi + if test $HAVEPYTHON = yes; then + echo " Python files to site-packages" + fi + ;; + dir) + echo " Library : "$(eval echo `eval echo $libdir`) + if test $HAVEMATLAB = yes; then + echo " Matlab files: $prefix/matlab" + fi + if test $HAVEOCTAVE = yes; then + echo " Octave files: $prefix/octave" + fi + if test $HAVEPYTHON = yes; then + echo " Python files: $prefix/python" + fi + ;; + module) + echo " Library into Matlab/Octave/Python module directories" + if test $HAVEMATLAB = yes; then + echo " Matlab files: $prefix/matlab" + fi + if test $HAVEOCTAVE = yes; then + echo " Octave files: $prefix/octave" + fi + if test $HAVEPYTHON = yes; then + echo " Python files to site-packages" + fi +esac -- cgit v1.2.3 From bbda2ad4d12a839701737a98e210cef489d62177 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 17:26:27 +0100 Subject: Avoid six for PYINCDIR in Makefile.in --- build/linux/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index d760a8e..d248947 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -76,8 +76,7 @@ endif ifeq ($(python),yes) PYTHON = @PYTHON@ -PYLIBDIR := $(shell $(PYTHON) -c 'from distutils.sysconfig import get_config_var; import six; six.print_(get_config_var("LIBDIR"))') -PYINCDIR := $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_inc; import six; six.print_(get_python_inc())') +PYINCDIR := $(shell $(PYTHON) -c 'from __future__ import print_function; from distutils.sysconfig import get_python_inc; print(get_python_inc())') PYLIBVER = `basename $(PYINCDIR)` CPPFLAGS += -DASTRA_PYTHON -I$(PYINCDIR) PYCPPFLAGS := $(CPPFLAGS) -- cgit v1.2.3 From 19e79122e3f58f22e96a003cc494e38ff255bb0d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 17:30:08 +0100 Subject: Rename python-root-install to install-python-site-packages --- build/linux/Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index d248947..0ca136a 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -421,7 +421,7 @@ install-libraries: libastra.la ifeq ($(install_type),prefix) # libraries into @libdir@, python into site-packages, mex into @datadir@ -install: install-libraries install-matlab python-root-install install-octave +install: install-libraries install-matlab install-python-site-packages install-octave PYPKGDATA= MATLABBASE=@datadir@/astra/matlab @@ -442,7 +442,7 @@ ifeq ($(install_type),module) # python into site-packages, mex into @datadir@ # library copied into python/mex directories # modules built with rpath=$ORIGIN -install: install-matlab python-root-install install-octave +install: install-matlab install-python-site-packages install-octave PYPKGDATA=$(SONAME) MATLABBASE=@prefix@/matlab @@ -478,11 +478,11 @@ install-python: py $(INSTALL_SH) -m 644 python/finalbuild/*.egg-info @prefix@/python/ # TODO: docs -python-root-install: py +install-python-site-packages: py # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build install else -python-root-install: +install-python-site-packages: install-python: endif @@ -523,7 +523,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac @echo "configure.ac has been changed. Regenerating configure script" cd $(srcdir) && $(SHELL) ./autogen.sh -.PHONY: all mex test clean distclean install install-libraries py python-root-install install-python install-octave install-matlab-so install-octave-so +.PHONY: all mex test clean distclean install install-libraries py install-python-site-packages install-python install-octave install-matlab-so install-octave-so # don't remove intermediate files: .SECONDARY: -- cgit v1.2.3 From e72b97ccd734c8bc8c4cb3cbedbb053fb0cd0849 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 22 Nov 2016 17:30:23 +0100 Subject: Remove resolved TODO --- build/linux/Makefile.in | 1 - 1 file changed, 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 0ca136a..d1ce5fb 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -462,7 +462,6 @@ endif ifeq ($(python),yes) -# TODO: This install location doesn't work well for /usr or /usr/local install-python: py $(MKDIR) python/finalbuild # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. -- cgit v1.2.3 From 496d07d50118bd080e573686f65ed16e39be8f5b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 23 Nov 2016 10:54:36 +0100 Subject: Make shared objects 755 --- build/linux/Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index d1ce5fb..ae43afa 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -450,10 +450,10 @@ OCTAVEBASE=@prefix@/octave install-matlab-so: libastra.la $(INSTALL_SH) -m 755 -d $(MATLABBASE)/mex - $(INSTALL_SH) -m 644 $(abs_top_builddir)/.libs/$(SONAME) $(MATLABBASE)/mex + $(INSTALL_SH) -m 755 $(abs_top_builddir)/.libs/$(SONAME) $(MATLABBASE)/mex install-octave-so: libastra.la $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/mex - $(INSTALL_SH) -m 644 $(abs_top_builddir)/.libs/$(SONAME) $(OCTAVEBASE)/mex + $(INSTALL_SH) -m 755 $(abs_top_builddir)/.libs/$(SONAME) $(OCTAVEBASE)/mex else install-matlab-so: install-octave-so: @@ -471,7 +471,7 @@ install-python: py $(INSTALL_SH) -m 755 -d @prefix@/python $(INSTALL_SH) -m 755 -d @prefix@/python/astra $(INSTALL_SH) -m 755 -d @prefix@/python/astra/plugins - $(INSTALL_SH) -m 644 python/finalbuild/astra/*.so @prefix@/python/astra + $(INSTALL_SH) -m 755 python/finalbuild/astra/*.so @prefix@/python/astra $(INSTALL_SH) -m 644 python/finalbuild/astra/*.py @prefix@/python/astra $(INSTALL_SH) -m 644 python/finalbuild/astra/plugins/*.py @prefix@/python/astra/plugins $(INSTALL_SH) -m 644 python/finalbuild/*.egg-info @prefix@/python/ @@ -490,7 +490,7 @@ install-matlab: $(MATLAB_MEX) install-matlab-so $(INSTALL_SH) -m 755 -d $(MATLABBASE) $(INSTALL_SH) -m 755 -d $(MATLABBASE)/mex $(INSTALL_SH) -m 755 -d $(MATLABBASE)/tools - $(INSTALL_SH) -m 644 $(MATLAB_MEX) $(MATLABBASE)/mex + $(INSTALL_SH) -m 755 $(MATLAB_MEX) $(MATLABBASE)/mex $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m $(MATLABBASE)/tools # TODO: docs else @@ -503,7 +503,7 @@ install-octave: $(OCTAVE_MEX) install-octave-so $(INSTALL_SH) -m 755 -d $(OCTAVEBASE) $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/mex $(INSTALL_SH) -m 755 -d $(OCTAVEBASE)/tools - $(INSTALL_SH) -m 644 $(OCTAVE_MEX) $(OCTAVEBASE)/mex + $(INSTALL_SH) -m 755 $(OCTAVE_MEX) $(OCTAVEBASE)/mex $(INSTALL_SH) -m 644 $(srcdir)/../../matlab/tools/*.m $(OCTAVEBASE)/tools # TODO: docs else -- cgit v1.2.3 From eeffd2d9748b8912b384a5764b808f5bfc850ade Mon Sep 17 00:00:00 2001 From: Holger Kohr Date: Wed, 23 Nov 2016 10:21:55 +0100 Subject: Separate C++ and python builds & make conda work nicely - make builder (= advanced user or us ourselves) choose compilers and CUDA - add a check for the C++11 flag for nvcc to work around the infamous boost bug if necessary - use conda boost to build the C++ library - simplify python bindings conda recipe to only build the bindings; the C++ library is now a build and runtime dependency - add runtime dependencies to python bindings recipe - some small adjustments to builder.py --- build/linux/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index e562e77..3a2a92b 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -228,8 +228,8 @@ if test x"$with_python" != x -a x"$with_python" != xno; then AC_MSG_CHECKING(for Cython module) ASTRA_TRY_PYTHON([ import Cython -from distutils.version import LooseVersion -assert(LooseVersion(Cython.__version__)>=LooseVersion("0.13")) +from pkg_resources import parse_version +assert(parse_version(Cython.__version__) >= parse_version("0.13")) ],,HAVEPYTHON=no) if test x$HAVEPYTHON = xno; then AC_MSG_RESULT(no) -- cgit v1.2.3 From 71db6331f8dd0d5abbeee92977af01293be4f427 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 28 Nov 2016 15:54:07 +0100 Subject: Update headers (website+2016) --- build/linux/configure.ac | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 3a2a92b..2f992ad 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -1,9 +1,9 @@ dnl ----------------------------------------------------------------------- -dnl Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp -dnl 2014-2015, CWI, Amsterdam +dnl Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp +dnl 2014-2016, CWI, Amsterdam dnl dnl Contact: astra@uantwerpen.be -dnl Website: http://sf.net/projects/astra-toolbox +dnl Website: http://www.astra-toolbox.com/ dnl dnl This file is part of the ASTRA Toolbox. dnl @@ -22,7 +22,6 @@ dnl You should have received a copy of the GNU General Public License dnl along with the ASTRA Toolbox. If not, see . dnl dnl ----------------------------------------------------------------------- -dnl $Id$ AC_INIT(astra, 1.7.1) AC_CONFIG_SRCDIR([Makefile.in]) -- cgit v1.2.3 From 77f2cedaac088da5107dcfb37ae62d8f3a56f335 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 5 Dec 2016 14:44:09 +0100 Subject: Update version to 1.8 --- build/linux/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index 2f992ad..46c84a5 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -23,7 +23,7 @@ dnl along with the ASTRA Toolbox. If not, see . dnl dnl ----------------------------------------------------------------------- -AC_INIT(astra, 1.7.1) +AC_INIT(astra, 1.8.0) AC_CONFIG_SRCDIR([Makefile.in]) LT_INIT([disable-static]) -- cgit v1.2.3 From ca1a9aaf9435d13cda5b33faa9084e03a42457cb Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 18 Jan 2017 17:07:23 +0100 Subject: Avoid 'echo -e' for improved sh portability This fixes the CUDA .d file fixup for macOS. --- build/linux/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index ae43afa..5dfb75e 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -358,7 +358,7 @@ endif @rm -f $(*D)/$(DEPDIR)/$(*F).d2 @# Generate empty targets for all dependencies listed in the .d file. @# This mimics gcc's -MP option. - @for x in `cat $(*D)/$(DEPDIR)/$(*F).d`; do if test a$$x != a: -a a$$x != a\\; then echo -e "\n$$x:\n" >> $(*D)/$(DEPDIR)/$(*F).d; fi; done + @for x in `cat $(*D)/$(DEPDIR)/$(*F).d`; do if test a$$x != a: -a a$$x != a\\; then (echo; echo "$$x:") >> $(*D)/$(DEPDIR)/$(*F).d; fi; done @# Generate a fake libtool .lo file @echo "# $*.lo - a libtool object file" > $*.lo @echo "# Generated by" `./libtool --version | head -n 1` >> $*.lo -- cgit v1.2.3 From bf5475783f2a1bdcddf8426fea136f3b09c61859 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Jan 2017 12:13:35 +0100 Subject: Add small portability comment about CUDA 5.5 --- build/linux/Makefile.in | 1 + 1 file changed, 1 insertion(+) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 5dfb75e..3894a8a 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -353,6 +353,7 @@ ifeq ($(gen_static_libs),yes) @$(NVCC) $(NVCCFLAGS) -c $(<) -o $*.o >/dev/null 2>&1 endif @# Generate a .d file, and change the target name in it from .o to .lo + @# CUDA 5.5's nvcc doesn't have the -MT option we would like to use. @$(NVCC) $(NVCCFLAGS) -M $(<) -odir $(*D) -o $(*D)/$(DEPDIR)/$(*F).d2 @sed '1s/\.o :/.lo :/' < $(*D)/$(DEPDIR)/$(*F).d2 > $(*D)/$(DEPDIR)/$(*F).d @rm -f $(*D)/$(DEPDIR)/$(*F).d2 -- cgit v1.2.3 From 03c3e5b5043cc8cba9aceeb8641d497edd1be7cf Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 8 Feb 2017 11:27:24 +0100 Subject: Clean up symlink after failed python build --- build/linux/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 3894a8a..371b656 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -311,7 +311,7 @@ py: libastra.la # TODO: Avoid writing into source dir ln -s $(abs_top_builddir)/.libs/$(SONAME) $(srcdir)/../../python/astra # Note: setting CC to CXX is intentional. Python uses CC for compilation even if input is C++. - cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS='${PYLDFLAGS}' $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build + (cd $(srcdir)/../../python; ASTRA_INSTALL_LIBRARY_AS_DATA=$(PYPKGDATA) CXX="${CXX}" CC="${CXX}" CPPFLAGS="${PYCPPFLAGS}" LDFLAGS='${PYLDFLAGS}' $(PYTHON) builder.py build --build-base=$(abs_top_builddir)/python/build) || (rm $(srcdir)/../../python/astra/$(SONAME); false) rm $(srcdir)/../../python/astra/$(SONAME) endif -- cgit v1.2.3 From d85a660f064e8130b27e11c7fd762221c754c315 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jan 2017 14:57:57 +0100 Subject: Start work on CFloat32Data3DGPU to allow persistent/external GPU memory --- build/linux/Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 371b656..9066f0a 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -199,7 +199,10 @@ CUDA_CXX_OBJECTS=\ src/CudaFDKAlgorithm3D.lo \ src/CudaSirtAlgorithm3D.lo \ src/CudaBackProjectionAlgorithm3D.lo \ - src/CudaForwardProjectionAlgorithm3D.lo + src/CudaForwardProjectionAlgorithm3D.lo \ + src/Float32Data3DGPU.lo \ + src/Float32ProjectionData3DGPU.lo \ + src/Float32VolumeData3DGPU.lo CUDA_OBJECTS=\ cuda/2d/algo.lo \ -- cgit v1.2.3 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 From 00a1c6118b2d64b867c8e640c295462bcccfc7c9 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 8 Sep 2017 15:03:55 +0200 Subject: Add macOS note --- build/linux/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'build/linux') diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 1c0c56a..c83e9f0 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -308,7 +308,9 @@ mex: $(MATLAB_MEX) 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) $@ + @# CHECKME: some versions of otool return a two-line output for otool -DX? + @# (xcode 8.2.1 / macos 10.11.6 ?) + install_name_tool -change `otool -DX .libs/$(SONAME) | tail -n 1` @loader_path/$(SONAME) $@ endif endif -- cgit v1.2.3