On 12/18/2012 9:04 AM, Siegmar Gross wrote:
Hi,
I tried to install openmpi-1.9a1r27674 on Cygwin-1.7.17 and
got the following error (gcc-4.5.3).
Hi Siegmar
for the time being, I just released 1.6.3 packages
http://cygwin.com/ml/cygwin-announce/2012-11/msg00016.html
http://cygwin.com/ml/cygwin-announce/2012-12/msg00013.html
look on that patches and build methodology as starting point.
You can download the source package with cygwin setup.
...
CC path.lo
../../../openmpi-1.9a1r27668/opal/util/path.c: In function
'opal_path_df':
../../../openmpi-1.9a1r27668/opal/util/path.c:578:18: error:
'buf' undeclared (first use in this function)
../../../openmpi-1.9a1r27668/opal/util/path.c:578:18: note:
each undeclared identifier is reported only once for each
function it appears in
Makefile:1669: recipe for target `path.lo' failed
make[3]: *** [path.lo] Error 1
...
The reason is that "buf" is only declared for some operating
systems. I added "defined(__CYGWIN__)" in some places and
was able to compile "path.c".
hermes util 41 diff path.c path.c.orig
452c452
< #elif defined(__linux__) || defined(__CYGWIN__) ||
defined (__BSD) || (defined(__APPLE__) && defined(__MACH__))
---
#elif defined(__linux__) || defined (__BSD) ||
(defined(__APPLE__) && defined(__MACH__))
480c480
< #elif defined(__linux__) || defined(__CYGWIN__) ||
defined (__BSD) || (defined(__APPLE__) && defined(__MACH__))
---
#elif defined(__linux__) || defined (__BSD) ||
(defined(__APPLE__) && defined(__MACH__))
517c517
< #elif defined(__linux__) || defined(__CYGWIN__)
---
#elif defined(__linux__)
549c549
< #elif defined(__linux__) || defined(__CYGWIN__) ||
defined (__BSD) || \
---
#elif defined(__linux__) || defined (__BSD) || \
562c562
< #elif defined(__linux__) || defined (__CYGWIN__) ||
defined (__BSD) || \
---
#elif defined(__linux__) || defined (__BSD) || \
hermes util 42
Searching for "__linux__" delivered some more files which
must possibly be adapted.
opal/config/opal_check_os_flavors.m4
opal/mca/event/libevent2019/libevent/buffer.c
I assume that the following files do not need any changes
because they are special for Linux or for features which
are not important/available for Cygwin.
configure: { $as_echo "$as_me:${as_lineno-$LINENO}:
checking __linux__" >&5
configure:$as_echo_n "checking __linux__... " >&6; }
configure:#ifndef __linux__
configure: error: this isnt __linux__
test/util/opal_path_nfs.c
opal/asm/base/MIPS.asm:#ifdef __linux__
opal/asm/generated/atomic-mips64el.s:#ifdef __linux__
opal/asm/generated/atomic-mips64-linux.s:#ifdef __linux__
opal/asm/generated/atomic-mips-irix.s:#ifdef __linux__
opal/asm/generated/atomic-mips-linux.s:#ifdef __linux__
ompi/mca/common/verbs/common_verbs_basics.c:#if defined(__linux__)
opal/include/opal/sys/cma.h:#ifdef __linux__
opal/mca/memory/linux/arena.c:#ifdef __linux__
ompi/mca/io/romio/romio/configure: #ifdef __linux__
ompi/mca/io/romio/romio/configure.in: #ifdef __linux__
opal/include/opal/sys/mips/atomic.h:#ifdef __linux__
opal/include/opal/sys/mips/atomic.h:#ifdef __linux__
opal/include/opal/sys/mips/atomic.h:#ifdef __linux__
opal/mca/event/libevent2019/libevent/arc4random.c:#ifdef __linux__
ompi/mca/io/romio/romio/adio/ad_lustre/ad_lustre.h:#ifdef __linux__
ompi/mca/io/romio/romio/adio/ad_lustre/ad_lustre.h:#endif /* __linux__ */
Can somebody add __Cygwin__ to all necessary files? Now I get
the following error.
First we need to verify that it is the right road.
...
Making all in mca/if/windows
make[2]: Entering directory
`/home/Admin/openmpi/openmpi-1.9-Cygwin.x86.32_gcc/opal/mca/if/windows'
CC opal_if_windows.lo
../../../../../openmpi-1.9a1r27674/opal/mca/if/windows/opal_if_windows.c:
In function 'if_windows_open':
../../../../../openmpi-1.9a1r27674/opal/mca/if/windows/opal_if_windows.c:58:5:
error: 'SOCKET' undeclared (first use in this function)
../../../../../openmpi-1.9a1r27674/opal/mca/if/windows/opal_if_windows.c:58:5:
note: each undeclared identifier is reported only once for each function
it appears in
...
This is not, as you should not mix cygwin and windows program
as it will unlikely work.
(Except if you really know what you are doing).
Is it necessary to use windows sockets directly or is it possible
to use something similar to Linux sockets? Cygwin supports sockets
(based on Windows sockets as far as I know) and very often uses
similar interfaces as Linux. Which file is responsible for the
selection of "opal_if_windows.c"?
Not needed.
Configure options used for cygwin 1.6.3-4 package
LDFLAGS="-Wl,--export-all-symbols -no-undefined" \
--disable-mca-dso \
--disable-sysv-shmem \
--without-udapl \
--enable-cxx-exceptions \
--with-threads=posix \
--without-cs-fs \
--enable-heterogeneous \
--with-mpi-param_check=always \
--enable-contrib-no-build=vt,libompitrace \
--enable-mca-no-build=paffinity,installdirs-windows,timer-windows,shmem-sysv
I added the following constants to /usr/include/cygwin/shm.h before
I started to build openmpi-1.9a1r27674.
diff /usr/include/cygwin/shm.h /usr/include/cygwin/shm.h.orig
29,34d28
< /* Permission definitions */
< #define SHM_R 0400 /* read permission */
< #define SHM_W 0200 /* write permission */
<
Don't do that, that compiles does not mean that it will work.
Look on SHM.patch used on cygwin openmpi-1.6.3-4 package;
please note however that this functionality will require a running
cygserver process and it can be avoided.
As default I disabled it.
http://cygwin.com/ml/cygwin-apps/2012-11/msg00020.html
I used the following commands to configure Open MPI.
"/usr/local/jdk1.7.0" is a link to my Java installation
on Windows 7.
Windows Java is not cygwin aware...
cd /usr/local
ln -s /cygdrive/c/Program\ Files\ \(x86\)/jdk1.7.0 jdk1.7.0
../openmpi-1.9a1r27674/configure --prefix=/usr/local/openmpi-1.9 \
--with-jdk-bindir=/usr/local/jdk1.7.0/bin \
--with-jdk-headers=/usr/local/jdk1.7.0/include \
JAVA_HOME=/usr/local/jdk1.7.0 \
LDFLAGS="-m32 -Wl,--export-all-symbols -no-undefined" \
CC="gcc" CXX="g++" FC="gfortran" \
CFLAGS="-m32" CXXFLAGS="-m32" FCFLAGS="-m32" \
CPP="cpp" CXXCPP="cpp" \
CPPFLAGS="" CXXCPPFLAGS="" \
C_INCL_PATH="" C_INCLUDE_PATH="" CPLUS_INCLUDE_PATH="" \
OBJC_INCLUDE_PATH="" OPENMPI_HOME="" \
--enable-cxx-exceptions \
--enable-mpi-java \
--enable-heterogeneous \
--enable-opal-multi-threads \
--enable-mpi-thread-multiple \
--with-threads=posix \
--with-hwloc=internal \
--without-verbs \
--without-udapl \
--without-sctp \
--with-wrapper-cflags=-m32 \
--enable-debug \
--disable-mca-dso \
--without-cs-fs \
--enable-contrib-no-build=vt,libompitrace \
--enable-mca-no-build=memory_mallopt,paffinity,installdirs-windows,timer-windows
\
|& tee log.configure.$SYSTEM_ENV.$MACHINE_ENV
It would be great, if I could get a working Open MPI version with
Java interface on Cygwin. Thank you very much for any help in advance.
First you need to build jdk for cygwin
Kind regards
Siegmar
Regards
Marco