-
Notifications
You must be signed in to change notification settings - Fork 647
[TopOpt_in_PETSc] WIP: new builder #3648
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
09c3443
vendor PETSc
6d0b968
Found license
eb332b4
Fix license
dabfdd2
build but can't run ./topopt
rayegun 1a048dc
rm PETSc local build, rm patchelf
rayegun 6e23a99
typo
rayegun 14abb7e
expand cxxstrings
rayegun 5c32c62
add CompilerSupportLibs
rayegun 4cb8f45
remove most of the rpaths
rayegun ef56492
Update T/TopOpt_in_PETSc/bundled/Makefile
giordano 4d57220
Apply suggestions from code review
giordano 3319237
Apply suggestions from code review
giordano f8f37f0
Update T/TopOpt_in_PETSc/bundled/Makefile
giordano 3a175ee
[TopOpt_in_PETSc] Fixes for macOS and Windows
giordano abf9da9
[TopOpt_in_PETSc] No need to expand libgfortran versions
giordano b7f1d62
Update Makefile
rayegun 804a14c
Update Makefile
giordano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Note that this script can accept some limited command-line arguments, run | ||
| # `julia build_tarballs.jl --help` to see a usage message. | ||
| using BinaryBuilder, Pkg | ||
|
|
||
| name = "TopOpt_in_PETSc" | ||
| version = v"0.1" | ||
|
|
||
| # Collection of sources required to complete build | ||
| sources = [ | ||
| GitSource("https://github.com/topopt/TopOpt_in_PETSc", "26eecbf3b1d0135956e0364d77c30e43e9bc3db2"), | ||
| DirectorySource("./bundled"), | ||
| ] | ||
|
|
||
| # Bash recipe for building across all platforms | ||
| # New makefiles added, the patches fix some weird include issues mostly. | ||
| # There is likely a better way to fix them, or upstream the fixes. | ||
| script = raw""" | ||
| cd TopOpt_in_PETSc | ||
| make -f ../Makefile libtopopt.${dlext} topopt${exeext} | ||
| install -Dvm 755 "topopt${exeext}" "${bindir}/topopt${exeext}" | ||
| install -Dvm 755 "libtopopt.${dlext}" "${libdir}/libtopopt.${dlext}" | ||
| install_license lesser.txt | ||
| """ | ||
|
|
||
| # These are the platforms we will build for by default, unless further | ||
| # platforms are passed in on the command line | ||
| platforms = expand_cxxstring_abis(expand_gfortran_versions(supported_platforms(exclude=[Platform("i686", "windows")]))) | ||
|
|
||
|
|
||
| # The products that we will ensure are always built | ||
| products = [ | ||
| LibraryProduct("libtopopt", :libtopopt), | ||
| ExecutableProduct("topopt", :topopt) | ||
| ] | ||
|
|
||
| # Dependencies that must be installed before this package can be built | ||
| dependencies = [ | ||
| Dependency("PETSc_jll"; compat="3.16.5"), | ||
| Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")) | ||
| ] | ||
|
|
||
| # Build the tarballs, and possibly a `build.jl` as well. | ||
| build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version=v"9") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| PETSC_DIR = $(libdir)/petsc/double_real_Int32 | ||
| PETSC_ARCH = x86_64-linux-gnu_double_real_Int32 | ||
| CXXFLAGS = -fPIC | ||
| CPPFLAGS =-I. -I$(includedir) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/ | ||
| LDFLAGS = -L${libdir} -Wl,-rpath,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib | ||
| LDLIBS = -lpetsc_double_real_Int32 | ||
| ifneq (,$(findstring mingw,$(target))) | ||
| LDLIBS += -lmsmpi | ||
| else | ||
| LDLIBS += -lmpi | ||
| endif | ||
|
|
||
| topopt$(exeext): main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o | ||
| $(CXX) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) | ||
|
|
||
| libtopopt.$(dlext): TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o | ||
| $(CXX) $(CPPFLAGS) -shared -o $@ $^ $(LDFLAGS) $(LDLIBS) | ||
|
|
||
| clean: | ||
| rm -rf topopt$(exeext) libtopopt.$(dlext) *.o output* binary* log* makevtu.pyc Restart* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| diff --git a/config/BuildSystem/config/packages/BlasLapack.py b/config/BuildSystem/config/packages/BlasLapack.py | ||
| index bbae50c096..9ad0a994eb 100644 | ||
| --- a/config/BuildSystem/config/packages/BlasLapack.py | ||
| +++ b/config/BuildSystem/config/packages/BlasLapack.py | ||
| @@ -121,7 +121,8 @@ class Configure(config.package.Package): | ||
| foundLapack = 0 | ||
| self.f2c = 0 | ||
| # allow a user-specified suffix to be appended to BLAS/LAPACK symbols | ||
| - self.suffix = self.argDB.get('with-blaslapack-suffix', '') | ||
| + # argDB return a list when with-blaslapack-suffix is used | ||
| + self.suffix = self.argDB.get('with-blaslapack-suffix', '')[0] | ||
| mangleFunc = self.compilers.fortranMangling | ||
| self.logPrint('Checking for Fortran name mangling '+mangleFunc+' on BLAS/LAPACK') | ||
| foundBlas = self.checkBlas(blasLibrary, self.getOtherLibs(foundBlas, blasLibrary), mangleFunc,'dot') |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.