Windows package: fix random build failure due to race condition
The MEX files are built out-of-tree (because we want to do them in parallel). This would create a potential race condition if several builds want to create the symlinks under mex/matlab/ or mex/octave/. The solution is to disable those symlinks for out-of-tree builds.time-shift
parent
677caab21e
commit
35acc111ff
|
@ -13,11 +13,15 @@ LIBS += $(MATLAB_LIBS)
|
||||||
mexdir = $(libdir)/dynare/mex/matlab
|
mexdir = $(libdir)/dynare/mex/matlab
|
||||||
|
|
||||||
all-local: $(PROGRAMS)
|
all-local: $(PROGRAMS)
|
||||||
$(MKDIR_P) $(top_srcdir)/../../matlab
|
## Create symlinks in mex/matlab/, but only if the build is not
|
||||||
cd $(top_srcdir)/../../matlab && \
|
## out-of-tree (because of the Windows installer)
|
||||||
for p in $(PROGRAMS); do \
|
if [ "$(abs_srcdir)" = "$(abs_builddir)" ]; then \
|
||||||
$(LN_S) -f $(abs_builddir)/$$p $$p; \
|
$(MKDIR_P) $(top_srcdir)/../../matlab && \
|
||||||
done
|
cd $(top_srcdir)/../../matlab && \
|
||||||
|
for p in $(PROGRAMS); do \
|
||||||
|
$(LN_S) -f $(abs_builddir)/$$p $$p; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
if test -d $(top_srcdir)/../../matlab; then \
|
if test -d $(top_srcdir)/../../matlab; then \
|
||||||
|
|
|
@ -20,11 +20,15 @@ LIBS += $(shell $(MKOCTFILE) -p FLIBS)
|
||||||
mexdir = $(libdir)/dynare/mex/octave
|
mexdir = $(libdir)/dynare/mex/octave
|
||||||
|
|
||||||
all-local: $(PROGRAMS)
|
all-local: $(PROGRAMS)
|
||||||
$(MKDIR_P) $(top_srcdir)/../../octave
|
## Create symlinks in mex/octave/, but only if the build is not
|
||||||
cd $(top_srcdir)/../../octave && \
|
## out-of-tree (because of the Windows installer)
|
||||||
for p in $(PROGRAMS); do \
|
if [ "$(abs_srcdir)" = "$(abs_builddir)" ]; then \
|
||||||
$(LN_S) -f $(abs_builddir)/$$p $$p; \
|
$(MKDIR_P) $(top_srcdir)/../../octave && \
|
||||||
done
|
cd $(top_srcdir)/../../octave && \
|
||||||
|
for p in $(PROGRAMS); do \
|
||||||
|
$(LN_S) -f $(abs_builddir)/$$p $$p; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
if test -d $(top_srcdir)/../../octave; then \
|
if test -d $(top_srcdir)/../../octave; then \
|
||||||
|
|
|
@ -220,8 +220,7 @@ cd "$ROOT_DIRECTORY"
|
||||||
export TMP_DIRECTORY ROOT_DIRECTORY LIB32 LIB64 VERSION NTHREADS
|
export TMP_DIRECTORY ROOT_DIRECTORY LIB32 LIB64 VERSION NTHREADS
|
||||||
export -f "${TASKS[@]}"
|
export -f "${TASKS[@]}"
|
||||||
parallel "set -ex;shopt -s globstar;" ::: "${TASKS[@]}"
|
parallel "set -ex;shopt -s globstar;" ::: "${TASKS[@]}"
|
||||||
# Clean up bogus symlinks left by parallel builds of MEX
|
|
||||||
rm -f ../mex/matlab/*.mexw32 ../mex/matlab/*.mexw64 ../mex/octave/*.mex
|
|
||||||
# Add supported_octave_version.m (see matlab/dynare.m)
|
# Add supported_octave_version.m (see matlab/dynare.m)
|
||||||
while read -r line
|
while read -r line
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in New Issue