I tried setting up a project with multiple files: src/ElkTo.chpl src/species.chpl
The project file ElkTo.chpl compiles but not species.chpl. I also tied putting species.chpl in a subdirectory and calling mason like this: mason build -M src/records/species.chpl but that just resulted in a mason usage message suggesting that the -M flag is undefined.
I assume I'm doing something wrong. I appreciate any help offered.
As an addendum, I also tried compiling manually, like this:
chpl src/species.chpl src/ElkTo.chpl
but that does not work:
src/ElkTo.chpl:4: In function 'main':
src/ElkTo.chpl:5: error: 'Species' undeclared (first use this function)
How does one compile multiple chapel program units into an executable?
Sorry to hear you're having trouble compiling your Chapel program. Without knowing too much about the contents of the files I am just guessing it's a visibility issue. Are you including a
import statement in your
ElkTo.chpl file to bring in the
Species module? Something like
use Species; or
import Species; should be included to tell the compiler to make symbols from one module visible in the other. See Modules — Chapel Documentation 1.32 for more details on using symbols from other modules.
OK. Looks like the problem with Mason was having a file in the src directory with a name not matching the module name it contains.
Thanks & best wishes,