我正在使用 Makefile 来设置 mo 代码所需的环境。我只是在学习并行化,非常感谢您的帮助。
# The list of packages used by the macro:
USED_PKGS = xAODRootAccess xAODTruth xAODJet xAODMissingET
test: test.o
`root-config --ld` -o $@ `root-config --libs` \
-L$(ROOTCOREDIR)/lib `rc get_ldflags $(USED_PKGS)` $^
clean:
rm -f test.o
rm -f test
.SUFFIXES: .C .o
.C.o:
`root-config --cxx` -c -o $@ `root-config --cflags` \
-I$(ROOTCOREDIR)/include `rc get_cxxflags $(USED_PKGS)` $<
我已经安装了 OpenMPI 并将其添加到 PATH 和 LD_LIBRARY_PATH。
我的代码非常简单,只想对照 Makefile 检查它:
int main()
{
int i;
#pragma omp parallel for
for ( i = 0; i < 1e8; i++ )
{
int y = 2*i;
}
}