1
1
openmpi/src/win_makefile

210 строки
5.8 KiB
Plaintext
Исходник Обычный вид История

#!/bin/sh
#
# Copyright (c) 2004-2005 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
# All rights reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is a simple makefile for windows which makes all the components
# which are required for super computing. Too lazy to open up visual
# studio each and every time to compile a component, so just adding
# this to the svn repository
#
topdir = `echo $(CURDIR) | sed 's/^\//C:\/cygwin\//g' | sed 's/\/src//g'`
install-dir = ${prefix}
pkgdatadir = ${prefix}/share
sysconfdir = ${prefix}/etc
pkglibdir = ${prefix}/lib
# list of components to build with the c compiler
C_SUBDIRS = \
attribute \
class \
communicator \
datatype \
errhandler \
event \
event/WIN32-Code \
file \
group \
info \
util \
mpi/c \
mpi/runtime \
threads \
op \
proc \
request \
runtime \
mca/base \
mca/allocator/base \
mca/coll/base \
mca/gpr/base \
mca/io/base \
mca/llm/base \
mca/mpool/base \
mca/ns/base \
mca/one/base \
mca/oob/base \
mca/op/ \
mca/pcm/base \
mca/pcmclient/base \
mca/pml/base \
mca/ptl/base \
mca/topo/base \
win32/generated_source \
win \
win32 \
mca/allocator/bucket \
mca/coll/basic \
mca/llm/hostfile/src \
mca/ns/proxy/src \
mca/gpr/proxy/ \
mca/pcmclient/env \
mca/pcmclient/seed \
mca/pcmclient/singleton \
mca/topo/unity/src \
mca/ptl/tcp/src \
mca/oob/tcp/ \
mca/pml/teg/src \
mca/ns/replica/src \
mca/gpr/replica/
EXTRA_DIRS = \
STATIC_LIBS = \
allocator \
coll\
llm\
ns\
gpr \
pcmclient\
topo\
ptl\
oob\
pml\
ns\
gpr
#
# A small function to extract the list of all files in these directories
#
FILES = $(foreach dir, ${C_SUBDIRS}, $(wildcard ${dir}/*.[ch]))
CC = cl
INCL = \
/I"${topdir}/src/event/WIN32-Code/" \
/I"${topdir}/src/event/compat/" \
/I"${topdir}/src/win32/generated_include/libltdl" \
/I"${topdir}/src/win32/generated_include" \
/I"${topdir}/src/win32/" \
/I"${topdir}/src" \
/I"${topdir}/include"
CFLAGS = \
/DWIN32 \
/DOMPI_BUILDING=1 \
/DOMPI_SYSCONFDIR="\"${sysconfdir}\"" \
/DOMPI_PKGLIBDIR="\"${pkglibdir}\"" \
/DOMPI_PKGDATADIR="\"${pkgdatadir}\"" \
/DHAVE_CONFIG_H \
/D_WINDLL \
/EHsc \
/MLd \
/W0 \
/Wp64 \
/ZI \
/Zi \
/TC \
/D_MBCS \
/Gm \
/Od \
/LDd \
/Fo"${topdir}/src/Debug/" \
/nologo \
/c
LINK = link
LINKFLAGS = \
/DLL \
/IMPLIB:libmpi.lib\
/nologo \
/OUT:libmpi.dll
ADDLIBS = \
ws2_32.lib \
kernel32.lib \
user32.lib \
gdi32.lib \
winspool.lib \
comdlg32.lib \
advapi32.lib \
shell32.lib \
ole32.lib \
oleaut32.lib \
uuid.lib \
odbc32.lib \
odbccp32.lib
all: clibs libmpi
prebuild:
@echo "Creating mca_base_parse_paramfile_lex.c"
@/usr/bin/flex -t -Pmca_base_yy "${topdir}/src/mca/base/mca_base_parse_paramfile_lex.l" \
>"${topdir}/src/mca/base/mca_base_parse_paramfile_lex.c" 2>/dev/null
@echo "Creating mca_llm_base_parse_hostfile_lex.c"
@/usr/bin/flex -t -Pmca_llm_base_yy "${topdir}/src/mca/llm/base/llm_base_parse_hostfile_lex.l" \
> "${topdir}/src/mca/llm/base/mca_llm_base_parse_hostfile_lex.c" 2>/dev/null
@echo "Creating show_help_lex.c"
@/usr/bin/flex -t -Pompi_show_help_yy "${topdir}/src/util/show_help_lex.l" \
> "${topdir}/src/util/show_help_lex.c" 2>/dev/null
@echo -n "Copying static-components.h to the right directories ......"
@for dirs in ${STATIC_LIBS}; do \
(dir="mca/$${dirs}/base"; comp_name="$${dirs}_static-components.h"; cp "${topdir}/src/win32/generated_include/$${comp_name}" "$${dir}/static-components.h";); \
done
@echo "done"
clibs: prebuild ${FILES}
@for dirs in ${C_SUBDIRS}; do \
(echo "Entering $${dirs}"; cd $$dirs; if test -f .compile_files; then (more .compile_files| xargs -i'{}' ${CC} ${CFLAGS} ${INCL} '{}'); else (ls *.c 2>/dev/null | xargs -i'{}' ${CC} ${CFLAGS} ${INCL} '{}'); fi); \
done
libmpi:
${LINK} ${LINKFLAGS} ${ADDLIBS} Debug/*.obj
install:
@echo -n "Installing libmpi and include file ................"
@install -c ${topdir}/src/libmpi.lib ${install-dir}/lib/libmpi.lib
@install -c ${topdir}/src/libmpi.exp ${install-dir}/lib/libmpi.exp
@install -c ${topdir}/src/libmpi.dll ${install-dir}/lib/libmpi.dll
@install -c ${topdir}/include/ompi_config_bottom.h \
${install-dir}/include/ompi_config_bottom.h
@install -c ${topdir}/src/win32/generated_include/ompi_config.h \
${install-dir}/include/ompi_config.h
@install -c ${topdir}/include/mpi.h ${install-dir}/include/mpi.h
@install -c ${topdir}/include/ompi_stdint.h ${install-dir}/include/ompi_stdint.h
@install -c ${topdir}/src/win32/win_compat.h ${install-dir}/include/win32/win_compat.h
@echo "done"
.PHONY: clean
clean:
@for dirs in ${C_SUBDIRS}; do \
(echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \
done
@for dirs in ${C_PPSUBDIRS}; do \
(echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \
done