Commit 2e74165a authored by Nicolai Stange's avatar Nicolai Stange
Browse files

cleanup: autotools: don't modify user chosen installation prefix

Currently, configure constructs a $SETUPTYPE string based on the selected
configuration and appends that to installation prefix as given by --prefix.

This behaviour is not only unusual, but limits the user to completely
determine the final installation path.

Abandon it. Namely,
- purge the --with-mpitype option from configure,
- do not construct a $SETUPTYPE string,
- purge any reference to $SETUPTYPE from the Makefile.am's.

Additionally, in order to avoid name clashs in the case of
--enable-fakelib, install the "real" sct headers into $pkgincludedir, e.g.
$prefix/include/sct, and the fake ones into a directory named "nosct"
thereunder. Rename the fake libsct.la to libnosct.la.

The above changes render the install-all make target, which reconfigures
and rebuilds in all combinations of w/ and w/o OpenMP and MPI,
disfunctional. Functionality of that kind is better preserved in some
user defined wrapper scripts around the build process anyway and thus,
purge the install-all make target.

Finally, adapt the pkgconfig/sct.pc.in to properly reflect the changes.
parent 77330f4d
......@@ -27,32 +27,3 @@ else
@echo "----------------------------------------"
$(MKDIR_P) $(top_srcdir)/doc/html
endif
install-all: install
if OPENMP
@echo "... now building libs with --disable-openmp ..."
@cd $(top_srcdir) && make clean
@cd $(top_srcdir) && sed -i 's/enable-openmp/disable-openmp/g' config.status
@cd $(top_srcdir) && ./config.status --recheck
@cd $(top_srcdir) && ./config.status
@cd $(top_srcdir) && make
@cd $(top_srcdir) && make install
endif
if MPI
@echo "... now building libs with --disable-mpi ..."
@cd $(top_srcdir) && make clean
@cd $(top_srcdir) && sed -i 's/enable-mpi/disable-mpi/g' config.status
@cd $(top_srcdir) && ./config.status --recheck
@cd $(top_srcdir) && ./config.status
@cd $(top_srcdir) && make
@cd $(top_srcdir) && make install
if OPENMP
@echo "... now building libs with --enable-openmp ..."
@cd $(top_srcdir) && make clean
@cd $(top_srcdir) && sed -i 's/disable-openmp/enable-openmp/g' config.status
@cd $(top_srcdir) && ./config.status --recheck
@cd $(top_srcdir) && ./config.status
@cd $(top_srcdir) && make
@cd $(top_srcdir) && make install
endif
endif
......@@ -54,26 +54,6 @@ AC_ARG_ENABLE([openmp],
AM_CONDITIONAL([OPENMP], [test x"$openmp" = xtrue])
AM_CONDITIONAL([MPI], [test x"$mpi" = xtrue])
# setuptype: defines subdirectory to be used for install in order to distinguish different versions
AS_IF([test x"$mpi" != xfalse],
[AS_IF([test x"$openmp" != xfalse],
[SETUPTYPE=mpi-openmp],
[SETUPTYPE=mpi]
)
],
[AS_IF([test x"$openmp" != xfalse],
[SETUPTYPE=openmp],
[SETUPTYPE=serial]
)
]
)
AC_ARG_WITH([mpitype],
[AS_HELP_STRING([--with-mpitype],
[specify MPI type/vendor in order to unify installdir @<:@default: mpi@:>@])],
AS_IF([test x"$mpi" != xfalse],
[SETUPTYPE=`echo $SETUPTYPE | sed "s/mpi/$with_mpitype/"`]))
AC_SUBST([SETUPTYPE])
# DEBUG
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
......@@ -514,7 +494,7 @@ echo \
${PACKAGE_NAME} Version ${PACKAGE_VERSION}
Prefix : ${prefix}/${SETUPTYPE}
Prefix : ${prefix}
C-Compiler : ${CC} ${DEFS} ${CFLAGS} ${CPPFLAGS}
Fortran-Compiler: ${FC} ${FCDEFS} ${FCFLAGS} ${FCFLAGS_f90} ${FCCPPFLAGS}
......@@ -547,18 +527,6 @@ Now type 'make @<:@<target>@:>@' with optional <target>:
all - build libsct
check - check some features of sct
install - install configured version only"
if test x"$openmp" = xtrue || test x"$mpi" = xtrue; then
echo \
" install-all - install all possible versions, i.e. additional"
fi
if test x"$openmp" = xtrue; then
echo \
" --disable-openmp version"
fi
if test x"$mpi" = xtrue; then
echo \
" --disable-mpi version"
fi
echo \
" @<:@doxygen-@:>@doc - build documentation based on Doxygen
......
AM_CFLAGS = $(OPENMP_CFLAGS)
AM_FCFLAGS = $(FC_MODINC). $(OPENMP_FCFLAGS) $(FCFLAGS_f90)
# overwrite common libdir/includedir with special ones to indicate sct-setup
libdir = "${exec_prefix}/$(SETUPTYPE)/lib"
includedir = "${exec_prefix}/$(SETUPTYPE)/include"
lib_LTLIBRARIES = libsct.la
libsct_la_LIBADD = $(LTLIBPAPI) $(LTLIBHDF5)
......@@ -13,11 +9,11 @@ header = sct_config.h sct_mach.h sct_collector.h sct_reduce.h sct_reporter.h sct
if FORTRAN_INTERFACE
libsct_la_SOURCES = sct_collector.c sct_f2c.c sct_mach.c sct_reduce.c sct_reporter.c sct_mergesort.c sct.f90
nodist_include_HEADERS = sct.mod
nodist_pkginclude_HEADERS = sct.mod
else
libsct_la_SOURCES = sct_collector.c sct_f2c.c sct_mach.c sct_reduce.c sct_reporter.c sct_mergesort.c
endif
include_HEADERS = sct.h
pkginclude_HEADERS = sct.h
EXTRA_DIST = $(header)
......@@ -43,8 +39,8 @@ clean-sctheader:
uninstall-local:
-rm $(DESTDIR)/$(libdir)/$(lib_LTLIBRARIES)
-rm $(DESTDIR)/$(includedir)/$(include_HEADERS)
-rm $(DESTDIR)/$(pkgincludedir)/$(pkginclude_HEADERS)
-rm $(DESTDIR)/$(libdir)/$(pkgconfig_DATA)
if FORTRAN_INTERFACE
-rm $(DESTDIR)/$(includedir)/$(nodist_include_HEADERS)
-rm $(DESTDIR)/$(includedir)/$(nodist_pkginclude_HEADERS)
endif
prefix=@prefix@/@SETUPTYPE@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
includedir=@includedir@/sct
Name: SCT
Description: Simple high resolution timer library.
......
AM_FCFLAGS = $(FC_MODINC). $(OPENMP_FCFLAGS) $(FCFLAGS_f90)
# overwrite common libdir/includedir with special ones to indicate sct-setup
libdir = "${exec_prefix}/$(SETUPTYPE)_nosct/lib"
includedir = "${exec_prefix}/$(SETUPTYPE)_nosct/include"
nosctincludedir = $(pkgincludedir)/nosct
lib_LTLIBRARIES = libsct.la
lib_LTLIBRARIES = libnosct.la
if FORTRAN_INTERFACE
libsct_la_SOURCES = nosct.f90
nodist_include_HEADERS = sct.mod
libnosct_la_SOURCES = nosct.f90
nodist_nosctinclude_HEADERS = sct.mod
else
libsct_la_SOURCES =
nodist_include_HEADERS =
libnosct_la_SOURCES =
nodist_nosctinclude_HEADERS =
endif
sct.mod: nosct.o
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment