From 70ba7e85ef0cc3af60198be65ddfbbcd95b2efde Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 11 Oct 2018 10:38:42 +0200 Subject: [PATCH] ioapi - build script reviewed, support for PGI compiler added - vrariant for PFI compiler added --- HDF5/ioapi/build | 56 ++++++++++++------- .../Makeinclude.Linux2_x86pg_pgcc_mpi_nomp | 52 +++++++++++++++++ .../files/Makeinclude.Linux2_x86pg_pgcc_nomp | 52 +++++++++++++++++ HDF5/ioapi/files/variants | 1 + 4 files changed, 142 insertions(+), 19 deletions(-) create mode 100644 HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_mpi_nomp create mode 100644 HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_nomp diff --git a/HDF5/ioapi/build b/HDF5/ioapi/build index 1d47bfa..d8ce439 100755 --- a/HDF5/ioapi/build +++ b/HDF5/ioapi/build @@ -8,12 +8,11 @@ pbuild::add_to_group 'HDF5' pbuild::compile_in_sourcetree pbuild::add_patch 'files/Makefile.pncf.sed.patch' -pbuild::add_docfile README.txt -pbuild::add_docfile V32-CHANGES.txt -pbuild::add_docfile VERSION.txt -pbuild::add_docfile HTML/gpl.txt +pbuild::add_docfiles README.txt +pbuild::add_docfiles V32-CHANGES.txt +pbuild::add_docfiles VERSION.txt +pbuild::add_docfiles HTML/gpl.txt -declare config_args=() declare BIN='' pbuild::post_prep() { @@ -22,40 +21,59 @@ pbuild::post_prep() { } pbuild::pre_configure_Darwin() { - cp -av "${BUILDBLOCK_DIR}/files/Makeinclude.OSX_x86_gfortmpi" "ioapi" - BIN='OSX_x86_gfortmpi' + case "${COMPILER}" in + gcc ) + BIN='OSX_x86_gfortmpi' + cp -av "${BUILDBLOCK_DIR}/files/Makeinclude.${BIN}" "ioapi" + ;; + * ) + std::die 4 "Compiler '${COMPILER}' is not supported on ${OS}!" + ;; + esac } pbuild::pre_configure_Linux() { - BIN='Linux2_x86_64gfortmpi' + case "${COMPILER}" in + pgi ) + BIN='Linux2_x86pg_pgcc_mpi_nomp' + cp -av "${BUILDBLOCK_DIR}/files/Makeinclude.${BIN}" "ioapi" + ;; + gcc ) + BIN='Linux2_x86_64gfortmpi' + ;; + * ) + std::die 4 "Compiler '${COMPILER}' is not supported on ${OS}!" + ;; + esac } pbuild::pre_configure() { cp Makefile.template Makefile - config_args+=( "BASEDIR=${SRC_DIR}" ) - config_args+=( "CPLMODE=pncf" ) - config_args+=( "INSTALL=${PREFIX}" ) - config_args+=( "NCFLIBS=-lpnetcdf -lnetcdf -lnetcdff -lgfortran" ) - config_args+=( "BIN=${BIN}" ) - config_args+=( "FIXDIR=${PREFIX}/include" ) + pbuild::add_configure_args "BASEDIR=${SRC_DIR}" + pbuild::add_configure_args "CPLMODE=pncf" + pbuild::add_configure_args "INSTALL=${PREFIX}" + pbuild::add_configure_args "NCFLIBS=-lpnetcdf -lnetcdf -lnetcdff -lgfortran" + pbuild::add_configure_args "BIN=${BIN}" + pbuild::add_configure_args "FIXDIR=${PREFIX}/include" } pbuild::configure() { - make "${config_args[@]}" configure + make "${CONFIGURE_ARGS[@]}" configure } pbuild::compile() { - make "${config_args[@]}" all + make "${CONFIGURE_ARGS[@]}" all } pbuild::install() { - mkdir -p "${PREFIX}" - make "${config_args[@]}" install + mkdir -vp "${PREFIX}" + make "${CONFIGURE_ARGS[@]}" install } pbuild::post_install() { cd "${PREFIX}" - mkdir -p 'include' + mkdir -vp 'lib' + mkdir -vp 'include' mv -v "${BIN}"/*.a 'lib' mv -v "${BIN}"/*.mod 'include' mv -v "${BIN}" 'bin' diff --git a/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_mpi_nomp b/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_mpi_nomp new file mode 100644 index 0000000..3bbca57 --- /dev/null +++ b/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_mpi_nomp @@ -0,0 +1,52 @@ +# VERSION "$Id: Makeinclude.Linux2_x86pg_pgcc_nomp 1 2017-06-10 18:05:20Z coats $" +# +# In some ways, this is the most problematical install, because of +# the way various compilers create linker-visible object names for +# the code they compile. The default flags assume that you are using +# the Gnu "gcc" (and maybe "g77") to compile other libraries such as +# "libnetcdf.a" and "libpvm3.a" -- note that vendor-distributed +# libraries that may come with your Linux system are built this way... +# Alternatively, you may use "pgf90" and "pgcc" to build the entire +# system (where you use "-DpgiFortran=1" in your netCDF build), and +# then may use the alternate set of ARCHFLAGS. +# +# The important thing is that _all_ the compilations for building an +# executable must use consistent linker-visible object names. Any +# "could not find" error messages when linking a program probably +# come from this kind of problem; the fix is to rebuild everything +# with a consistent set of compiler-flags. You may use the script +# "nm_test.csh" and/or "make nametest" to help with this determination. +# +# Note all the variant files "Makeinclude.Linux2_x86pg*": copy the +# appropriate one to "Makeinclude.Linux2_x86pg"; further ensure that +# the compilation-flags for your model-code match the flags therein. + + +AR = ar +CC = mpicc +CXX = mpic++ +FC = mpif90 +M4 = m4 +CPP = cpp +LINK = $(CC) + +## Module-include-directory command +MODI = -module ## module-include directive +E132 = -Mextend + +MFLAGS = -fast -Mnosecond_underscore # -Mnoupcase + +OMPFLAGS = # -mp +OMPLIBS = # -lmp +COPTFLAGS = -O2 +FOPTFLAGS = -O2 +FPPFLAGS = -DF90=1 +FSFLAGS = -Msave +ARCHFLAGS = -DFLDMN=1 -DAUTO_ARRAYS=1 -DF90=1 +PARFLAGS = +LIBDIR = $(SRCDIR)/../lib +BINDIR = $(SRCDIR)/../bin +ARCHLIB = + +PVMLIBS = -L$(PVM_ROOT)/lib/$(PVM_ARCH) -lpvm3 +M4DEFFILE = $(PVM_ROOT)/conf/$(PVM_ARCH).m4 diff --git a/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_nomp b/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_nomp new file mode 100644 index 0000000..4107df0 --- /dev/null +++ b/HDF5/ioapi/files/Makeinclude.Linux2_x86pg_pgcc_nomp @@ -0,0 +1,52 @@ +# VERSION "$Id: Makeinclude.Linux2_x86pg_pgcc_nomp 1 2017-06-10 18:05:20Z coats $" +# +# In some ways, this is the most problematical install, because of +# the way various compilers create linker-visible object names for +# the code they compile. The default flags assume that you are using +# the Gnu "gcc" (and maybe "g77") to compile other libraries such as +# "libnetcdf.a" and "libpvm3.a" -- note that vendor-distributed +# libraries that may come with your Linux system are built this way... +# Alternatively, you may use "pgf90" and "pgcc" to build the entire +# system (where you use "-DpgiFortran=1" in your netCDF build), and +# then may use the alternate set of ARCHFLAGS. +# +# The important thing is that _all_ the compilations for building an +# executable must use consistent linker-visible object names. Any +# "could not find" error messages when linking a program probably +# come from this kind of problem; the fix is to rebuild everything +# with a consistent set of compiler-flags. You may use the script +# "nm_test.csh" and/or "make nametest" to help with this determination. +# +# Note all the variant files "Makeinclude.Linux2_x86pg*": copy the +# appropriate one to "Makeinclude.Linux2_x86pg"; further ensure that +# the compilation-flags for your model-code match the flags therein. + + +AR = ar +CC = pgcc +CXX = pg++ +FC = pgf90 +M4 = m4 +CPP = cpp +LINK = $(CC) + +## Module-include-directory command +MODI = -module ## module-include directive +E132 = -Mextend + +MFLAGS = -fast -Mnosecond_underscore # -Mnoupcase + +OMPFLAGS = # -mp +OMPLIBS = # -lmp +COPTFLAGS = -O2 +FOPTFLAGS = -O2 +FPPFLAGS = -DF90=1 +FSFLAGS = -Msave +ARCHFLAGS = -DFLDMN=1 -DAUTO_ARRAYS=1 -DF90=1 +PARFLAGS = +LIBDIR = $(SRCDIR)/../lib +BINDIR = $(SRCDIR)/../bin +ARCHLIB = + +PVMLIBS = -L$(PVM_ROOT)/lib/$(PVM_ARCH) -lpvm3 +M4DEFFILE = $(PVM_ROOT)/conf/$(PVM_ARCH).m4 diff --git a/HDF5/ioapi/files/variants b/HDF5/ioapi/files/variants index 398560b..918c222 100644 --- a/HDF5/ioapi/files/variants +++ b/HDF5/ioapi/files/variants @@ -1,2 +1,3 @@ ioapi/3.2 unstable gcc/7.3.0 openmpi/1.10.7 hdf5/1.10.1 netcdf/4.6.1 parallel-netcdf/1.9.0 ioapi/3.2 unstable gcc/7.3.0 openmpi/3.0.1 hdf5/1.10.1 netcdf/4.6.1 parallel-netcdf/1.9.0 +ioapi/3.2 unstable pgi/18.5 pgi-mpi/18.5 hdf5/1.10.1 netcdf/4.6.1 parallel-netcdf/1.9.0