Discussion:
Vishap Oberon : Module search path
(too old to reply)
d***@gmail.com
2017-11-28 03:34:01 UTC
Permalink
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.

However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
David Brown
2017-11-28 20:37:55 UTC
Permalink
Post by d***@gmail.com
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.
However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
You should be able to provide a search path in environment variable OBERON.

(Note that if you provide more than one path they must be semi-colon separated even on Linux, sorry about that.)

The compiler should search this path before the current directory when looking for .sym files.
d***@gmail.com
2017-11-28 21:57:07 UTC
Permalink
Post by d***@gmail.com
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.
However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
d***@gmail.com
2017-11-28 22:01:19 UTC
Permalink
Post by d***@gmail.com
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.
However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
Supplying the environment variable OBERON for a utility directory let VOC compile the main program (with IMPORT calls), but when gcc wants to link, it cannot find the imported modules .o .c and .h files, which are in the utility directory.
d***@gmail.com
2017-11-28 23:19:31 UTC
Permalink
Post by d***@gmail.com
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.
However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
A clarification of my last post:
If I use the environment variable OBERON and try
voc -OC -m test1.ob
then voc does not complain about finding the utility modules in the utility directory.

But when voc tries to compile test1.c into a .o file, it cannot find the .h files for the utility modules.
David Brown
2017-11-29 09:57:58 UTC
Permalink
You can tell gcc where to look for headers with the (colon separated) C_INCLUDE_PATH environment variable.

Finally you can tell voc to pass a (space separated) list of extra object files to link in the CFLAGS environment variable. This will need to specify each .o file (with path) in the other directory that you are linking to.

Or you may find it more manageable to build a Makefile with the gcc compilation and linking done explicitly, rather than relying on the voc compiler to invoke them for you. Tell voc to stop before calling gcc with the '-S' flag. This is how the Vishap compiler and run time build works.
d***@gmail.com
2017-11-29 13:46:03 UTC
Permalink
Post by d***@gmail.com
Vishap Oberon will load the imported modules if they are in the same directory as the calling module.
However, I would like to put some modules in a utility directory. How can I specify a module search path to include the utility directory?
Thanks for the reply. I don't believe I found the documentation of the environment variables in the vishap documentation (If I missed it, could you point it out for me).

With your suggestions, I got things to work ok. For me the easiest way is to write a script to compile with voc the main module (using the environment variables) with -c and then use gcc to link main.0 and the utility library (which I built).

Thanks for your help.

Loading...