From 5dc1a9f2140013b72c57c00bcf3523ed1accb02b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 12 Sep 2022 09:48:21 -0600 Subject: parallelio: make shared lib the default (#32432) --- .../builtin/packages/parallelio/gfortran.patch | 23 ++++++++++++++++++++++ .../repos/builtin/packages/parallelio/package.py | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100644 var/spack/repos/builtin/packages/parallelio/gfortran.patch diff --git a/var/spack/repos/builtin/packages/parallelio/gfortran.patch b/var/spack/repos/builtin/packages/parallelio/gfortran.patch new file mode 100644 index 0000000000..c8878df78a --- /dev/null +++ b/var/spack/repos/builtin/packages/parallelio/gfortran.patch @@ -0,0 +1,23 @@ +--- old/CMakeLists.txt ++++ new/CMakeLists.txt +@@ -4,7 +4,7 @@ + + # Jim Edwards + +-cmake_minimum_required (VERSION 3.5.2) ++cmake_minimum_required (VERSION 3.7) + project (PIO C) + + # The project version number. +@@ -243,6 +243,11 @@ if (PIO_ENABLE_COVERAGE) + endif () + endif () + ++# Allow argument mismatch in gfortran versions > 10 for mpi library compatibility ++if ("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER_EQUAL 10) ++ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") ++endif() ++ + # Include this so we can check values in netcdf_meta.h. + INCLUDE(CheckCSourceCompiles) + INCLUDE(FindNetCDF) diff --git a/var/spack/repos/builtin/packages/parallelio/package.py b/var/spack/repos/builtin/packages/parallelio/package.py index 97f8f6fd6a..c97e3f1e61 100644 --- a/var/spack/repos/builtin/packages/parallelio/package.py +++ b/var/spack/repos/builtin/packages/parallelio/package.py @@ -13,6 +13,7 @@ class Parallelio(CMakePackage): homepage = "https://ncar.github.io/ParallelIO/" url = "https://github.com/NCAR/ParallelIO/archive/pio2_5_8.tar.gz" + git = "https://github.com/NCAR/ParallelIO.git" maintainers = ["jedwards4b"] @@ -33,6 +34,9 @@ class Parallelio(CMakePackage): depends_on("netcdf-fortran", type="link", when="+fortran") depends_on("parallel-netcdf", type="link", when="+pnetcdf") + # Allow argument mismatch in gfortran versions > 10 for mpi library compatibility + patch("gfortran.patch", when="+fortran %gcc@10:") + resource(name="genf90", git="https://github.com/PARALLELIO/genf90.git", tag="genf90_200608") def cmake_args(self): @@ -46,6 +50,8 @@ class Parallelio(CMakePackage): define("NetCDF_C_PATH", spec["netcdf-c"].prefix), define("USER_CMAKE_MODULE_PATH", join_path(src, "cmake")), define("GENF90_PATH", join_path(src, "genf90")), + define("BUILD_SHARED_LIBS", True), + define("PIO_ENABLE_EXAMPLES", False), ] if spec.satisfies("+pnetcdf"): args.extend( @@ -68,3 +74,8 @@ class Parallelio(CMakePackage): ] ) return args + + def url_for_version(self, version): + return "https://github.com/NCAR/ParallelIO/archive/pio{0}.tar.gz".format( + version.underscored + ) -- cgit v1.2.3-70-g09d2