erlc options

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

erlc options

Vance Shipley-2

How do you get the MIB compiler to accept -ilroot?

I've tried every combination of things I keep getting this:

erlc +"{db,mnesia}" -ilroot "eva/priv/mibs/" ASG-MIB.mib
ASG-MIB.mib: 14: Error: Could not import [{node,currentAlarmObject},
                                          {node,currentAlarmSeverity},
                                          {node,currentAlarmTime}] from mib
OTP-EVA-MIB.bin. File not found. Check that the MIB to be IMPORTED is
compiled and present in the import path.
compilation_failedmake: *** [ASG-MIB.bin] Error 1


        -Vance



Reply | Threaded
Open this post in threaded view
|

erlc options

Martin Bjorklund-2
"Vance Shipley" <vances> wrote:
>
> How do you get the MIB compiler to accept -ilroot?

I think you want to use the -I option, not -ilroot.  With -I you add a
specific directory to the include/import path.  -ilroot is used for
erlang code which uses the directive -include_lib.


> I've tried every combination of things I keep getting this:
>
> erlc +"{db,mnesia}" -ilroot "eva/priv/mibs/" ASG-MIB.mib

So try:
  erlc +"{db,mnesia}" -I "eva/priv/mibs/" ASG-MIB.mib
instead.


/martin


Reply | Threaded
Open this post in threaded view
|

erlc options

Vance Shipley-2
In reply to this post by Vance Shipley-2

I think there may be something broken here.  I can compile
the Erlang way:

Eshell V5.0.1.1  (abort with ^G)
1> snmp:c("ASG-MIB", [{db, mnesia}, {il, ["eva/priv/mibs"]}]).
{ok,"./ASG-MIB.bin"}

But I can't get it to work the Unix way:

$ make
erlc +'{db,mnesia}' -ilroot '["eva/priv/mibs/]"' ASG-MIB.mib
ASG-MIB.mib: 14: Error: Could not import [{node,currentAlarmObject},
                                          {node,currentAlarmSeverity},
                                          {node,currentAlarmTime}] from mib
OTP-EVA-MIB.bin. File not found. Check that the MIB to be IMPORTED is
compiled and present in the import path.
compilation_failedmake: *** [ASG-MIB.bin] Error 1


The syntax above seems to be what what is suggested by the documentation.
I have also tried the following:


erlc -ilroot 'eva/priv/mibs/' ASG-MIB.mib
erlc -ilroot "eva/priv/mibs/" ASG-MIB.mib
erlc -ilroot eva/priv/mibs/ ASG-MIB.mib
erlc -ilroot [eva/priv/mibs/] ASG-MIB.mib
erlc -ilroot "[eva/priv/mibs/]" ASG-MIB.mib
erlc -ilroot '["/usr/local/lib/erlang/lib/eva-2.0.2.1/priv/mibs/"]'
ASG-MIB.mib
erlc -I '["eva/priv/mibs/]"' ASG-MIB.mib

Hoever this does work:

$ cp /usr/local/lib/erlang/lib/eva-2.0.2.1/priv/mibs/OTP-EVA-MIB.bin .
$ make
erlc +'{db,mnesia}' -ilroot '["eva/priv/mibs/]"' ASG-MIB.mib


I give up!

        -Vance



Reply | Threaded
Open this post in threaded view
|

erlc options

Vance Shipley-2
> erlc +'{db,mnesia}' -ilroot '["eva/priv/mibs/]"' ASG-MIB.mib
>
> The syntax above seems to be what what is suggested by the documentation.

Oops, typo above.  It should be:

erlc +'{db,mnesia}' -ilroot '["eva/priv/mibs/"]' ASG-MIB.mib

However the typo was only in the email.  I wish it were that easy. :)

        -Vance