From 09c344313fc3ca6d9de43c8128f7cdfcbc1a0222 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Sat, 18 Sep 2021 20:47:23 -0400 Subject: [PATCH 01/17] vendor PETSc --- T/TopOpt_in_PETSc/build_tarballs.jl | 112 ++++++++++++++++++ T/TopOpt_in_PETSc/bundled/Makefile | 24 ++++ .../bundled/patches/petsc_name_mangle.patch | 14 +++ 3 files changed, 150 insertions(+) create mode 100644 T/TopOpt_in_PETSc/build_tarballs.jl create mode 100644 T/TopOpt_in_PETSc/bundled/Makefile create mode 100644 T/TopOpt_in_PETSc/bundled/patches/petsc_name_mangle.patch diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl new file mode 100644 index 00000000000..30a374d39ee --- /dev/null +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -0,0 +1,112 @@ +# 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 = [ + ArchiveSource("https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.15.2.tar.gz", + "3b10c19c69fc42e01a38132668724a01f1da56f5c353105cd28f1120cc9041d8"), + 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 $WORKSPACE/srcdir/petsc* +atomic_patch -p1 $WORKSPACE/srcdir/patches/petsc_name_mangle.patch + +BLAS_LAPACK_LIB="${libdir}/libopenblas.${dlext}" + +if [[ "${target}" == *-mingw* ]]; then + #atomic_patch -p1 $WORKSPACE/srcdir/patches/fix-header-cases.patch + MPI_LIBS="${libdir}/msmpi.${dlext}" +else + MPI_LIBS="[${libdir}/libmpifort.${dlext},${libdir}/libmpi.${dlext}]" +fi + +build_petsc() +{ + + if [[ "${3}" == "Int64" ]]; then + USE_INT64=1 + else + USE_INT64=0 + fi + + ./configure --prefix=${prefix} \ + CC=${CC} \ + FC=${FC} \ + CXX=${CXX} \ + COPTFLAGS='-O3' \ + CXXOPTFLAGS='-O3' \ + CFLAGS='-fno-stack-protector' \ + 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 \ + --with-mpi-lib="${MPI_LIBS}" \ + --known-mpi-int64_t=0 \ + --with-mpi-include="${includedir}" \ + --with-sowing=0 \ + --with-precision=${1} \ + --with-scalar-type=${2} + + if [[ "${target}" == *-mingw* ]]; then + export CPPFLAGS="-Dpetsc_EXPORTS" + elif [[ "${target}" == powerpc64le-* ]]; then + export CFLAGS="-fPIC" + export FFLAGS="-fPIC" + 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 +} + +build_petsc double real Int32 + +cd ../TopOpt_in_PETSc +cp ../Makefile Makefile +make topopt +cp topopt ${bindir}/topopt +make libtopopt +cp libtopopt.$dlext ${libdir}/libtopopt.$dlext +""" + +# These are the platforms we will build for by default, unless further +# platforms are passed in on the command line +platforms = 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("OpenBLAS32_jll"), + Dependency("MPICH_jll"), + Dependency("MicrosoftMPI_jll"), + Dependency("CompilerSupportLibraries_jll"), +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"9") diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile new file mode 100644 index 00000000000..74902aee7bd --- /dev/null +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -0,0 +1,24 @@ +PETSC_DIR=${prefix} +PETSC_ARCH=x86_64-linux-gnu_double_real_Int32 +CFLAGS = -I. -fPIC -g +FFLAGS= +CPPFLAGS=-I. +FPPFLAGS= +LOCDIR= +EXAMPLESC= +EXAMPLESF= +MANSEC= +CLEANFILES= +NP= + +include ${PETSC_DIR}/lib/petsc/conf/variables +include ${PETSC_DIR}/lib/petsc/conf/rules +include ${PETSC_DIR}/lib/petsc/conf/test +$(info $$PETSC_SYS_LIB is [${PETSC_SYS_LIB}]) +topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o + -${CLINKER} -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o ${PETSC_SYS_LIB} +libtopopt: TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o + -${CLINKER} -o libtopopt.${dlext} TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o ${PETSC_SYS_LIB} -shared +myclean: + rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* + diff --git a/T/TopOpt_in_PETSc/bundled/patches/petsc_name_mangle.patch b/T/TopOpt_in_PETSc/bundled/patches/petsc_name_mangle.patch new file mode 100644 index 00000000000..1693a10b05f --- /dev/null +++ b/T/TopOpt_in_PETSc/bundled/patches/petsc_name_mangle.patch @@ -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') From 6d0b968fc3a6b72ec18e9b6edee7d398251e4f83 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Sat, 18 Sep 2021 20:56:37 -0400 Subject: [PATCH 02/17] Found license --- T/TopOpt_in_PETSc/build_tarballs.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 30a374d39ee..53d75cbd4f2 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -87,6 +87,7 @@ make topopt cp topopt ${bindir}/topopt make libtopopt cp libtopopt.$dlext ${libdir}/libtopopt.$dlext +install_license ${WORKSPACE}/srcdir/lesser.txt """ # These are the platforms we will build for by default, unless further From eb332b42fe5fcf994f3f22a7c46300a5dd996697 Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Tue, 21 Sep 2021 03:14:58 -0400 Subject: [PATCH 03/17] Fix license --- T/TopOpt_in_PETSc/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 53d75cbd4f2..b4cbec52795 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -87,7 +87,7 @@ make topopt cp topopt ${bindir}/topopt make libtopopt cp libtopopt.$dlext ${libdir}/libtopopt.$dlext -install_license ${WORKSPACE}/srcdir/lesser.txt +install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt """ # These are the platforms we will build for by default, unless further From dabfdd2510bfd7e9a41e2db513249c7d5374b28c Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Thu, 10 Mar 2022 02:11:24 -0500 Subject: [PATCH 04/17] build but can't run ./topopt --- T/TopOpt_in_PETSc/build_tarballs.jl | 78 +++-------------------------- T/TopOpt_in_PETSc/bundled/Makefile | 30 ++++------- 2 files changed, 18 insertions(+), 90 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index b4cbec52795..6e8714c1276 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -17,77 +17,18 @@ sources = [ # 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 $WORKSPACE/srcdir/petsc* -atomic_patch -p1 $WORKSPACE/srcdir/patches/petsc_name_mangle.patch -BLAS_LAPACK_LIB="${libdir}/libopenblas.${dlext}" - -if [[ "${target}" == *-mingw* ]]; then - #atomic_patch -p1 $WORKSPACE/srcdir/patches/fix-header-cases.patch - MPI_LIBS="${libdir}/msmpi.${dlext}" -else - MPI_LIBS="[${libdir}/libmpifort.${dlext},${libdir}/libmpi.${dlext}]" -fi - -build_petsc() -{ - - if [[ "${3}" == "Int64" ]]; then - USE_INT64=1 - else - USE_INT64=0 - fi - - ./configure --prefix=${prefix} \ - CC=${CC} \ - FC=${FC} \ - CXX=${CXX} \ - COPTFLAGS='-O3' \ - CXXOPTFLAGS='-O3' \ - CFLAGS='-fno-stack-protector' \ - 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 \ - --with-mpi-lib="${MPI_LIBS}" \ - --known-mpi-int64_t=0 \ - --with-mpi-include="${includedir}" \ - --with-sowing=0 \ - --with-precision=${1} \ - --with-scalar-type=${2} - - if [[ "${target}" == *-mingw* ]]; then - export CPPFLAGS="-Dpetsc_EXPORTS" - elif [[ "${target}" == powerpc64le-* ]]; then - export CFLAGS="-fPIC" - export FFLAGS="-fPIC" - 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 -} - -build_petsc double real Int32 - -cd ../TopOpt_in_PETSc +cd TopOpt_in_PETSc cp ../Makefile Makefile +make libtopopt make topopt +patchelf --replace-needed libpetsc.so.3.16 libpetsc_double_real_Int32.so ./topopt +patchelf --replace-needed libpetsc.so.3.16 libpetsc_double_real_Int32.so ./libtopopt.so cp topopt ${bindir}/topopt -make libtopopt cp libtopopt.$dlext ${libdir}/libtopopt.$dlext install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt +# just for testing purposes: +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/workspace/destdir/lib/petsc/double_real_Int32/lib """ # These are the platforms we will build for by default, unless further @@ -103,11 +44,8 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency("OpenBLAS32_jll"), - Dependency("MPICH_jll"), - Dependency("MicrosoftMPI_jll"), - Dependency("CompilerSupportLibraries_jll"), + Dependency("PETSc_jll", v"3.16.5"; compat="3.16.5") ] # Build the tarballs, and possibly a `build.jl` as well. -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") diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index 74902aee7bd..2a604225447 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -1,24 +1,14 @@ -PETSC_DIR=${prefix} +PETSC_DIR=$(prefix)/lib/petsc/double_real_Int32 PETSC_ARCH=x86_64-linux-gnu_double_real_Int32 -CFLAGS = -I. -fPIC -g -FFLAGS= -CPPFLAGS=-I. -FPPFLAGS= -LOCDIR= -EXAMPLESC= -EXAMPLESF= -MANSEC= -CLEANFILES= -NP= - -include ${PETSC_DIR}/lib/petsc/conf/variables -include ${PETSC_DIR}/lib/petsc/conf/rules -include ${PETSC_DIR}/lib/petsc/conf/test -$(info $$PETSC_SYS_LIB is [${PETSC_SYS_LIB}]) +CXXFLAGS = -fPIC +CPPFLAGS=-I. -I$(includedir) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/ +LDFLAGS= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib -Wl,-rpath,/workspace/destdir/lib -L/workspace/destdir/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/lib/gcc -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib +LDLIBS= -l:libpetsc_double_real_Int32.so -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - -${CLINKER} -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o ${PETSC_SYS_LIB} + $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) + libtopopt: TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - -${CLINKER} -o libtopopt.${dlext} TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o ${PETSC_SYS_LIB} -shared -myclean: - rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* + $(CC) $(CPPFLAGS) -v -shared -o libtopopt.$(dlext) TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) +myclean: + rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* \ No newline at end of file From 1a048dc0cbdf4314dfdbc49f4509bec3208ae0db Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Fri, 11 Mar 2022 13:01:24 -0500 Subject: [PATCH 05/17] rm PETSc local build, rm patchelf --- T/TopOpt_in_PETSc/build_tarballs.jl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 6e8714c1276..21b35afae61 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -7,8 +7,6 @@ version = v"0.1" # Collection of sources required to complete build sources = [ - ArchiveSource("https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.15.2.tar.gz", - "3b10c19c69fc42e01a38132668724a01f1da56f5c353105cd28f1120cc9041d8"), GitSource("https://github.com/topopt/TopOpt_in_PETSc", "26eecbf3b1d0135956e0364d77c30e43e9bc3db2"), DirectorySource("./bundled"), ] @@ -22,13 +20,9 @@ cd TopOpt_in_PETSc cp ../Makefile Makefile make libtopopt make topopt -patchelf --replace-needed libpetsc.so.3.16 libpetsc_double_real_Int32.so ./topopt -patchelf --replace-needed libpetsc.so.3.16 libpetsc_double_real_Int32.so ./libtopopt.so cp topopt ${bindir}/topopt cp libtopopt.$dlext ${libdir}/libtopopt.$dlext install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt -# just for testing purposes: -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/workspace/destdir/lib/petsc/double_real_Int32/lib """ # These are the platforms we will build for by default, unless further From 6e23a99f8136626759ab89d2b3349f10008314ec Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Fri, 11 Mar 2022 13:14:53 -0500 Subject: [PATCH 06/17] typo --- T/TopOpt_in_PETSc/bundled/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index 2a604225447..06c22bda369 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -2,8 +2,8 @@ PETSC_DIR=$(prefix)/lib/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= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib -Wl,-rpath,/workspace/destdir/lib -L/workspace/destdir/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/lib/gcc -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -LDLIBS= -l:libpetsc_double_real_Int32.so -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -ldl +LDFLAGS= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real_Int32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib -Wl,-rpath,/workspace/destdir/lib -L/workspace/destdir/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/lib/gcc -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib +LDLIBS= -l:libpetsc_double_real_Int32.so -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) From 14abb7ee4fa0bc2c4171745054745123784169f7 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Fri, 11 Mar 2022 13:45:28 -0500 Subject: [PATCH 07/17] expand cxxstrings --- T/TopOpt_in_PETSc/build_tarballs.jl | 2 +- T/TopOpt_in_PETSc/bundled/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 21b35afae61..fdf081200eb 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -27,7 +27,7 @@ install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt # These are the platforms we will build for by default, unless further # platforms are passed in on the command line -platforms = expand_gfortran_versions(supported_platforms(exclude=[Platform("i686", "windows")])) +platforms = expand_cxxstring_abis(expand_gfortran_versions(supported_platforms(exclude=[Platform("i686", "windows")]))) # The products that we will ensure are always built diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index 06c22bda369..b1a174b0d81 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -3,7 +3,7 @@ PETSC_ARCH=x86_64-linux-gnu_double_real_Int32 CXXFLAGS = -fPIC CPPFLAGS=-I. -I$(includedir) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/ LDFLAGS= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real_Int32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib -Wl,-rpath,/workspace/destdir/lib -L/workspace/destdir/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/lib/gcc -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -LDLIBS= -l:libpetsc_double_real_Int32.so -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl +LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) From 5c32c62f7f7878bee09334e9344464176ec1b689 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Fri, 11 Mar 2022 13:47:52 -0500 Subject: [PATCH 08/17] add CompilerSupportLibs --- T/TopOpt_in_PETSc/build_tarballs.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index fdf081200eb..6a83b02cf57 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -38,7 +38,8 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency("PETSc_jll", v"3.16.5"; compat="3.16.5") + Dependency("PETSc_jll", v"3.16.5"; 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. From 4cb8f451fbc7d04a33eb912af1bfa23e94411397 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Fri, 11 Mar 2022 15:06:46 -0500 Subject: [PATCH 09/17] remove most of the rpaths --- T/TopOpt_in_PETSc/bundled/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index b1a174b0d81..e815fcc3caa 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -2,7 +2,7 @@ PETSC_DIR=$(prefix)/lib/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= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real_Int32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib -Wl,-rpath,/workspace/destdir/lib -L/workspace/destdir/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -L/opt/x86_64-linux-gnu/lib/gcc/x86_64-linux-gnu/9.1.0 -Wl,-rpath,/opt/x86_64-linux-gnu/lib/gcc -L/opt/x86_64-linux-gnu/lib/gcc -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib64 -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/lib -Wl,-rpath,/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib -L/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/lib +LDFLAGS= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real_Int32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) From ef5649299cc33611b4bcef78420cacaf622042bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 11 Mar 2022 20:49:06 +0000 Subject: [PATCH 10/17] Update T/TopOpt_in_PETSc/bundled/Makefile --- T/TopOpt_in_PETSc/bundled/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index e815fcc3caa..b4bc547e307 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -2,7 +2,7 @@ PETSC_DIR=$(prefix)/lib/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= -Wl,-rpath,/workspace/destdir/lib/petsc/double_real_Int32/lib -L/workspace/destdir/lib/petsc/double_real_Int32/lib +LDFLAGS= -Wl,-rpath-link,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) From 4d57220c6603b267600df7d18ee4ad20effded05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 11 Mar 2022 20:59:44 +0000 Subject: [PATCH 11/17] Apply suggestions from code review --- T/TopOpt_in_PETSc/bundled/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index b4bc547e307..cdf998f87d2 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -2,13 +2,13 @@ PETSC_DIR=$(prefix)/lib/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= -Wl,-rpath-link,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib +LDFLAGS= -Wl,-rpath,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - $(CC) $(CPPFLAGS) -v -o topopt main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) + $(CC) $(CPPFLAGS) -v -o topopt $^ $(LDFLAGS) $(LDLIBS) -libtopopt: TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - $(CC) $(CPPFLAGS) -v -shared -o libtopopt.$(dlext) TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o $(LDFLAGS) $(LDLIBS) +libtopopt.$(dlext): TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o + $(CC) $(CPPFLAGS) -v -shared -o libtopopt.$(dlext) $^ $(LDFLAGS) $(LDLIBS) myclean: - rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* \ No newline at end of file + rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* From 3319237cddea1a5a93a0197c0dc9c3d920adb87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 11 Mar 2022 21:11:13 +0000 Subject: [PATCH 12/17] Apply suggestions from code review --- T/TopOpt_in_PETSc/build_tarballs.jl | 3 +-- T/TopOpt_in_PETSc/bundled/Makefile | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 6a83b02cf57..459569c6213 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -18,8 +18,7 @@ script = raw""" cd TopOpt_in_PETSc cp ../Makefile Makefile -make libtopopt -make topopt +make libtopopt.${dlext} topopt${exeext} cp topopt ${bindir}/topopt cp libtopopt.$dlext ${libdir}/libtopopt.$dlext install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index cdf998f87d2..6889a93f275 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -4,11 +4,11 @@ CXXFLAGS = -fPIC CPPFLAGS=-I. -I$(includedir) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/ LDFLAGS= -Wl,-rpath,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl -topopt: main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - $(CC) $(CPPFLAGS) -v -o topopt $^ $(LDFLAGS) $(LDLIBS) +topopt$(exeext): main.o TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o + $(CC) $(CPPFLAGS) -v -o $@ $^ $(LDFLAGS) $(LDLIBS) libtopopt.$(dlext): TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - $(CC) $(CPPFLAGS) -v -shared -o libtopopt.$(dlext) $^ $(LDFLAGS) $(LDLIBS) + $(CC) $(CPPFLAGS) -v -shared -o $@ $^ $(LDFLAGS) $(LDLIBS) myclean: rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* From f8f37f00650b039e252ecff099b64990fb53be33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 11 Mar 2022 23:53:18 +0000 Subject: [PATCH 13/17] Update T/TopOpt_in_PETSc/bundled/Makefile --- T/TopOpt_in_PETSc/bundled/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index 6889a93f275..ed39d6fb361 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -1,4 +1,4 @@ -PETSC_DIR=$(prefix)/lib/petsc/double_real_Int32 +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)/ From 3a175eeeede33dc402c9ece1444cb548cbe900ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 12 Mar 2022 22:04:45 +0000 Subject: [PATCH 14/17] [TopOpt_in_PETSc] Fixes for macOS and Windows --- T/TopOpt_in_PETSc/build_tarballs.jl | 12 +++++------- T/TopOpt_in_PETSc/bundled/Makefile | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 459569c6213..31186804e55 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -15,13 +15,11 @@ sources = [ # 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 -cp ../Makefile Makefile -make libtopopt.${dlext} topopt${exeext} -cp topopt ${bindir}/topopt -cp libtopopt.$dlext ${libdir}/libtopopt.$dlext -install_license ${WORKSPACE}/srcdir/TopOpt_in_PETSc/lesser.txt +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 @@ -37,7 +35,7 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency("PETSc_jll", v"3.16.5"; compat="3.16.5"), + Dependency("PETSc_jll"; compat="3.16.5"), Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")) ] diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index ed39d6fb361..35f03e0e3de 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -1,14 +1,20 @@ -PETSC_DIR=$(libdir)/petsc/double_real_Int32 -PETSC_ARCH=x86_64-linux-gnu_double_real_Int32 +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= -Wl,-rpath,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib -LDLIBS= -lpetsc_double_real_Int32 -lopenblas -lpthread -lm -lmpifort -lmpi -lstdc++ -ldl -lgfortran -lm -lgfortran -lm -lgcc_s -lstdc++ -ldl +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 - $(CC) $(CPPFLAGS) -v -o $@ $^ $(LDFLAGS) $(LDLIBS) + $(CXX) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) libtopopt.$(dlext): TopOpt.o LinearElasticity.o MMA.o Filter.o PDEFilter.o MPIIO.o - $(CC) $(CPPFLAGS) -v -shared -o $@ $^ $(LDFLAGS) $(LDLIBS) + $(CXX) $(CPPFLAGS) -shared -o $@ $^ $(LDFLAGS) $(LDLIBS) -myclean: - rm -rf topopt *.o output* binary* log* makevtu.pyc Restart* +clean: + rm -rf topopt$(exeext) libtopopt.$(dlext) *.o output* binary* log* makevtu.pyc Restart* From abf9da99078eca016e2b385d05cd2095956983da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 12 Mar 2022 22:14:44 +0000 Subject: [PATCH 15/17] [TopOpt_in_PETSc] No need to expand libgfortran versions --- T/TopOpt_in_PETSc/build_tarballs.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/T/TopOpt_in_PETSc/build_tarballs.jl b/T/TopOpt_in_PETSc/build_tarballs.jl index 31186804e55..40fb05caf84 100644 --- a/T/TopOpt_in_PETSc/build_tarballs.jl +++ b/T/TopOpt_in_PETSc/build_tarballs.jl @@ -24,8 +24,7 @@ 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")]))) - +platforms = expand_cxxstring_abis(supported_platforms(exclude=[Platform("i686", "windows")])) # The products that we will ensure are always built products = [ From b7f1d62ed9cb6af5aaa3dad963ac66b7e9781b3a Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Sat, 12 Mar 2022 22:33:55 -0500 Subject: [PATCH 16/17] Update Makefile --- T/TopOpt_in_PETSc/bundled/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index 35f03e0e3de..c48c98e58c2 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -1,7 +1,5 @@ -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)/ +CPPFLAGS =-I. -I$(includedir) -I$(libdir)/petsc/double_real_Int32/include -I$(libdir)/petsc/double_real_Int32/ 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))) From 804a14c13c824b29ce6305586456978212d49fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 13 Mar 2022 16:21:25 +0000 Subject: [PATCH 17/17] Update Makefile --- T/TopOpt_in_PETSc/bundled/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/T/TopOpt_in_PETSc/bundled/Makefile b/T/TopOpt_in_PETSc/bundled/Makefile index c48c98e58c2..08ba2ca8bef 100644 --- a/T/TopOpt_in_PETSc/bundled/Makefile +++ b/T/TopOpt_in_PETSc/bundled/Makefile @@ -1,6 +1,6 @@ CXXFLAGS = -fPIC CPPFLAGS =-I. -I$(includedir) -I$(libdir)/petsc/double_real_Int32/include -I$(libdir)/petsc/double_real_Int32/ -LDFLAGS = -L${libdir} -Wl,-rpath,${libdir}/petsc/double_real_Int32/lib -L${libdir}/petsc/double_real_Int32/lib +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