Presentation is loading. Please wait.

Presentation is loading. Please wait.

DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Carlo Izzo Using External Libraries.

Similar presentations


Presentation on theme: "DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Carlo Izzo Using External Libraries."— Presentation transcript:

1 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr Carlo Izzo Using External Libraries

2 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr CPL iiinstrument admin doxygen iiinstrument m4macros recipes tests external WCSLIB GSL FFTW SExtractor … iiinstrument_x.y.z.tar.gz directory tree

3 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr AUTOMAKE_OPTIONS = 1.8 foreign ACLOCAL_AMFLAGS = -I m4macros DISTCLEANFILES = *~ COMPILE_FIRST = TOPSUBDIRS = iiinstrument recipes COMPILE_LAST = tests HTML_SUBDIRS = SUBDIRS = $(COMPILE_FIRST) $(TOPSUBDIRS) $(COMPILE_LAST) EXTRA_DIST = m4macros/eso.m4 m4macros/cpl.m4 admin/html.am \ doxygen/Doxyfile.in setup pkgdata_DATA = ChangeLog AUTHORS NEWS README TODO if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure \ stamp-h.in external external/Makefile.in iiinstrument admin doxygen iiinstrument m4macros recipes tests external Makefile.am, top iiinstrument directory

4 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr AUTOMAKE_OPTIONS = 1.8 foreign ACLOCAL_AMFLAGS = -I m4macros DISTCLEANFILES = *~ HTML_SUBDIRS = SUBDIRS = EXTRA_DIST = m4macros/eso.m4 m4macros/cpl.m4 admin/html.am \ doxygen/Doxyfile.in setup pkgdata_DATA = ChangeLog AUTHORS NEWS README TODO if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in configure \ stamp-h.in external external/Makefile.in iiinstrument admin doxygen iiinstrument m4macros recipes tests external iiinstrument recipes tests Makefile.am, top iiinstrument directory

5 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr File: acinclude.m4, top iiinstrument directory iiinstrument admin doxygen iiinstrument m4macros recipes tests external # IIINSTRUMENT_CREATE_SYMBOLS # # Define include and library related makefile symbols AC_DEFUN([IIINSTRUMENT_CREATE_SYMBOLS], [ # Symbols for package include file and library search paths IIINSTRUMENT_INCLUDES='-I$(top_srcdir)/iiinstrument' IIINSTRUMENT_LDFLAGS='-L$(top_srcdir)/iiinstrument' # Library aliases LIBIIINSTRUMENT='$(top_srcdir)/iiinstrument/libiiinstrument.la' # Substitute the defined symbols AC_SUBST(IIINSTRUMENT_INCLUDES) AC_SUBST(IIINSTRUMENT_LDFLAGS) AC_SUBST(LIBIIINSTRUMENT) # Check for CPL and user defined libraries AC_REQUIRE([CPL_CHECK_LIBS]) AC_REQUIRE([ESO_CHECK_EXTRA_LIBS]) all_includes='$(IIINSTRUMENT_INCLUDES) $(CPL_INCLUDES) all_ldflags='$(IIINSTRUMENT_LDFLAGS) $(CPL_LDFLAGS) AC_SUBST(all_includes) AC_SUBST(all_ldflags) ]) LIBWCS_INCLUDES='-I$(top_srcdir)/external/libwcs' LIBWCS_LDFLAGS='-L$(top_srcdir)/external/libwcs' AC_SUBST(LIBWCS_INCLUDES) AC_SUBST(LIBWCS_LDFLAGS) $(LIBWCS_INCLUDES)$(EXTRA_INCLUDES)' $(LIBWCS_LDFLAGS) $(EXTRA_LDFLAGS)'

6 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external AC_CONFIG_FILES(Makefile doxygen/Doxyfile iiinstrument/Makefile recipes/Makefile tests/Makefile) external/Makefile configure.ac, top iiinstrument directory

7 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr Create file: bootdirs, top iiinstrument directory iiinstrument admin doxygen iiinstrument m4macros recipes tests external external/libwcs

8 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ EXTRA_DIST=fftw tar.gz Create file Makefile.am, external directory

9 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr File: Makefile.am, bottom iiinstrument directory iiinstrument admin doxygen iiinstrument m4macros recipes tests external AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in endif CPPFLAGS = -DCX_LOG_DOMAIN=\"IiinstrumentLib\" INCLUDES = $(all_includes) noinst_HEADERS = iiinstrument_utils.h iiinstrument_pfits.h iiinstrument_dfs.h pkginclude_HEADERS = lib_LTLIBRARIES = libiiinstrument.la libiiinstrument_la_SOURCES = iiinstrument_utils.c iiinstrument_pfits.c iiinstrument_dfs.c libiiinstrument_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) libiiinstrument_la_LIBADD = libiiinstrument_la_DEPENDENCIES = $(LIBWCS) $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) $(LIBWCS)

10 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external configure should make available the necessary command line options pointing to the external library. This is done by defining in the acinclude.m4 file a IIINSTRUMENT_CHECK_FFTW macro where the FFTW_INCLUDES, FFTW_LDFLAGS, and LIBFFTW are set up properly. Example implementations of this macro can be found in the cpl.m4 macro. acinclude.m4, top iiinstrument directory

