diff --git a/P/PETSc/build_tarballs.jl b/P/PETSc/build_tarballs.jl index 334938eead8..3c83579ad3f 100644 --- a/P/PETSc/build_tarballs.jl +++ b/P/PETSc/build_tarballs.jl @@ -1,13 +1,13 @@ using BinaryBuilder name = "PETSc" -version = v"3.15.2" +version = v"3.16.5" # Collection of sources required to build PETSc. Avoid using the git repository, it will # require building SOWING which fails in all non-linux platforms. sources = [ - ArchiveSource("https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.15.2.tar.gz", - "3b10c19c69fc42e01a38132668724a01f1da56f5c353105cd28f1120cc9041d8"), + ArchiveSource("https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-$(version).tar.gz", + "7de8570eeb94062752d82a83208fc2bafc77b3f515023a4c14d8ff9440e66cac"), DirectorySource("./bundled"), ] @@ -24,7 +24,7 @@ if [[ "${target}" == *-mingw* ]]; then else MPI_LIBS="[${libdir}/libmpifort.${dlext},${libdir}/libmpi.${dlext}]" fi - +mkdir $libdir/petsc build_petsc() { @@ -33,19 +33,19 @@ build_petsc() else USE_INT64=0 fi - - ./configure --prefix=${prefix} \ + mkdir $libdir/petsc/${1}_${2}_${3} + ./configure --prefix=${libdir}/petsc/${1}_${2}_${3} \ CC=${CC} \ FC=${FC} \ CXX=${CXX} \ COPTFLAGS='-O3' \ CXXOPTFLAGS='-O3' \ CFLAGS='-fno-stack-protector' \ + LDFLAGS="-L${libdir}" \ FOPTFLAGS='-O3' \ --with-64-bit-indices=${USE_INT64} \ --with-debugging=0 \ --with-batch \ - --PETSC_ARCH=${target}_${1}_${2}_${3} \ --with-blaslapack-lib=$BLAS_LAPACK_LIB \ --with-blaslapack-suffix="" \ --known-64-bit-blas-indices=0 \ @@ -54,7 +54,8 @@ build_petsc() --with-mpi-include="${includedir}" \ --with-sowing=0 \ --with-precision=${1} \ - --with-scalar-type=${2} + --with-scalar-type=${2} \ + --PETSC_ARCH=${target}_${1}_${2}_${3} if [[ "${target}" == *-mingw* ]]; then export CPPFLAGS="-Dpetsc_EXPORTS" @@ -64,29 +65,19 @@ build_petsc() fi make -j${nproc} \ - PETSC_DIR="${PWD}" \ - PETSC_ARCH="${target}_${1}_${2}_${3}" \ CPPFLAGS="${CPPFLAGS}" \ CFLAGS="${CFLAGS}" \ - FFLAGS="${FFLAGS}" \ - DEST_DIR="${prefix}" \ - all - - make PETSC_DIR=$PWD PETSC_ARCH=${target}_${1}_${2}_${3} DEST_DIR=$prefix install + FFLAGS="${FFLAGS}" + make install - # add suffix to library name - if [[ "${target}" == *-mingw* ]]; then - # changing the extension from so to dll. - mv ${prefix}/lib/libpetsc.so.*.*.* "${libdir}/libpetsc_${1}_${2}_${3}.${dlext}" - elif [[ "${target}" == *-apple* ]]; then - mv ${prefix}/lib/libpetsc.*.*.*.${dlext} "${libdir}/libpetsc_${1}_${2}_${3}.${dlext}" + if [[ "${target}" == *-apple* ]]; then + mv ${libdir}/petsc/${1}_${2}_${3}/lib/libpetsc.*.*.*.${dlext} "${libdir}/petsc/${1}_${2}_${3}/lib/libpetsc_${1}_${2}_${3}.${dlext}" else - mv ${prefix}/lib/libpetsc.${dlext}.*.*.* "${libdir}/libpetsc_${1}_${2}_${3}.${dlext}" + mv ${libdir}/petsc/${1}_${2}_${3}/lib/libpetsc.${dlext}.*.*.* "${libdir}/petsc/${1}_${2}_${3}/lib/libpetsc_${1}_${2}_${3}.${dlext}" fi - # Remove useless links - rm ${prefix}/lib/libpetsc.* - # Remove duplicated file - rm ${prefix}/lib/pkgconfig/PETSc.pc + + # Remove now broken(?) links + rm ${libdir}/petsc/${1}_${2}_${3}/lib/libpetsc.* } build_petsc double real Int32 @@ -103,23 +94,24 @@ build_petsc single complex Int64 platforms = expand_gfortran_versions(supported_platforms(exclude=[Platform("i686", "windows")])) products = [ - LibraryProduct("libpetsc_double_real_Int32", :libpetsc), # Current default build - LibraryProduct("libpetsc_double_real_Int64", :libpetsc_Float64_Real_Int64), - LibraryProduct("libpetsc_single_real_Int64", :libpetsc_Float32_Real_Int64), - LibraryProduct("libpetsc_double_complex_Int64", :libpetsc_Float64_Complex_Int64), - LibraryProduct("libpetsc_single_complex_Int64", :libpetsc_Float32_Complex_Int64), - LibraryProduct("libpetsc_double_real_Int32", :libpetsc_Float64_Real_Int32), - LibraryProduct("libpetsc_single_real_Int32", :libpetsc_Float32_Real_Int32), - LibraryProduct("libpetsc_double_complex_Int32", :libpetsc_Float64_Complex_Int32), - LibraryProduct("libpetsc_single_complex_Int32", :libpetsc_Float32_Complex_Int32), + # Current default build, equivalent to Float64_Real_Int32 + LibraryProduct("libpetsc_double_real_Int32", :libpetsc, "\$libdir/petsc/double_real_Int32/lib") + LibraryProduct("libpetsc_double_real_Int32", :libpetsc_Float64_Real_Int32, "\$libdir/petsc/double_real_Int32/lib") + LibraryProduct("libpetsc_double_real_Int64", :libpetsc_Float64_Real_Int64, "\$libdir/petsc/double_real_Int64/lib") + LibraryProduct("libpetsc_single_real_Int64", :libpetsc_Float32_Real_Int64, "\$libdir/petsc/single_real_Int64/lib") + LibraryProduct("libpetsc_double_complex_Int64", :libpetsc_Float64_Complex_Int64, "\$libdir/petsc/double_complex_Int64/lib") + LibraryProduct("libpetsc_single_complex_Int64", :libpetsc_Float32_Complex_Int64, "\$libdir/petsc/single_complex_Int64/lib") + LibraryProduct("libpetsc_single_real_Int32", :libpetsc_Float32_Real_Int32, "\$libdir/petsc/single_real_Int32/lib") + LibraryProduct("libpetsc_double_complex_Int32", :libpetsc_Float64_Complex_Int32, "\$libdir/petsc/double_complex_Int32/lib") + LibraryProduct("libpetsc_single_complex_Int32", :libpetsc_Float32_Complex_Int32, "\$libdir/petsc/single_complex_Int32/lib") ] dependencies = [ Dependency("OpenBLAS32_jll"), - Dependency("MPICH_jll"), - Dependency("MicrosoftMPI_jll"), + Dependency("MPICH_jll"; platforms=filter(!Sys.iswindows, platforms)), + Dependency("MicrosoftMPI_jll"; platforms=filter(Sys.iswindows, platforms)), Dependency("CompilerSupportLibraries_jll"), ] # Build the tarballs. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"9") +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version = v"9")