[cabal] add -O2 optimizations to cabal.project

Also, update README with remark about cabal.project.local file
parent 9ba2616c
Pipeline #5616 canceled with stages
...@@ -38,3 +38,5 @@ tmp*repo*json ...@@ -38,3 +38,5 @@ tmp*repo*json
data data
devops/docker/js-cache devops/docker/js-cache
cabal.project.local
\ No newline at end of file
...@@ -72,6 +72,52 @@ This will take a bit of time as it has to download/build the dependencies, but t ...@@ -72,6 +72,52 @@ This will take a bit of time as it has to download/build the dependencies, but t
#### With Cabal (recommanded) #### With Cabal (recommanded)
##### Turning off optimization flags
Create a `cabal.project.local` file (don't commit it to git!):
```
package gargantext
ghc-options: -fwrite-ide-info -hiedir=".stack-work/hiedb" -O0
package gargantext-admin
ghc-options: -O0
package gargantext-cli
ghc-options: -O0
package gargantext-db-obfuscation
ghc-options: -O0
package gargantext-import
ghc-options: -O0
package gargantext-init
ghc-options: -O0
package gargantext-invitations
ghc-options: -O0
package gargantext-phylo
ghc-options: -O0
package gargantext-server
ghc-options: -O0
package gargantext-upgrade
ghc-options: -O0
package gargantext-graph
ghc-options: -O0
package hmatrix
ghc-options: -O0
package sparse-linear
ghc-options: -O0
```
##### Building
First, into `nix-shell`: First, into `nix-shell`:
```shell ```shell
cabal update cabal update
......
...@@ -182,13 +182,40 @@ allow-older: * ...@@ -182,13 +182,40 @@ allow-older: *
allow-newer: * allow-newer: *
package gargantext package gargantext
ghc-options: -fwrite-ide-info -hiedir=".stack-work/hiedb" ghc-options: -fwrite-ide-info -hiedir=".stack-work/hiedb" -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-admin
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-cli
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-db-obfuscation
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-import
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-init
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-invitations
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-phylo
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-server
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-upgrade
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package gargantext-graph package gargantext-graph
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package hmatrix package hmatrix
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
package sparse-linear package sparse-linear
ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack ghc-options: -O2 -fsimpl-tick-factor=10000 -fdicts-cheap -fdicts-strict -flate-dmd-anal -fno-state-hack
...@@ -622,7 +622,7 @@ executable gargantext-admin ...@@ -622,7 +622,7 @@ executable gargantext-admin
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
base base
, extra , extra
...@@ -653,7 +653,7 @@ executable gargantext-cli ...@@ -653,7 +653,7 @@ executable gargantext-cli
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
aeson ^>= 1.5.6.0 aeson ^>= 1.5.6.0
, async ^>= 2.2.4 , async ^>= 2.2.4
...@@ -695,7 +695,7 @@ executable gargantext-db-obfuscation ...@@ -695,7 +695,7 @@ executable gargantext-db-obfuscation
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
if flag(disable-db-obfuscation-executable) if flag(disable-db-obfuscation-executable)
buildable: False buildable: False
else else
...@@ -730,7 +730,7 @@ executable gargantext-import ...@@ -730,7 +730,7 @@ executable gargantext-import
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
base ^>= 4.14.3.0 base ^>= 4.14.3.0
, extra ^>= 1.7.9 , extra ^>= 1.7.9
...@@ -761,7 +761,7 @@ executable gargantext-init ...@@ -761,7 +761,7 @@ executable gargantext-init
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
base ^>= 4.14.3.0 base ^>= 4.14.3.0
, cron ^>= 0.7.0 , cron ^>= 0.7.0
...@@ -792,7 +792,7 @@ executable gargantext-invitations ...@@ -792,7 +792,7 @@ executable gargantext-invitations
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
base ^>= 4.14.3.0 base ^>= 4.14.3.0
, extra ^>= 1.7.9 , extra ^>= 1.7.9
...@@ -822,7 +822,7 @@ executable gargantext-phylo ...@@ -822,7 +822,7 @@ executable gargantext-phylo
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
aeson ^>= 1.5.6.0 aeson ^>= 1.5.6.0
, async ^>= 2.2.4 , async ^>= 2.2.4
...@@ -866,7 +866,7 @@ executable gargantext-server ...@@ -866,7 +866,7 @@ executable gargantext-server
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -O2 -Wcompat -Wmissing-signatures -rtsopts -threaded -with-rtsopts=-N -with-rtsopts=-T -fprof-auto ghc-options: -Wall -Wcompat -Wmissing-signatures -rtsopts -threaded -with-rtsopts=-N -with-rtsopts=-T -fprof-auto
build-depends: build-depends:
base ^>= 4.14.3.0 base ^>= 4.14.3.0
, cassava ^>= 0.5.2.0 , cassava ^>= 0.5.2.0
...@@ -904,7 +904,7 @@ executable gargantext-upgrade ...@@ -904,7 +904,7 @@ executable gargantext-upgrade
RankNTypes RankNTypes
RecordWildCards RecordWildCards
StrictData StrictData
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O2 -Wmissing-signatures ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Wmissing-signatures
build-depends: build-depends:
base ^>= 4.14.3.0 base ^>= 4.14.3.0
, cron ^>= 0.7.0 , cron ^>= 0.7.0
......
  • I would keep the optimization in gargantext.cabal to be removed later with cabal imports, just for clarity if people check this file only ?

  • OK I moved that to a common stanza in gargantext.cabal. Please don't merge this branch yet.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment