From bf0030e0bcef814eb74a6def06ca1096f16c8a35 Mon Sep 17 00:00:00 2001 From: Prabhanjan Kambadur Date: Mon, 1 Nov 2004 14:44:14 +0000 Subject: [PATCH] some minor changes to get things running on windows. this includes adding some linkage symbols for the components to export stuff properly. This commit was SVN r3456. --- src/mca/gpr/proxy/gpr_proxy_component.c | 2 +- src/mca/gpr/replica/gpr_replica_component.c | 2 +- src/mca/ns/proxy/src/ns_proxy_component.c | 2 +- src/mca/ns/replica/src/ns_replica_component.c | 2 +- src/mca/ptl/tcp/src/ptl_tcp.h | 3 +- src/mca/topo/unity/src/topo_unity.h | 3 +- src/mca/topo/unity/src/topo_unity_component.c | 2 +- src/mca/win_makefile | 39 ++++++++---- src/tools/win_makefile | 61 +++++++++++-------- src/win_makefile | 17 +++--- 10 files changed, 80 insertions(+), 53 deletions(-) diff --git a/src/mca/gpr/proxy/gpr_proxy_component.c b/src/mca/gpr/proxy/gpr_proxy_component.c index 6bae3b269c..37e02a5287 100644 --- a/src/mca/gpr/proxy/gpr_proxy_component.c +++ b/src/mca/gpr/proxy/gpr_proxy_component.c @@ -29,7 +29,7 @@ /* * Struct of function pointers that need to be initialized */ -mca_gpr_base_component_t mca_gpr_proxy_component = { +OMPI_COMP_EXPORT mca_gpr_base_component_t mca_gpr_proxy_component = { { MCA_GPR_BASE_VERSION_1_0_0, diff --git a/src/mca/gpr/replica/gpr_replica_component.c b/src/mca/gpr/replica/gpr_replica_component.c index faf1f145c5..18d2b75feb 100644 --- a/src/mca/gpr/replica/gpr_replica_component.c +++ b/src/mca/gpr/replica/gpr_replica_component.c @@ -34,7 +34,7 @@ /* * Struct of function pointers that need to be initialized */ -mca_gpr_base_component_t mca_gpr_replica_component = { +OMPI_COMP_EXPORT mca_gpr_base_component_t mca_gpr_replica_component = { { MCA_GPR_BASE_VERSION_1_0_0, diff --git a/src/mca/ns/proxy/src/ns_proxy_component.c b/src/mca/ns/proxy/src/ns_proxy_component.c index b803550c6b..40abc2b698 100644 --- a/src/mca/ns/proxy/src/ns_proxy_component.c +++ b/src/mca/ns/proxy/src/ns_proxy_component.c @@ -29,7 +29,7 @@ /* * Struct of function pointers that need to be initialized */ -mca_ns_base_component_t mca_ns_proxy_component = { +OMPI_COMP_EXPORT mca_ns_base_component_t mca_ns_proxy_component = { { MCA_NS_BASE_VERSION_1_0_0, diff --git a/src/mca/ns/replica/src/ns_replica_component.c b/src/mca/ns/replica/src/ns_replica_component.c index 44edeacecb..e45721421e 100644 --- a/src/mca/ns/replica/src/ns_replica_component.c +++ b/src/mca/ns/replica/src/ns_replica_component.c @@ -31,7 +31,7 @@ /* * Struct of function pointers that need to be initialized */ -mca_ns_base_component_t mca_ns_replica_component = { +OMPI_COMP_EXPORT mca_ns_base_component_t mca_ns_replica_component = { { MCA_NS_BASE_VERSION_1_0_0, diff --git a/src/mca/ptl/tcp/src/ptl_tcp.h b/src/mca/ptl/tcp/src/ptl_tcp.h index da8fc2e736..dee0cf0fd4 100644 --- a/src/mca/ptl/tcp/src/ptl_tcp.h +++ b/src/mca/ptl/tcp/src/ptl_tcp.h @@ -7,6 +7,7 @@ #ifndef MCA_PTL_TCP_H #define MCA_PTL_TCP_H +#include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H #include #endif @@ -58,7 +59,7 @@ typedef struct mca_ptl_tcp_component_t mca_ptl_tcp_component_t; struct mca_ptl_tcp_recv_frag_t; struct mca_ptl_tcp_send_frag_t; -extern mca_ptl_tcp_component_t mca_ptl_tcp_component; +OMPI_COMP_EXPORT extern mca_ptl_tcp_component_t mca_ptl_tcp_component; /** * Register TCP module parameters with the MCA framework diff --git a/src/mca/topo/unity/src/topo_unity.h b/src/mca/topo/unity/src/topo_unity.h index af5dcef746..185cae491e 100644 --- a/src/mca/topo/unity/src/topo_unity.h +++ b/src/mca/topo/unity/src/topo_unity.h @@ -9,6 +9,7 @@ #ifndef MCA_TOPO_UNTIY_H #define MCA_TOPO_UNTIY_H +#include "ompi_config.h" #include "threads/condition.h" #include "class/ompi_free_list.h" #include "util/cmd_line.h" @@ -20,7 +21,7 @@ * version information and the four functions (see below) which * are needed for this module to function with the MCA framework */ -OMPI_COMP_EXPORT extern const struct mca_topo_base_module_1_0_0_t mca_topo_unity_module; +//OMPI_COMP_EXPORT extern struct mca_topo_base_module_1_0_0_t mca_topo_unity_module; /* diff --git a/src/mca/topo/unity/src/topo_unity_component.c b/src/mca/topo/unity/src/topo_unity_component.c index 58e45472c3..033e8a7da8 100644 --- a/src/mca/topo/unity/src/topo_unity_component.c +++ b/src/mca/topo/unity/src/topo_unity_component.c @@ -30,7 +30,7 @@ const char *mca_topo_unity_component_version_string = * and finalize() are called during creation/destruction of a comm * ******************************************************************* */ -const mca_topo_base_component_1_0_0_t mca_topo_unity_component = +OMPI_COMP_EXPORT mca_topo_base_component_1_0_0_t mca_topo_unity_component = { { MCA_TOPO_BASE_VERSION_1_0_0, /* version number */ diff --git a/src/mca/win_makefile b/src/mca/win_makefile index 9e4a990b33..60642d776a 100644 --- a/src/mca/win_makefile +++ b/src/mca/win_makefile @@ -8,6 +8,7 @@ topdir = `echo $(CURDIR) | sed 's/^\//C:\/cygwin\//g' | sed 's/\/src\/mca//g'` gen_base = ${topdir}/src/win32/generated_include copy_base = ${topdir}/src/mca/ +install_dir = ${prefix} # list of components to build with the c compiler C_SUBDIRS = \ @@ -45,13 +46,13 @@ INCL = \ CFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR \ + /DOMPI_SYSCONFDIR="\"${install-dir}/share\"" \ /nologo \ /c CPPFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR \ + /DOMPI_SYSCONFDIR="\"${install-dir}/share\"" \ /c \ /TP \ /nologo \ @@ -88,25 +89,41 @@ all: \ cpplibs prebuild: - cp ${gen_base}/coll-basic-version.h ${copy_base}/coll/basic/ - cp ${gen_base}/io-romio-version.h ${copy_base}/io/romio/ - cp ${gen_base}/pcmclient-env-version.h ${copy_base}/pcmclient/env/ - cp ${gen_base}/pcmclient-seed-version.h ${copy_base}/pcmclient/seed/ - cp ${gen_base}/pcmclient-singleton-version.h ${copy_base}/pcmclient/singleton/ - cp ${gen_base}/llm-hostfile-version.h ${copy_base}/llm/hostfile/ - cp ${gen_base}/topo-unity-version.h ${copy_base}/topo/unity/ + @cp ${gen_base}/coll-basic-version.h ${copy_base}/coll/basic/ + @cp ${gen_base}/io-romio-version.h ${copy_base}/io/romio/ + @cp ${gen_base}/pcmclient-env-version.h ${copy_base}/pcmclient/env/ + @cp ${gen_base}/pcmclient-seed-version.h ${copy_base}/pcmclient/seed/ + @cp ${gen_base}/pcmclient-singleton-version.h ${copy_base}/pcmclient/singleton/ + @cp ${gen_base}/llm-hostfile-version.h ${copy_base}/llm/hostfile/ + @cp ${gen_base}/topo-unity-version.h ${copy_base}/topo/unity/ clibs: ${C_SUBDIRS} prebuild @for dirs in ${C_SUBDIRS}; do \ - (echo "Entering $${dirs}"; cd $$dirs; ${CC} ${CFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj); \ + (libname=`echo mca_$${dirs}.dll | sed 's/\/src[\/]*//g' | sed 's/\//_/g' | sed 's/_\./\./g'` ; cd $$dirs; ${CC} ${CFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} /OUT:$${libname} *.obj); \ done cpplibs: ${CPP_SUBDIRS} prebuild @for dirs in ${CPP_SUBDIRS}; do \ - (echo "Entering $${dirs}"; cd $$dirs; ${CC} ${CPPFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} *.obj); \ + (libname=`echo mca_$${dirs}.dll | sed 's/\/src[\/]*//g' | sed 's/\//_/g' | sed 's/_\./\./g'` ; cd $$dirs; ${CC} ${CPPFLAGS} ${INCL} *.c; ${LINK} ${LINKFLAGS} ${ADDLIBS} /OUT:$${libname} *.obj); \ done +install: + @echo -n "Installing components ......................." + @for dirs in ${CPP_SUBDIRS}; do \ + (dll=`echo mca_$${dirs}.dll | sed 's/\/src//g' | sed 's/\//_/g'`; exp=`echo $${dll} | sed 's/dll/exp/g`; lib=`echo $${dll} | sed 's/dll/lib/g`; \ + install -c ${CURDIR}/$${dirs}/$${dll} ${install_dir}/$${dll}; \ + if test -f ${CURDIR}/$${dirs}/$${lib}; then install -c ${CURDIR}/$${dirs}/$${lib} ${install_dir}/$${lib}; fi; \ + if test -f ${CURDIR}/$${dirs}/$${exp}; then install -c ${CURDIR}/$${dirs}/$${exp} ${install_dir}/$${exp}; fi;); \ + done + @for dirs in ${C_SUBDIRS}; do \ + (dll=`echo mca_$${dirs}.dll | sed 's/\/src//g' | sed 's/\//_/g'`; exp=`echo $${dll} | sed 's/dll/exp/g`; lib=`echo $${dll} | sed 's/dll/lib/g`; \ + install -c ${CURDIR}/$${dirs}/$${dll} ${install_dir}/$${dll}; \ + if test -f ${CURDIR}/$${dirs}/$${lib}; then install -c ${CURDIR}/$${dirs}/$${lib} ${install_dir}/$${lib}; fi; \ + if test -f ${CURDIR}/$${dirs}/$${exp}; then install -c ${CURDIR}/$${dirs}/$${exp} ${install_dir}/$${exp}; fi;); \ + done + @echo "done" + .PHONY: clean clean: diff --git a/src/tools/win_makefile b/src/tools/win_makefile index 1220bcb0fa..e222292f56 100644 --- a/src/tools/win_makefile +++ b/src/tools/win_makefile @@ -6,6 +6,10 @@ # topdir = `echo $(CURDIR) | sed 's/^\//C:\/cygwin\//g' | sed 's/\/src\/tools//g'` +install_dir = ${prefix} +libdir = ${prefix}/lib +bindir = ${prefix}/bin +incdir = ${prefix}/include # list of components to build with the c compiler C_SUBDIRS = \ @@ -27,43 +31,43 @@ INCL = \ CFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR \ + /DOMPI_SYSCONFDIR="\"${prefix}/share\"" \ /nologo \ /c CPPFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR \ + /DOMPI_SYSCONFDIR="\"${prefix}/share\"" \ /c \ /TP \ /nologo \ /EHsc ADD_INCL = \ - /DOMPI_WANT_F90_BINDINGS "" \ - /DOMPI_WANT_F90_BINDINGS ""\ - /DOMPI_CONFIGURE_USER ""\ - /DOMPI_CONFIGURE_DATE "" \ - /DOMPI_CONFIGURE_HOST "" \ - /DOMPI_F90 "" \ - /DOMPI_WANT_F90_BINDINGS "" \ - /DOMPI_BUILD_CFLAGS "" \ - /DOMPI_BUILD_CXXFLAGS "" \ - /DOMPI_BUILD_FFLAGS "" \ - /DOMPI_BUILD_FCFLAGS "" \ - /DOMPI_BUILD_LDFLAGS "" \ - /DOMPI_BUILD_LIBS "" \ - /DOMPI_MAJOR_VERSION "" \ - /DOMPI_MINOR_VERSION ""\ - /DOMPI_RELEASE_VERSION "" \ - /DOMPI_ALPHA_VERSION "" \ - /DOMPI_BETA_VERSION "" \ - /DOMPI_SVN_VERSION "" \ - /DOMPI_PREFIX "" \ - /DOMPI_BINDIR "" \ - /DOMPI_LIBDIR "" \ - /DOMPI_INCDIR "" \ - /DOMPI_PKGLIBDIR + /DOMPI_WANT_F90_BINDINGS="\"not implemented\"" \ + /DOMPI_WANT_F90_BINDINGS="\"not implemented\"" \ + /DOMPI_CONFIGURE_USER="\"not implemented\"" \ + /DOMPI_CONFIGURE_DATE="\"not implemented\"" \ + /DOMPI_CONFIGURE_HOST="\"not implemented\"" \ + /DOMPI_F90="\"not implemented\"" \ + /DOMPI_WANT_F90_BINDINGS="\"not implemented\"" \ + /DOMPI_BUILD_CFLAGS="\"not implemented\"" \ + /DOMPI_BUILD_CXXFLAGS="\"not implemented\"" \ + /DOMPI_BUILD_FFLAGS="\"not implemented\"" \ + /DOMPI_BUILD_FCFLAGS="\"not implemented\"" \ + /DOMPI_BUILD_LDFLAGS="\"not implemented\"" \ + /DOMPI_BUILD_LIBS="\"not implemented\"" \ + /DOMPI_MAJOR_VERSION="\"not implemented\"" \ + /DOMPI_MINOR_VERSION="\"not implemented\"" \ + /DOMPI_RELEASE_VERSION="\"not implemented\"" \ + /DOMPI_ALPHA_VERSION="\"not implemented\"" \ + /DOMPI_BETA_VERSION="\"not implemented\"" \ + /DOMPI_SVN_VERSION="\"not implemented\"" \ + /DOMPI_PREFIX="\"${prefix}\"" \ + /DOMPI_BINDIR="\"${bindir}\"" \ + /DOMPI_LIBDIR="\"${libdir}\"" \ + /DOMPI_INCDIR="\"${incdir}\"" \ + /DOMPI_PKGLIBDIR="\"${libdir}\"" # link with ompi.lib to resolve external symbols @@ -90,6 +94,11 @@ cpplibs: ${CPP_SUBDIRS} (echo "Entering $$dirs"; cd $$dirs; ${CC} ${CPPFLAGS} ${INCL} ${ADD_INCL} *.cc; ${LINK} ${LINKFLAGS} *.obj); \ done +install: + @for dirs in ${CPP_SUBDIRS}; do \ + (${CC} ${CPPFLAGS} ${INCL} ${ADD_INCL} *.cc; ${LINK} ${LINKFLAGS} *.obj); \ + done + .PHONY: clean clean: diff --git a/src/win_makefile b/src/win_makefile index f79b71a2c4..fbc835c63d 100644 --- a/src/win_makefile +++ b/src/win_makefile @@ -6,7 +6,10 @@ # topdir = `echo $(CURDIR) | sed 's/^\//C:\/cygwin\//g' | sed 's/\/src//g'` -install-dir = "C:\cygwin\home\pkambadu\local" +install-dir = ${prefix} +pkgdatadir = ${prefix}/share +sysconfdir = ${prefix}/etc +pkglibdir = ${prefix}/lib # list of components to build with the c compiler C_SUBDIRS = \ @@ -66,13 +69,11 @@ INCL = \ CFLAGS = \ /DWIN32 \ - /DOMPI_SYSCONFDIR \ + /DOMPI_SYSCONFDIR="\"${sysconfdir}\"" \ + /DOMPI_PKGLIBDIR="\"${pkglibdir}\"" \ + /DOMPI_PKGDATADIR="\"${pkgdatadir}\"" \ /DHAVE_CONFIG_H \ - /DOMPI_PKGDATA_DIR \ - /DOMPI_PKGLIBDIR \ - /DOMPI_SYSCONFDIR \ /DOMPI_BUILDING_LIBRARY \ - /DOMPI_PKGDATADIR \ /D_WINDLL \ /EHsc \ /MLd \ @@ -113,9 +114,6 @@ ADDLIBS = \ all: clibs libmpi -temp: - @echo ${FILES} - 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" \ @@ -146,6 +144,7 @@ install: ${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 .PHONY: clean