Reputation: 3136
Following up on this question about including source files. I am including a Chapel modules that contains one file called classes.chpl
, but my current project also has a classes.chpl
. What is the correct disambiguation pattern? When I do
chpl -M/path/src
it notes the conflict, then chooses the classes.chpl
in the current directory. Should I compile the module for export as in this page or is there another pattern.
== UPDATE ==
The directory structure looks like
projA/alpha.chpl
/classes.chpl
projB/beta.chpl
/classes.chpl
Where each project depends on the classes in the respective classes.chpl
file. Trying to compile projA
I am currently using
chpl alpha.chpl -M../projB/
But this causes a conflict, as it tries to use projA/classes.cphl
for the classes in both beta.chpl
and alpha.chpl
.
Upvotes: 3
Views: 35
Reputation: 545
As described in the module search paths tech note, the Chapel compiler searches for user modules by, in this order:
.chpl
files specified on the command line.chpl
files in the directories containing the files specified on the command line.chpl
files in the paths specified via the -M
option or the CHPL_MODULE_PATH
environment variableSince the compiler finds the classes.chpl
from the project directory using rule 2, and only finds the /path/src/classes.chpl
with rule 3, it chooses the one in the project directory. To get it to choose /path/src/classes.chpl
instead, you can specify it on the command line so it is found with rule 1.
chpl mainModule.chpl /path/src/classes.chpl
Upvotes: 3