ocramz / petsc-hs

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

There is no stack-build.sh #18

Closed idontgetoutmuch closed 8 years ago

idontgetoutmuch commented 8 years ago

I presume the README is out of data? I am trying stack install. I'll let you know how it goes.

idontgetoutmuch commented 8 years ago

No luck

petsc-hs-0.1.0.0: configure
Configuring petsc-hs-0.1.0.0...
setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: Missing dependencies on foreign
libraries:
* Missing C libraries: petsc, mpich, slepc, petsc, mpich, slepc
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
Completed 57 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 configure --with-ghc=/Applications/ghc-7.10.3.app/Contents/bin/ghc --with-ghc-pkg=/Applications/ghc-7.10.3.app/Contents/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/Users/dom/.stack/snapshots/x86_64-osx/lts-5.15/7.10.3/pkgdb --package-db=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/pkgdb --libdir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/lib --bindir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/bin --datadir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/share --libexecdir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/libexec --sysconfdir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/etc --docdir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/doc/petsc-hs-0.1.0.0 --htmldir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/doc/petsc-hs-0.1.0.0 --haddockdir=/Users/dom/petsc-hs/.stack-work/install/x86_64-osx/lts-5.15/7.10.3/doc/petsc-hs-0.1.0.0 --dependency=MonadRandom=MonadRandom-0.4.2.3-dd49b3845391786a2997e22f4819d480 --dependency=QuickCheck=QuickCheck-2.8.1-2d6cd004afd88b281717e42954a21ed2 --dependency=StateVar=StateVar-1.1.0.4-c870ecc28adfa9764b145a54f6a2c147 --dependency=ad=ad-4.3.2-82c688c04f026e41684f92d8465d9f1e --dependency=async=async-2.1.0-033e4fae4da028fc2d6502bd36e5e5a1 --dependency=base=base-4.8.2.0-cc43d8e06aa74e9c4c0132becc49ee25 --dependency=bytestring=bytestring-0.10.6.0-04b5cc1d05f993b3b016543ca2863add --dependency=comonad=comonad-4.2.7.2-7d67a51cf4db435c153f45fa7d74e97e --dependency=containers=containers-0.5.6.2-1281f6ac62b47acf472f6cdcec6a4f4b --dependency=contravariant=contravariant-1.4-8634ae5554789886ce5214ba6fe5ac65 --dependency=either=either-4.4.1-0730379c835dd87d6969e2b43ed09015 --dependency=free=free-4.12.4-2d518b8ed4fed46393fd1b3553776705 --dependency=hspec=hspec-2.2.3-890b00fc5d9edfd4c6a675753f716918 --dependency=inline-c=inline-c-0.5.5.1-ab0ac52217b73618e894c42be35e38ba --dependency=managed=managed-1.0.3-eeed40979ff2f8cfec3655e6188c4012 --dependency=mmorph=mmorph-1.0.6-386e846816bebe869399594490a5807f --dependency=monad-control=monad-control-1.0.1.0-84c4bc4b17198076c8ec507b90de89c9 --dependency=mtl=mtl-2.2.1-3af90341e75ee52dfc4e3143b4e5d219 --dependency=prelude-extras=prelude-extras-0.4.0.3-35d27727606bcd0bcd2c3491f65bf5b7 --dependency=profunctors=profunctors-5.2-cdb5218779e8f93246319b3e0474348e --dependency=semigroupoids=semigroupoids-5.0.1-0cb135bb4ded38a3defc504a1cc6e0c4 --dependency=split=split-0.2.3-8ed100aa18239d92816021c44aa12b38 --dependency=storable-complex=storable-complex-0.2.2-5d724e6255914e391bee90b30a4cef13 --dependency=template-haskell=template-haskell-2.10.0.0-c5036b5d1f11290a936c690d2f1bbd7f --dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 --dependency=transformers-base=transformers-base-0.4.4-19dc155e74aa624600f63b02f5f0b424 --dependency=vector=vector-0.11.0.0-324da2b07f25721d305480db94a9f1d6 --dependency=void=void-0.7.1-e5e6b39a216aab4d60ceff92bec9b941
    Process exited with code: ExitFailure 1
idontgetoutmuch commented 8 years ago

Ok so this gets me further:

~/petsc-hs $ stack install --extra-lib-dirs=/usr/local/Cellar/petsc/3.6.3_4/real/lib --extra-lib-dirs=/usr/local/Cellar/mpich/3.2/lib --extra-lib-dirs=/usr/local/opt/slepc/real/lib --extra-include-dirs=/usr/local/opt/petsc/include --extra-include-dirs=/usr/local/opt/mpich/include --extra-include-dirs=/usr/local/opt/slepc/include

And now I get

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

/usr/local/Cellar/petsc/3.6.3_4/real/include/petscsys.h:128:6:
     error: #error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"
     #    error "PETSc was configured with OpenMPI but now appears to be compiling using a non-OpenMPI mpi.h"
          ^

In file included from src/Numerical/PETSc/Internal/InlineC.c:16:0: 

/usr/local/Cellar/petsc/3.6.3_4/real/include/petscviewerhdf5.h:9:18:
     fatal error: hdf5.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
ocramz commented 8 years ago

Thank you @idontgetoutmuch , I'll fix the README; it seems like you configured PETSc with OpenMPI, whereas I've only tested petsc-hs against MPICH. The Travis build file contains a full configuration + build sequence of PETSc, SLEPc and petsc-hs.

ocramz commented 8 years ago

@idontgetoutmuch , I don't understand that missing hdf5.h import though. petscviewerhdf5.h imports it conditionally, (https://www.mcs.anl.gov/petsc/petsc-current/include/petscviewerhdf5.h.html), but I don't know how to scan the PETSc configuration variables from Haskell. So far I've assumed hdf5.h to be available

ocramz commented 8 years ago

@idontgetoutmuch Now the Travis CI-based installation is consistent with the README: stack-build.sh contains the stack setup and stack install steps, with the required extra directories. Looking forward to your feedback on the project; Thank you again!