ocramz / petsc-hs

Haskell bindings for PETSc and SLEPc
GNU General Public License v3.0
20 stars 4 forks source link

petsc and slepc incompatibility #19

Closed idontgetoutmuch closed 8 years ago

idontgetoutmuch commented 8 years ago

I abandoned my efforts with homebrew and managed to install petsc 3.7 using ./install-petsc.sh. But then slepc failed to install

./install-slepc.sh $SLEPC_VERSION $SLEPC_DIR
--2016-05-08 07:54:25--  http://slepc.upv.es/download/download.php?filename=slepc-3.6.3.tar.gz
Resolving slepc.upv.es... 158.42.186.117
Connecting to slepc.upv.es|158.42.186.117|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://slepc.upv.es/download/distrib/slepc-3.6.3.tar.gz [following]
--2016-05-08 07:54:25--  http://slepc.upv.es/download/distrib/slepc-3.6.3.tar.gz
Reusing existing connection to slepc.upv.es:80.
HTTP request sent, awaiting response... 200 OK
Length: 3560220 (3.4M) [application/x-gzip]
Saving to: 'slepc.tar.gz'

slepc.tar.gz        100%[=====================>]   3.39M  1.59MB/s   in 2.1s   

2016-05-08 07:54:27 (1.59 MB/s) - 'slepc.tar.gz' saved [3560220/3560220]

Checking environment...
ERROR: This SLEPc version is not compatible with PETSc version 3.7
makefile:30: arch-darwin-c-debug/lib/slepc/conf/slepcvariables: No such file or directory
/Users/dom/slepc-3.6.3/lib/slepc/conf/slepc_variables:64: /Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcvariables: No such file or directory
/Users/dom/slepc-3.6.3/lib/slepc/conf/slepc_rules:219: /Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcrules: No such file or directory
make: *** No rule to make target `/Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcrules'.  Stop.
makefile:30: arch-darwin-c-debug/lib/slepc/conf/slepcvariables: No such file or directory
/Users/dom/slepc-3.6.3/lib/slepc/conf/slepc_variables:64: /Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcvariables: No such file or directory
/Users/dom/slepc-3.6.3/lib/slepc/conf/slepc_rules:219: /Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcrules: No such file or directory
make: *** No rule to make target `/Users/dom/slepc-3.6.3/arch-darwin-c-debug/lib/slepc/conf/slepcrules'.  Stop.

I see you have already tripped over this.

https://www.mail-archive.com/petsc-users@mcs.anl.gov/msg28697.html

Did you go back to an earlier version of petsc?

idontgetoutmuch commented 8 years ago

I managed to get both slepc and petsc to install both from tags 3.6.3 but now I get

/Users/dom/petsc-hs/src/Numerical/PETSc/Internal/InlineC.c:2:23:
     fatal error: petscsnes.h: No such file or directory
compilation terminated.
Completed 2 action(s).

--  While building package petsc-hs-0.1.0.0 using:
      /Users/dom/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 build lib:petsc-hs exe:petsc-example --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

and there is no such file in my petsc installation.

idontgetoutmuch commented 8 years ago

My include files were incorrect. I am now using

~/petsc-hs $ stack install
--extra-lib-dirs=/Users/dom/petsc/arch-darwin-c-debug/lib
--extra-lib-dirs=/Users/dom/slepc/arch-darwin-c-debug/lib
--extra-include-dirs=/Users/dom/petsc/include
--extra-include-dirs=/Users/dom/slepc/include

but now I get a different error

/Users/dom/petsc-hs/src/Numerical/PETSc.hs:3:1: Warning:
    The import of ‘Numerical.PETSc.Internal.PutGet’ is redundant
      except perhaps to import instances from ‘Numerical.PETSc.Internal.PutGet’
    To import instances alone, use: import Numerical.PETSc.Internal.PutGet()

In file included from /Users/dom/petsc/include/petscis.h:7:0:
    0,
                     from /Users/dom/petsc/include/petscvec.h:9,
                     from /Users/dom/petsc/include/petscmat.h:6,
                     from /Users/dom/petsc/include/petscpc.h:6,
                     from /Users/dom/petsc/include/petscksp.h:6,
                     from /Users/dom/petsc/include/petscsnes.h:6,
                     from src/Numerical/PETSc/Internal/InlineC.c:2:

/Users/dom/petsc/include/petscsys.h:14:23:
     fatal error: petscconf.h: No such file or directory
compilation terminated.
Completed 2 action(s).

--  While building package petsc-hs-0.1.0.0 using:
      /Users/dom/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 build lib:petsc-hs exe:petsc-example --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
```¯
idontgetoutmuch commented 8 years ago

It has now installed - that was something of an odyssey.

stack install
--extra-lib-dirs=/Users/dom/petsc/arch-darwin-c-debug/lib
--extra-lib-dirs=/Users/dom/slepc/arch-darwin-c-debug/lib
--extra-include-dirs=/Users/dom/petsc/include
--extra-include-dirs=/Users/dom/slepc/include
--extra-include-dirs=/Users/dom/petsc/arch-darwin-c-debug/include
--extra-include-dirs=/Users/dom/slepc/arch-darwin-c-debug/include
ocramz commented 8 years ago

Yes, the PETSc architecture (and SLEPc too) requires both the main includes and the header files generated after compilation. This information was already present both in the provided Makefile, in stack-build.sh and in the Travis CI file.

Re. the latest PETSc, I'll try to support PETSc 3.7 after SLEPc 3.7 becomes available (upcoming weeks).