-
Notifications
You must be signed in to change notification settings - Fork 698
[PETSc] Attempt to rebuild with good include files (and don't rename libpetsc) #3801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
345779f
b289066
ff50a5b
f9a79e0
5fe010c
139a35c
892ab65
4e2d35a
af03beb
1f98c2f
4b36955
3919ea3
4d8c7f4
f5f4434
5d04c50
224a420
9bbba08
7425907
fc8cfbf
2b4eda4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ version = v"3.15.2" | |
| # 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", | ||
| ArchiveSource("https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-$(version).tar.gz", | ||
| "3b10c19c69fc42e01a38132668724a01f1da56f5c353105cd28f1120cc9041d8"), | ||
| 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,10 @@ 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 | ||
|
|
||
| # 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}" | ||
| else | ||
| mv ${prefix}/lib/libpetsc.${dlext}.*.*.* "${libdir}/libpetsc_${1}_${2}_${3}.${dlext}" | ||
| fi | ||
| # Remove useless links | ||
| rm ${prefix}/lib/libpetsc.* | ||
| # Remove duplicated file | ||
| rm ${prefix}/lib/pkgconfig/PETSc.pc | ||
| FFLAGS="${FFLAGS}" | ||
| make install | ||
| } | ||
|
|
||
| build_petsc double real Int32 | ||
|
|
@@ -103,15 +85,16 @@ 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", :libpetsc, "\$libdir/petsc/double_real_Int32/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float64_Real_Int32, "\$libdir/petsc/double_real_Int32/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float64_Real_Int64, "\$libdir/petsc/double_real_Int64/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float32_Real_Int64, "\$libdir/petsc/single_real_Int64/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float64_Complex_Int64, "\$libdir/petsc/double_complex_Int64/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float32_Complex_Int64, "\$libdir/petsc/single_complex_Int64/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float32_Real_Int32, "\$libdir/petsc/single_real_Int32/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float64_Complex_Int32, "\$libdir/petsc/double_complex_Int32/lib") | ||
| LibraryProduct("libpetsc", :libpetsc_Float32_Complex_Int32, "\$libdir/petsc/single_complex_Int32/lib") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that I think of this, all these libraries are called Either we don't dlopen the libraries and users will have to take care of that, or I don't know what you want to do.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where they're found. https://github.com/JuliaParallel/PETSc.jl/blob/main/src/startup.jl
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't realize PETSC.jl will open multiple at once, that is problematic.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to dlopen all of them at the same time, they must not have all the same name, it can't possibly work because that's how dlopen works (this is in general, not Julia-specific). If you want to open only one library, we can set
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How is PETSc.jl doing this then? Do they require that you rename |
||
| ] | ||
|
|
||
| dependencies = [ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.