11 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external acinclude.m4, top iiinstrument directory # IIINSTRUMENT_CHECK_FFTW # # Checks for the FFTW library and header files. AC_DEFUN([IIINSTRUMENT_CHECK_FFTW], [ AC_MSG_CHECKING([for FFTW]) iiinstrument_fftw_check_header="fftw.h" iinstrument_fftw_check_lib="libfftw.a" iiinstrument_fftw_includes="" iiinstrument_fftw_libraries="" AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw], [location where FFTW is installed]), [ iiinstrument_with_fftw_includes=$withval/include iiinstrument_with_fftw_libs=$withval/lib ]) ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries)

12 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external acinclude.m4, top iiinstrument directory # IIINSTRUMENT_CHECK_FFTW # # Checks for the FFTW library and header files. AC_DEFUN([IIINSTRUMENT_CHECK_FFTW], [ AC_MSG_CHECKING([for FFTW]) iiinstrument_fftw_check_header="fftw.h" iinstrument_fftw_check_lib="libfftw.a" iiinstrument_fftw_includes="" iiinstrument_fftw_libraries="" AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw], [location where FFTW is installed]), [ iiinstrument_with_fftw_includes=$withval/include iiinstrument_with_fftw_libs=$withval/lib ]) ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries)

13 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external acinclude.m4, top iiinstrument directory … ESO_FIND_FILE($iiinstrument_fftw_check_header, $iiinstrument_with_fftw_includes, iiinstrument_fftw_includes) ESO_FIND_FILE($iinstrument_fftw_check_lib, $iiinstrument_with_fftw_libs, iiinstrument_fftw_libraries) if test x"$iiinstrument_fftw_includes" = xno; then AC_MSG_ERROR([FFTW include was not found.]) fi if test x"$iiinstrument_fftw_libraries" = xno; then AC_MSG_ERROR([FFTW library was not found.]) fi AC_MSG_RESULT([FFTW library and header found.]) FFTW_INCLUDES="-I$iiinstrument_fftw_includes" FFTW_LDFLAGS="-L$iiinstrument_fftw_libraries" LIBFFTW="-lfftw" AC_SUBST(FFTW_INCLUDES) AC_SUBST(FFTW_LDFLAGS) AC_SUBST(LIBFFTW) ])

14 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests external AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in endif CPPFLAGS = -DCX_LOG_DOMAIN=\"IiinstrumentLib\" INCLUDES = $(all_includes) noinst_HEADERS = iiinstrument_utils.h iiinstrument_pfits.h iiinstrument_dfs.h pkginclude_HEADERS = lib_LTLIBRARIES = libiiinstrument.la libiiinstrument_la_SOURCES = iiinstrument_utils.c iiinstrument_pfits.c iiinstrument_dfs.c libiiinstrument_la_LDFLAGS = libiiinstrument_la_LIBADD = libiiinstrument_la_DEPENDENCIES = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) $(LIBFFTW) Makefile.am, bottom iiinstrument directory $(FFTW_INCLUDE) $(FFTW_LDFLAGS) $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)

15 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr iiinstrument admin doxygen iiinstrument m4macros recipes tests error () { echo "Error: $cmd: $1" exit 1 } # Main cmd=`basename $0` usage="Usage: $cmd installation-path" setup_configure="./configure --prefix=$1" setup_make="make" # The destination directory for the installation is mandatory if test $# != 1; then echo "$usage" exit 1 fi # Configure the package echo "Setting up pipeline package... " if eval $setup_configure; then : else error "Package setup failed! See logfile for details." fi # Compile the pipeline echo "Building pipeline package... " if eval $setup_make; then : else error "Package build failed! See logfile for details." fi # Install the pipeline echo "Installing pipeline package... " if eval $setup_make install install-html; then : else error "Package installation failed! See logfile for details." fi exit 0 setup, top iiinstrument directory

16 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr /configure --prefix=$1 make make install cd external gunzip fftw tar.gz tar -xvf fftw tar cd fftw /configure –prefix=$HOME/tmp/fftw –disable-shared make make install cd.. setup, top iiinstrument directory –with-fftw=$HOME/tmp/fftw iiinstrument admin doxygen iiinstrument m4macros recipes tests external tmp

17 DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr File: Makefile.am, bottom iiinstrument directory iiinstrument admin doxygen iiinstrument m4macros recipes tests external AUTOMAKE_OPTIONS = 1.8 foreign DISTCLEANFILES = *~ if MAINTAINER_MODE MAINTAINERCLEANFILES = Makefile.in endif CPPFLAGS = -DCX_LOG_DOMAIN=\"IiinstrumentLib\" INCLUDES = $(all_includes) noinst_HEADERS = iiinstrument_utils.h iiinstrument_pfits.h iiinstrument_dfs.h pkginclude_HEADERS = lib_LTLIBRARIES = libiiinstrument.la libiiinstrument_la_SOURCES = iiinstrument_utils.c iiinstrument_pfits.c iiinstrument_dfs.c libiiinstrument_la_LDFLAGS = $(CPL_LDFLAGS) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) libiiinstrument_la_LIBADD = libiiinstrument_la_DEPENDENCIES = $(LIBWCS) $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLDRS) $(LIBCPLCORE) $(LIBWCS)


Download ppt "DFS/SDD C. Izzo VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Carlo Izzo Using External Libraries."

Similar presentations


Ads by Google