I'am new on linux and I try to compile this code https://elixir.bootlin.com/linux/v4.0/source/drivers/w1/slaves/w1_ds2433.c (my target is to create a ds2433.ko and if it works a ds28ec20.ko)
When i compile the ds2433.c I get that :
In file included from /usr/include/kernel.h:8:0, from w1_ds2433.c:8:
/usr/include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory
The main problem is that I don't know if I need to create the file suppose to be in /asm or if the code will create them.
When you compile the code, you should get a file with the extension .s, .asm, or maybe something else. To check if it is assembly, you can go into the terminal, type "ls -l" and if you see a file with an extension you are unfamiliar with, you can type in the terminal "cat filename.ext" and see the contents of it.
I'm a complete beginner with Haskell. So far I've downloaded the GHC. I know how to use it via the terminal by typing
$ ghci
also I have made a file called test.hs with my own code. I would like to run the file in ghci via terminal but i keep getting this error.
I have saved the test.hs on a file on my desktop. Im assuming i have to state the file path but i don't know how!.
Have you checked that you are on the correct folder before loading it and the file exists? ghci is the command line interpreter so you can load a file after calling it by typing :l test.hs .
If the file is on your desktop, use
ghci ~/Desktop/test.hs
Note that this is not really a Haskell question, but a shell question (and the path is specific to Mac OS X).
I am running into errors with opencv. I downloaded a package online and compiled each of the folders by cd into them and running make through the command line. But when I try using one of the functions, I run into this error: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
The file its trying to reach is indeed there, since I checked this, but for some reason its saying its not. I am pretty bad at figuring out path problems but I think this is one of them. Can anyone tell me how to fix this? Thanks
I am extremely new to haskell and I have been searching all over the web but I haven't been able to solve my problem. I downloaded the Quipper package but I have not been able to get haskell to recognize where all of the modules and files are and how to properly link everything.
I have downloaded all of the files and programs and installed them properly, I just dont know how to get haskell to recognize the quipper libraries and templates. Evey time I try:
:load And_gate.hs or some other file.
I get:
Could not find module "Quipper" or its respective modules it requires.
I don't think it is an error or anything, I think it is just my lack of knowledge on how haskell works.
I'm using windows 7.
So I emailed Peter Selinger, one of the professors who created Quipper.
The only thing I need to do extra was inside MSYS:
ghci -iC:/quipper -iC:/quipper/quipper
This complies everything correctly and the files run properly.
Here is his email to me:
Dear -----,
thanks for writing. Let me see if I can help.
Are you following the instructions in the README file? Under "Building
the various algorithms and programs", the instruction is to run
"make". This would build all of the tests in the "tests" directory
automatically.
Next, to compile a Quipper program, you should use the "quipper"
script that is located in quipper/scripts. It works just like "ghc",
except that it automatically includes the correct directories for
Quipper's files in the search path. On Windows, you would be using
"quipper.bat".
Quipper is not really meant to be run interactively, i.e., from ghci.
However, if you do need to run Quipper interactively, I recommend
using the "quipperi" script, also in quipper/scripts. This too would
set the load paths correctly. In Windows, use "quipperi.bat".
Finally, if you need to include Quipper stuff from ghci, but for some
reason can't or don't want to use the quipperi script, you need to
specify those directories with the "-i" option, for example
ghci -iC:/quipper -iC:/quipper/quipper
It could be that in Windows, you need to use "\" instead of "/", but I
am not sure if this is necessary.
I hope this helps, -- Peter
When compiling and exe with ghc just make sure you include the commands:
-iC:/quipper -iC:/quipper/quipper.
If you use the quipper script as suggested by Professor Selinger, inside of MSYS do the following:
Navigate to the folder in which all of the Quipper files are held, this was my case:
cd C:/quipper/quipper/scripts
Then type quipper and your file's location in MSYS to compile an exe like so:
quipper C:/quipper/tests/And_gate.hs
The file will compile and should print updates like so:
[1 of 22] Compiling Libraries.Typeable (......
[2 of 22] Compiling Libraries.Tuple (......
and so on.
The exe (in this case And_gate.exe) will be inside the folder it was compiled from (C:/quipper/tests). You'll need to move it to a folder that contains the acroread.bat which comes in quipper/scripts for it to work properly.
For some reason, this code isn't packaged as a standard Haskell package. It if were, installing it would be fairly simple. As it is, the instructions in the README file look awful (especially under Windows, where it looks like you need MSYS to run the makefile).
Your problem might be as simple as telling GHCi which folder to look in to find the files; you can do that using the :cd command. Since you're on Windows, I'd suggest trying WinGHCi, which should allow you to browse to the right folder using the GUI.
If it isn't that simple... really, as a Haskell beginner, you're probably going to struggle to get this working. The documentation looks pretty minimal.
If you red both README and INSTALLING.windows and did everything as well, then you should add a path to Quipper's script folder to environment variable. Here is the path:
quipper-*/quipper/scripts/
where quipper-* is a <distribution name>-<version>.
There are two important scripts in that folder. The first one is quipper.bat which runs a ghc compiler to run Quipper's modules. The second one is quipperi.bat which is a ghci analogue for Quipper.
Now, when you added a path to variable, you can run And_gate.hs in Quipper's interpreter as follows:
quipperi And_gate.hs
Using Hlint via the command prompt works for me, but I have problem trying to perform the GHCi integration.
http://community.haskell.org/~ndm/darcs/hlint/hlint.htm says that "the script is at hlint.ghci [link], and a copy is installed locally in the data directory. To use, add the contents to your GHCi startup file.".
C:\Users\X\AppData\Roaming\cabal\hlint-1.8.23 contains this hlint.ghci file.
Now I want to find the GHCi startup file. I am using Windows 7 and according to http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-dot-files.html the ghci.conf file should be in a folder like .../appdata/ghc. But my ghc folder (C:\Users\X\AppData\Roaming\ghc) only contains a ghci_history file.
So I copied the hlint.ghci file to my ghc folder and renamed it to ghci.conf.
Starting now WinGHCi it crashes, if I start GHCi it says:
interactive>:10:91:
lexical error in string/character literal at character '\n'
interactive>:4:105:
lexical error in string/character literal at character '\n'
What am I doing wrong?
Has the problem something to do with the missing GHCi startup file?
The problem was a bug with the hlint.ghci file shipped with HLint version 1.8.23 and below. HLint 1.8.24 is now available which fixes the problem, or use the online copy of hlint.ghci with an older version of HLint.
This bug was tracked by http://code.google.com/p/ndmitchell/issues/detail?id=531 and I originally said I "will probably fix it later today".