You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haskell test results in module is not loaded: 'Graphics.Implicit' (./Graphics/Implicit.hs)
This is most likely a problem with your Linux distro and cabal not playing nice. GHC is not configured to see the ImplicitCAD libraries. You can confirm this by trying the test in ~/.cabal/lib/. If that works, you should be able to use ghc anywhere with the -Ldir or -llib options. Alternatively, some people have permanently fixed this by doing the cabal install as root.
A slightly edited log:
$ apt install ghc haskell-stack cabal-install
$ cabal update && cabal install implicit
$ echo "circle(30);" > test.escad
$ extopenscad test.escad
Loading File.
Processing File.
Rendering 2D object from test.escad to test.stl with resolution 2.0 in
box (V2 (-30.0) (-30.0),V2 30.0 30.0) circle 30.0
<<ghc:
2264880 bytes, 2 GCs, 238032/238032 avg/max bytes residency (1
samples), 18M in use, 0.005 INIT (0.002 elapsed), 0.004 MUT (0.002
elapsed), 0.000 GC (0.000 elapsed)
:ghc>>
$ ls
test.escad test.stl
$ ghci
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
Prelude> import Graphics.Implicit
<no location info>: error:
Could not find module ‘Graphics.Implicit’
It is not a module in the current program, or in any known package.
Prelude> ^D
$ locate cabal | grep lib | grep -i implicit | wc -l
117
$ locate cabal | grep lib | grep -i implicit | rev | cut -d "/" -f 2- | rev | sort | uniq | head -n 1
~/.cabal/store/ghc-8.8.4/implicit-0.4.1.0-a990a66c188ce67ca424777aeecf8a34c19946f74d8d9563353b724167c06df9
And within that directory we have /lib/Graphics/ which contains:
Implicit
Implicit/Export
Implicit/Export/Render
Implicit/Export/Symbolic
Implicit/ExtOpenScad
Implicit/ExtOpenScad/Eval
Implicit/ExtOpenScad/Parser
Implicit/ExtOpenScad/Util
Implicit/ObjectUtil
I attempted the import while cd'd to ~/.cabal/ and then to each of the subdirectories, all with the same result.
The text was updated successfully, but these errors were encountered:
$ mkdir ~/.cabal/lib
$ cp -rv ~/gits/3D/ImplicitCAD/Graphics ~/.cabal/lib/
...
$ ghci
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
Prelude> import Graphics.Implicit
<no location info>: error:
Could not find module ‘Graphics.Implicit’
It is not a module in the current program, or in any known package.
Prelude> ^D
Leaving GHCi.
$ ghci -Llib ~/.cabal/lib/
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
target ‘~/.cabal/lib/’ is not a module name or a source file
Prelude> ^D
Leaving GHCi.
$ ghci -Ldir ~/.cabal/lib/
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
target ‘~/.cabal/lib/’ is not a module name or a source file
Prelude> ^D
Leaving GHCi.
$ ghci -Ldir ~/.cabal/lib
GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help
target ‘~/.cabal/lib’ is not a module name or a source file
Prelude> ^D
Leaving GHCi.
Maybe more documentation needed?
A slightly edited log:
And within that directory we have
/lib/Graphics/
which contains:I attempted the
import
while cd'd to~/.cabal/
and then to each of the subdirectories, all with the same result.The text was updated successfully, but these errors were encountered: