caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] compile problem
@ 2002-06-12 22:04 dengping zhu
  2002-06-13  2:45 ` Jacques Garrigue
  0 siblings, 1 reply; 8+ messages in thread
From: dengping zhu @ 2002-06-12 22:04 UTC (permalink / raw)
  To: Ocaml

Hi, all, 
I wrote a file name foo.ml, which included some syntax of camlp4. 
When I use the command:

   ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c foo.ml

I got the following error message:
   sh: camlp4o: execute permission denied
   Preprocessing error

I run the command under my home directory. I am not the 'root'. Does it
mean that only the user 'root' can execute this command? But, on the other
hand, when I enter the ocaml mode, I can do as follows:

# #load "camlp4.cma";;
# #load "pa_extend.cmo";;
# #load "q_MLast.cmo";;
# #use "foo.ml";;

Can somebody tell me the reason?
Thanks a lot!

Dengping



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-12 22:04 [Caml-list] compile problem dengping zhu
@ 2002-06-13  2:45 ` Jacques Garrigue
  2002-06-14 15:05   ` dengping zhu
  0 siblings, 1 reply; 8+ messages in thread
From: Jacques Garrigue @ 2002-06-13  2:45 UTC (permalink / raw)
  To: zhudp; +Cc: caml-list

From: dengping zhu <zhudp@cs.bu.edu>

> I wrote a file name foo.ml, which included some syntax of camlp4. 
> When I use the command:
> 
>    ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c foo.ml
> 
> I got the following error message:
>    sh: camlp4o: execute permission denied
>    Preprocessing error
> 
> I run the command under my home directory. I am not the 'root'. Does it
> mean that only the user 'root' can execute this command?

Looks like the answer is already in you message: what are the
permissions on the camlp4o executable?  If you installed it as root
with a wrong umask, it might be executable only by root. Easy fix:
su root, and chmod +rx camlp4o.

Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-13  2:45 ` Jacques Garrigue
@ 2002-06-14 15:05   ` dengping zhu
  2002-06-14 15:30     ` Markus Mottl
  0 siblings, 1 reply; 8+ messages in thread
From: dengping zhu @ 2002-06-14 15:05 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: caml-list

Thanks. After changing the permission, it works now. 

By the way, can somebody send a template of Makefile to me?  I need to
compile camlp4 and ocaml files together.

Thanks,


On Thu, 13 Jun 2002, Jacques Garrigue wrote:

>From: dengping zhu <zhudp@cs.bu.edu>
>
>> I wrote a file name foo.ml, which included some syntax of camlp4. 
>> When I use the command:
>> 
>>    ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c foo.ml
>> 
>> I got the following error message:
>>    sh: camlp4o: execute permission denied
>>    Preprocessing error
>> 
>> I run the command under my home directory. I am not the 'root'. Does it
>> mean that only the user 'root' can execute this command?
>
>Looks like the answer is already in you message: what are the
>permissions on the camlp4o executable?  If you installed it as root
>with a wrong umask, it might be executable only by root. Easy fix:
>su root, and chmod +rx camlp4o.
>
>Jacques Garrigue
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-14 15:05   ` dengping zhu
@ 2002-06-14 15:30     ` Markus Mottl
  2002-06-14 18:48       ` dengping zhu
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Mottl @ 2002-06-14 15:30 UTC (permalink / raw)
  To: dengping zhu; +Cc: caml-list

On Fri, 14 Jun 2002, dengping zhu wrote:
> Thanks. After changing the permission, it works now. 
> 
> By the way, can somebody send a template of Makefile to me?  I need to
> compile camlp4 and ocaml files together.

You could use OCamlMakefile for this purpose, which you can find here:

  http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html

Besides many other things, it also supports camlp4 as demonstrated in
an example shipped with the distribution.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-14 15:30     ` Markus Mottl
@ 2002-06-14 18:48       ` dengping zhu
  2002-06-14 19:38         ` Markus Mottl
  0 siblings, 1 reply; 8+ messages in thread
From: dengping zhu @ 2002-06-14 18:48 UTC (permalink / raw)
  To: Markus Mottl; +Cc: caml-list

Thanks. I tried it, but I still have problems with the *.mli files.
How should I put all the *.mli files into the Makefile?
I did as follows:
Source: a.mli a.ml b.mli b.ml

But every time the error messages show that it could not find the module
type which I defined in the mli file.






On Fri, 14 Jun 2002, Markus Mottl wrote:

