Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  mnemosyne and code paths

ketralnis
Posted: Mon Aug 13, 2007 5:58 am Reply with quote
User Joined: 20 Jul 2007 Posts: 151 Location: San Francisco, CA
I'm not sure if this is a yaws question or an erlyweb question, but
I'm having trouble trying to put some mnemosyne code into my erlyweb
app.

If I compile a module without erlyweb that includes mnemosyne, it
appears to work just fine (quoted for readability):

> -module(foo).
> -include_lib("mnemosyne/include/mnemosyne.hrl").
> -export([foo/0]).
> foo() -> io:format("Test~n").
>
> ~% erl
> Erlang (BEAM) emulator version 5.5.5 [source] [smp:2] [async-
> threads:0] [hipe] [kernel-poll:false]
>
> Eshell V5.5.5 (abort with ^G)
> 1> c(foo).
> {ok,foo}
> 2> foo:foo().
> Test
> ok

But if I try to stick that same include_lib directive in one of my
models, I get:

> ** exited: {error,[{".",[{41,erl_lint,undefined_module}]},
> {"/opt/local/lib/erlang/lib/mnemosyne-1.2.7.1/
> include/mnemosyne.hrl",
> [{2,erl_lint,{attribute,module}},
> {3,erl_lint,{attribute,export}}]}],
> [{".",
> {24,erl_lint,{unused_function,{author,1}}},
> {30,erl_lint,{unused_function,{comment_tree,1}}},
> {33,erl_lint,{unused_function,{direct_comments,
> 1}}},
> {38,erl_lint,{unused_function,{points,1}}},

Since it gives the full path to the real mnemosyne.hrl in the error
message, that makes me think that it's actually finding the right
include file, so it's not an issue finding it. I'm starting Yaws like
this:

> yaws -i --conf ./yaws.conf -pa /opt/local/lib/erlang --mnesiadir
> \"`pwd`/db\" -sname my_sname --erlarg '+K true -smp on -mnesia
> dump_log_write_threshold 20000 +A 256 +Bc'.

That ends up with this entry in my process listing:

> /opt/local/lib/erlang/erts-5.5.5/bin/beam.smp -K true -A 256 -Bc --
> -root /opt/local/lib/erlang -progname erl -- -home /Users/dking -
> pa /opt/local/lib/yaws/ebin -pa /opt/local/lib/erlang -sname
> my_sname -smp on -mnesia dump_log_write_threshold 20000 -yaws debug
> -run yaws -conf ./yaws.conf -mnesia dir "/Users/dking/my_appname/
> db" -run mnesia start -yaws id default -smp auto

I've tried a yaws.conf both including and excluding a line like:

> include_dir = /opt/local/lib/erlang/lib

And that doesn't appear to make a difference. I've also noticed that
in "yaws -i", the TAB-completion for module-names shows mnesia in the
list, but not mnemosyne.

Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message AIM Address
Guest
Posted: Tue Aug 14, 2007 5:47 am Reply with quote
Guest
This looks like a bug. I'll look into it and keep you updated.

Thanks for reporting!

Yariv

On 8/12/07, David King <dking@ketralnis.com> wrote:
>
> I'm not sure if this is a yaws question or an erlyweb question, but
> I'm having trouble trying to put some mnemosyne code into my erlyweb
> app.
>
> If I compile a module without erlyweb that includes mnemosyne, it
> appears to work just fine (quoted for readability):
>
> > -module(foo).
> > -include_lib("mnemosyne/include/mnemosyne.hrl").
> > -export([foo/0]).
> > foo() -> io:format("Test~n").
> >
> > ~% erl
> > Erlang (BEAM) emulator version 5.5.5 [source] [smp:2] [async-
> > threads:0] [hipe] [kernel-poll:false]
> >
> > Eshell V5.5.5 (abort with ^G)
> > 1> c(foo).
> > {ok,foo}
> > 2> foo:foo().
> > Test
> > ok
>
> But if I try to stick that same include_lib directive in one of my
> models, I get:
>
> > ** exited: {error,[{".",[{41,erl_lint,undefined_module}]},
> > {"/opt/local/lib/erlang/lib/mnemosyne-1.2.7.1/
> > include/mnemosyne.hrl",
> > [{2,erl_lint,{attribute,module}},
> > {3,erl_lint,{attribute,export}}]}],
> > [{".",
> > {24,erl_lint,{unused_function,{author,1}}},
> > {30,erl_lint,{unused_function,{comment_tree,1}}},
> > {33,erl_lint,{unused_function,{direct_comments,
> > 1}}},
> > {38,erl_lint,{unused_function,{points,1}}},
>
> Since it gives the full path to the real mnemosyne.hrl in the error
> message, that makes me think that it's actually finding the right
> include file, so it's not an issue finding it. I'm starting Yaws like
> this:
>
> > yaws -i --conf ./yaws.conf -pa /opt/local/lib/erlang --mnesiadir
> > \"`pwd`/db\" -sname my_sname --erlarg '+K true -smp on -mnesia
> > dump_log_write_threshold 20000 +A 256 +Bc'.
>
> That ends up with this entry in my process listing:
>
> > /opt/local/lib/erlang/erts-5.5.5/bin/beam.smp -K true -A 256 -Bc --
> > -root /opt/local/lib/erlang -progname erl -- -home /Users/dking -
> > pa /opt/local/lib/yaws/ebin -pa /opt/local/lib/erlang -sname
> > my_sname -smp on -mnesia dump_log_write_threshold 20000 -yaws debug
> > -run yaws -conf ./yaws.conf -mnesia dir "/Users/dking/my_appname/
> > db" -run mnesia start -yaws id default -smp auto
>
> I've tried a yaws.conf both including and excluding a line like:
>
> > include_dir = /opt/local/lib/erlang/lib
>
> And that doesn't appear to make a difference. I've also noticed that
> in "yaws -i", the TAB-completion for module-names shows mnesia in the
> list, but not mnemosyne.
>
> Any ideas?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
Guest
Posted: Tue Aug 14, 2007 7:45 am Reply with quote
Guest
It should be fixed in trunk. Apparently compile:forms() doesn't like
parse transforms, so I had to apply them manually in smerl:compile().
Please let me know if you run into more problems.

Thanks,
Yariv

On 8/12/07, David King <dking@ketralnis.com> wrote:
>
> I'm not sure if this is a yaws question or an erlyweb question, but
> I'm having trouble trying to put some mnemosyne code into my erlyweb
> app.
>
> If I compile a module without erlyweb that includes mnemosyne, it
> appears to work just fine (quoted for readability):
>
> > -module(foo).
> > -include_lib("mnemosyne/include/mnemosyne.hrl").
> > -export([foo/0]).
> > foo() -> io:format("Test~n").
> >
> > ~% erl
> > Erlang (BEAM) emulator version 5.5.5 [source] [smp:2] [async-
> > threads:0] [hipe] [kernel-poll:false]
> >
> > Eshell V5.5.5 (abort with ^G)
> > 1> c(foo).
> > {ok,foo}
> > 2> foo:foo().
> > Test
> > ok
>
> But if I try to stick that same include_lib directive in one of my
> models, I get:
>
> > ** exited: {error,[{".",[{41,erl_lint,undefined_module}]},
> > {"/opt/local/lib/erlang/lib/mnemosyne-1.2.7.1/
> > include/mnemosyne.hrl",
> > [{2,erl_lint,{attribute,module}},
> > {3,erl_lint,{attribute,export}}]}],
> > [{".",
> > {24,erl_lint,{unused_function,{author,1}}},
> > {30,erl_lint,{unused_function,{comment_tree,1}}},
> > {33,erl_lint,{unused_function,{direct_comments,
> > 1}}},
> > {38,erl_lint,{unused_function,{points,1}}},
>
> Since it gives the full path to the real mnemosyne.hrl in the error
> message, that makes me think that it's actually finding the right
> include file, so it's not an issue finding it. I'm starting Yaws like
> this:
>
> > yaws -i --conf ./yaws.conf -pa /opt/local/lib/erlang --mnesiadir
> > \"`pwd`/db\" -sname my_sname --erlarg '+K true -smp on -mnesia
> > dump_log_write_threshold 20000 +A 256 +Bc'.
>
> That ends up with this entry in my process listing:
>
> > /opt/local/lib/erlang/erts-5.5.5/bin/beam.smp -K true -A 256 -Bc --
> > -root /opt/local/lib/erlang -progname erl -- -home /Users/dking -
> > pa /opt/local/lib/yaws/ebin -pa /opt/local/lib/erlang -sname
> > my_sname -smp on -mnesia dump_log_write_threshold 20000 -yaws debug
> > -run yaws -conf ./yaws.conf -mnesia dir "/Users/dking/my_appname/
> > db" -run mnesia start -yaws id default -smp auto
>
> I've tried a yaws.conf both including and excluding a line like:
>
> > include_dir = /opt/local/lib/erlang/lib
>
> And that doesn't appear to make a difference. I've also noticed that
> in "yaws -i", the TAB-completion for module-names shows mnesia in the
> list, but not mnemosyne.
>
> Any ideas?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
ketralnis
Posted: Sun Aug 19, 2007 11:03 pm Reply with quote
User Joined: 20 Jul 2007 Posts: 151 Location: San Francisco, CA
> It should be fixed in trunk. Apparently compile:forms() doesn't like
> parse transforms, so I had to apply them manually in smerl:compile().
> Please let me know if you run into more problems.

It seems to work with mnemosyne now, but I see that mnemosyne is
going to stop being supported soon, so I tried QLC:

-module(mymodel).
-export([test/0]).
-include_lib("stdlib/include/qlc.hrl").
test() -> 0.

And when I try to compile:

9> erlyweb:compile(Appdir,[native,debug_info,{erlydb_driver,mnesia},
{auto_compile,true}]).
[...]

debug:erlyweb_compile:369: Compiling Erlang file "mymodel"
.:74: no module definition
/opt/local/lib/erlang/lib/stdlib-1.14.5/include/qlc.hrl:2: attribute
'module' after function definitions
/opt/local/lib/erlang/lib/stdlib-1.14.5/include/qlc.hrl:3: attribute
'export' after function definitions
.:16: Warning: function test/0 is unused
** exited: {error,[{".",[{74,erl_lint,undefined_module}]},
{"/opt/local/lib/erlang/lib/stdlib-1.14.5/include/
qlc.hrl",
[{2,erl_lint,{attribute,module}},
{3,erl_lint,{attribute,export}}]}],
[{".",
[{16,erl_lint,{unused_function,{test,0}}}]}]} **

qlc.hrl only contains:
-compile({parse_transform,qlc}).

Which is odd because mnemosyne.hrl only contains -compile
({parse_transform,mnemosyne}). and it seems to work



>
> Thanks,
> Yariv
>
> On 8/12/07, David King <dking@ketralnis.com> wrote:
>>
>> I'm not sure if this is a yaws question or an erlyweb question, but
>> I'm having trouble trying to put some mnemosyne code into my erlyweb
>> app.
>>
>> If I compile a module without erlyweb that includes mnemosyne, it
>> appears to work just fine (quoted for readability):
>>
>>> -module(foo).
>>> -include_lib("mnemosyne/include/mnemosyne.hrl").
>>> -export([foo/0]).
>>> foo() -> io:format("Test~n").
>>>
>>> ~% erl
>>> Erlang (BEAM) emulator version 5.5.5 [source] [smp:2] [async-
>>> threads:0] [hipe] [kernel-poll:false]
>>>
>>> Eshell V5.5.5 (abort with ^G)
>>> 1> c(foo).
>>> {ok,foo}
>>> 2> foo:foo().
>>> Test
>>> ok
>>
>> But if I try to stick that same include_lib directive in one of my
>> models, I get:
>>
>>> ** exited: {error,[{".",[{41,erl_lint,undefined_module}]},
>>> {"/opt/local/lib/erlang/lib/mnemosyne-1.2.7.1/
>>> include/mnemosyne.hrl",
>>> [{2,erl_lint,{attribute,module}},
>>> {3,erl_lint,{attribute,export}}]}],
>>> [{".",
>>> {24,erl_lint,{unused_function,{author,1}}},
>>> {30,erl_lint,{unused_function,{comment_tree,
>>> 1}}},
>>> {33,erl_lint,{unused_function,{direct_comments,
>>> 1}}},
>>> {38,erl_lint,{unused_function,{points,1}}},
>>
>> Since it gives the full path to the real mnemosyne.hrl in the error
>> message, that makes me think that it's actually finding the right
>> include file, so it's not an issue finding it. I'm starting Yaws like
>> this:
>>
>>> yaws -i --conf ./yaws.conf -pa /opt/local/lib/erlang --mnesiadir
>>> \"`pwd`/db\" -sname my_sname --erlarg '+K true -smp on -mnesia
>>> dump_log_write_threshold 20000 +A 256 +Bc'.
>>
>> That ends up with this entry in my process listing:
>>
>>> /opt/local/lib/erlang/erts-5.5.5/bin/beam.smp -K true -A 256 -Bc --
>>> -root /opt/local/lib/erlang -progname erl -- -home /Users/dking -
>>> pa /opt/local/lib/yaws/ebin -pa /opt/local/lib/erlang -sname
>>> my_sname -smp on -mnesia dump_log_write_threshold 20000 -yaws debug
>>> -run yaws -conf ./yaws.conf -mnesia dir "/Users/dking/my_appname/
>>> db" -run mnesia start -yaws id default -smp auto
>>
>> I've tried a yaws.conf both including and excluding a line like:
>>
>>> include_dir = /opt/local/lib/erlang/lib
>>
>> And that doesn't appear to make a difference. I've also noticed that
>> in "yaws -i", the TAB-completion for module-names shows mnesia in the
>> list, but not mnemosyne.
>>
>> Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message AIM Address
Guest
Posted: Tue Aug 21, 2007 5:33 pm Reply with quote
Guest
I removed the mnemosyne fix I had made for yesterday's release. If you
use the latest code with QLC, you should be fine.

Yariv

On 8/19/07, David King <dking@ketralnis.com> wrote:
>
> > It should be fixed in trunk. Apparently compile:forms() doesn't like
> > parse transforms, so I had to apply them manually in smerl:compile().
> > Please let me know if you run into more problems.
>
> It seems to work with mnemosyne now, but I see that mnemosyne is
> going to stop being supported soon, so I tried QLC:
>
> -module(mymodel).
> -export([test/0]).
> -include_lib("stdlib/include/qlc.hrl").
> test() -> 0.
>
> And when I try to compile:
>
> 9> erlyweb:compile(Appdir,[native,debug_info,{erlydb_driver,mnesia},
> {auto_compile,true}]).
> [...]
>
> debug:erlyweb_compile:369: Compiling Erlang file "mymodel"
> .:74: no module definition
> /opt/local/lib/erlang/lib/stdlib-1.14.5/include/qlc.hrl:2: attribute
> 'module' after function definitions
> /opt/local/lib/erlang/lib/stdlib-1.14.5/include/qlc.hrl:3: attribute
> 'export' after function definitions
> .:16: Warning: function test/0 is unused
> ** exited: {error,[{".",[{74,erl_lint,undefined_module}]},
> {"/opt/local/lib/erlang/lib/stdlib-1.14.5/include/
> qlc.hrl",
> [{2,erl_lint,{attribute,module}},
> {3,erl_lint,{attribute,export}}]}],
> [{".",
> [{16,erl_lint,{unused_function,{test,0}}}]}]} **
>
> qlc.hrl only contains:
> -compile({parse_transform,qlc}).
>
> Which is odd because mnemosyne.hrl only contains -compile
> ({parse_transform,mnemosyne}). and it seems to work
>
>
>
> >
> > Thanks,
> > Yariv
> >
> > On 8/12/07, David King <dking@ketralnis.com> wrote:
> >>
> >> I'm not sure if this is a yaws question or an erlyweb question, but
> >> I'm having trouble trying to put some mnemosyne code into my erlyweb
> >> app.
> >>
> >> If I compile a module without erlyweb that includes mnemosyne, it
> >> appears to work just fine (quoted for readability):
> >>
> >>> -module(foo).
> >>> -include_lib("mnemosyne/include/mnemosyne.hrl").
> >>> -export([foo/0]).
> >>> foo() -> io:format("Test~n").
> >>>
> >>> ~% erl
> >>> Erlang (BEAM) emulator version 5.5.5 [source] [smp:2] [async-
> >>> threads:0] [hipe] [kernel-poll:false]
> >>>
> >>> Eshell V5.5.5 (abort with ^G)
> >>> 1> c(foo).
> >>> {ok,foo}
> >>> 2> foo:foo().
> >>> Test
> >>> ok
> >>
> >> But if I try to stick that same include_lib directive in one of my
> >> models, I get:
> >>
> >>> ** exited: {error,[{".",[{41,erl_lint,undefined_module}]},
> >>> {"/opt/local/lib/erlang/lib/mnemosyne-1.2.7.1/
> >>> include/mnemosyne.hrl",
> >>> [{2,erl_lint,{attribute,module}},
> >>> {3,erl_lint,{attribute,export}}]}],
> >>> [{".",
> >>> {24,erl_lint,{unused_function,{author,1}}},
> >>> {30,erl_lint,{unused_function,{comment_tree,
> >>> 1}}},
> >>> {33,erl_lint,{unused_function,{direct_comments,
> >>> 1}}},
> >>> {38,erl_lint,{unused_function,{points,1}}},
> >>
> >> Since it gives the full path to the real mnemosyne.hrl in the error
> >> message, that makes me think that it's actually finding the right
> >> include file, so it's not an issue finding it. I'm starting Yaws like
> >> this:
> >>
> >>> yaws -i --conf ./yaws.conf -pa /opt/local/lib/erlang --mnesiadir
> >>> \"`pwd`/db\" -sname my_sname --erlarg '+K true -smp on -mnesia
> >>> dump_log_write_threshold 20000 +A 256 +Bc'.
> >>
> >> That ends up with this entry in my process listing:
> >>
> >>> /opt/local/lib/erlang/erts-5.5.5/bin/beam.smp -K true -A 256 -Bc --
> >>> -root /opt/local/lib/erlang -progname erl -- -home /Users/dking -
> >>> pa /opt/local/lib/yaws/ebin -pa /opt/local/lib/erlang -sname
> >>> my_sname -smp on -mnesia dump_log_write_threshold 20000 -yaws debug
> >>> -run yaws -conf ./yaws.conf -mnesia dir "/Users/dking/my_appname/
> >>> db" -run mnesia start -yaws id default -smp auto
> >>
> >> I've tried a yaws.conf both including and excluding a line like:
> >>
> >>> include_dir = /opt/local/lib/erlang/lib
> >>
> >> And that doesn't appear to make a difference. I've also noticed that
> >> in "yaws -i", the TAB-completion for module-names shows mnesia in the
> >> list, but not mnemosyne.
> >>
> >> Any ideas?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum