Smothered-particle hydrodynamics simulation of liquids written in Haskell.
To build and run the project using Stack use:
stack runOr using Cabal:
cabal run SPHSimulation-exeIn case of having problems with OpenGL install freeglut
macOS:
brew install freeglutArch Linux:
sudo pacman -Sy --noconfirm freeglut- Create
NewFileName.hsin./srcfolder
Important: Filename should start with capital letter
- Head of the file should contain module declaration
module NewFileName where- Import this module to
./app/Main.hs
import NewFileName- Update
./SPHSimulation.cabalcorrespondingly
library
exposed-modules:
Lib
Objects
NewFileNameIn some case you may want to profile program.
You first need to reinstall packages with profiling capabilities
cabal install --reinstall --enable-profiling
Then edit cabal configuration (SPHSimulation.cabal) with such ghc options
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -p" -prof -O2
And finally run with profiling enabled
cabal run SPHSimulation-exe --enable-profiling
You will find *.prof file at root dir of project
