Compiling/Running the provided implementation

47 views
Skip to first unread message

Chris

unread,
May 17, 2010, 1:50:50 PM5/17/10
to Multicore Association
I have downloaded the supplied example implementation of MCAPI and by
using the makefile I can run the test files that come with it.

I would like to write my own programs to increase my understanding of
MCAPI, but to do so I need to know the syntax for compiling and
running. I have tried looking through the make file but it is quite
large and I don't see how it is done in there.

If you could tell me how to compile/run programs that use the provided
implementation I would appreciate it.

Thanks,
Chris

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

Michele Reese

unread,
May 19, 2010, 11:27:34 AM5/19/10
to Multicore Association
Hi Chris,

In the example implementation, we are using the standard GNU autoconf
toolset. You can take a look at tests/Makefile.am and follow examples
of other tests in there to see how you could add your program to that
Makefile. Note that after updating Makefile.am when you type make,
Makefile will be rebuilt and then you can type 'make <new program' to
build only your program or make check to build and run all programs
(including yours) in the test directory.

If you just want an example command for building your program, then in
the tests directory you could build a single test, for example 'make
msg1' and then replace all occurrences of msg1 in the command with
<new program>.

Hope this helps,
Michele

marku...@gmail.com

unread,
May 20, 2010, 11:03:55 AM5/20/10
to Multicore Association
#################################################################
# This Makefile uses the Gnu tool set (gmake).
#################################################################

MCA_INSTALL = ../mca

all: my_program

CC = gcc
CFLAGS = -g \
-Wall -O3 \
-I $(MCA_INSTALL)/include


LD = gcc
LDFLAGS = -Wl,-rpath,$(MCA_INSTALL)/lib -L $(MCA_INSTALL)/lib -lmcapi -
lmrapi -lpthread


my_program: my_program.o
$(LD) -o $@ my_program.o $(LDFLAGS)

.c.o:
$(CC) -c $(CFLAGS) $<
.cpp.o:
$(CC) -c $(CFLAGS) $<
.C.o:
$(CC) -c $(CFLAGS) $<
.cc.o:
$(CC) -c $(CFLAGS) $<

Tony Curtis

unread,
May 21, 2010, 1:04:54 PM5/21/10
to multicore-...@googlegroups.com
On 5/20/10 10:03 AM, Marku...@gmail.com wrote:
> #################################################################
> # This Makefile uses the Gnu tool set (gmake).
> #################################################################
>
> MCA_INSTALL = ../mca
>
> all: my_program
>
> CC = gcc
> CFLAGS = -g \
> -Wall -O3 \
> -I $(MCA_INSTALL)/include
>
>
> LD = gcc
> LDFLAGS = -Wl,-rpath,$(MCA_INSTALL)/lib -L $(MCA_INSTALL)/lib -lmcapi -
> lmrapi -lpthread
>

this information can also be gleaned automatically from mrapi-config and
mcapi-config that are installed in the distribution's bin directory,
e.g. for GNU make:

CFLAGS += $(shell mcapi-config --cflags) $(shell mrapi-config
--cflags)

and similarly for LDFLAGS:

LDFLAGS += $(shell mcapi-config --libs) $(shell mrapi-config --libs)

regards,
tony
Reply all
Reply to author
Forward
0 new messages