>On Fri, 14 Jun 2002, dengping zhu wrote:
>> Thanks. After changing the permission, it works now. 
>> 
>> By the way, can somebody send a template of Makefile to me?  I need to
>> compile camlp4 and ocaml files together.
>
>You could use OCamlMakefile for this purpose, which you can find here:
>
>  http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
>
>Besides many other things, it also supports camlp4 as demonstrated in
>an example shipped with the distribution.
>
>Regards,
>Markus Mottl
>
>-- 
>Markus Mottl                                             markus@oefai.at
>Austrian Research Institute
>for Artificial Intelligence                  http://www.oefai.at/~markus
>-------------------
>To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
>Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-14 18:48       ` dengping zhu
@ 2002-06-14 19:38         ` Markus Mottl
  2002-06-14 20:59           ` dengping zhu
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Mottl @ 2002-06-14 19:38 UTC (permalink / raw)
  To: dengping zhu; +Cc: Markus Mottl, caml-list

On Fri, 14 Jun 2002, dengping zhu wrote:
> Thanks. I tried it, but I still have problems with the *.mli files.
> How should I put all the *.mli files into the Makefile?
> I did as follows:
> Source: a.mli a.ml b.mli b.ml

You probably mean:

  SOURCES = a.mli a.ml b.mli b.ml

> But every time the error messages show that it could not find the
> module type which I defined in the mli file.

Hm, unless you try to access module B from within A, in which case you'd
have to just reorder the modules in the SOURCES-line, it's probably an
error in your definition. If I guess correctly, you may have tried to
define a "module A = struct ... end" in your a.ml file, which you don't
have to, because each file already is a module of the corresponding name.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-14 19:38         ` Markus Mottl
@ 2002-06-14 20:59           ` dengping zhu
  2002-06-14 21:07             ` Markus Mottl
  0 siblings, 1 reply; 8+ messages in thread
From: dengping zhu @ 2002-06-14 20:59 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Markus Mottl, caml-list

Hi, Markus, 

You are right. After I removed all the "module A = struct ... end"  
from the ml and mli files, it's ok now. 

But I still can not figure out why all my original files works well if I
enter the ocaml mode and 

# #use "a.mli"
# #use "a.ml"

I think that it should be consistent in both ways.

Dengping




On Fri, 14 Jun 2002, Markus Mottl wrote:

>On Fri, 14 Jun 2002, dengping zhu wrote:
>> Thanks. I tried it, but I still have problems with the *.mli files.
>> How should I put all the *.mli files into the Makefile?
>> I did as follows:
>> Source: a.mli a.ml b.mli b.ml
>
>You probably mean:
>
>  SOURCES = a.mli a.ml b.mli b.ml
>
>> But every time the error messages show that it could not find the
>> module type which I defined in the mli file.
>
>Hm, unless you try to access module B from within A, in which case you'd
>have to just reorder the modules in the SOURCES-line, it's probably an
>error in your definition. If I guess correctly, you may have tried to
>define a "module A = struct ... end" in your a.ml file, which you don't
>have to, because each file already is a module of the corresponding name.
>
>Regards,
>Markus Mottl
>
>-- 
>Markus Mottl                                             markus@oefai.at
>Austrian Research Institute
>for Artificial Intelligence                  http://www.oefai.at/~markus
>-------------------
>To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
>Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] compile problem
  2002-06-14 20:59           ` dengping zhu
@ 2002-06-14 21:07             ` Markus Mottl
  0 siblings, 0 replies; 8+ messages in thread
From: Markus Mottl @ 2002-06-14 21:07 UTC (permalink / raw)
  To: dengping zhu; +Cc: caml-list

On Fri, 14 Jun 2002, dengping zhu wrote:
> You are right. After I removed all the "module A = struct ... end"  
> from the ml and mli files, it's ok now. 

This is a common beginner problem, which would probably cease to exist
if the toplevel supported other ways of loading module files (see below).

> But I still can not figure out why all my original files works well if I
> enter the ocaml mode and 
> 
> # #use "a.mli"
> # #use "a.ml"
> 
> I think that it should be consistent in both ways.

I think so, too. Question to the developers: why not add another form of
"#use", which automatically wraps the contents of files into modules
of the corresponding name? This should be trivial to do and would also
allow more consistent ways of scripting.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-06-14 21:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-12 22:04 [Caml-list] compile problem dengping zhu
2002-06-13  2:45 ` Jacques Garrigue
2002-06-14 15:05   ` dengping zhu
2002-06-14 15:30     ` Markus Mottl
2002-06-14 18:48       ` dengping zhu
2002-06-14 19:38         ` Markus Mottl
2002-06-14 20:59           ` dengping zhu
2002-06-14 21:07             ` Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).