Windows: ensure that libgomp is statically linked

parent a5578e6b
......@@ -59,6 +59,8 @@ case ${MATLAB_ARCH} in
MATLAB_LDFLAGS_NOMAP="-static-libgcc -static-libstdc++ -shared -L$MATLAB/bin/${MATLAB_ARCH} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,-Bdynamic,--no-whole-archive"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP \$(abs_top_srcdir)/mex.def"
MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack -lmwblas"
# Hack for static linking of libgomp, needed for OpenMP
OPENMP_LDFLAGS="-Wl,-Bstatic,--whole-archive -lgomp -Wl,-Bdynamic,--no-whole-archive"
ax_mexopts_ok="yes"
;;
maci | maci64)
......@@ -132,4 +134,5 @@ AC_SUBST([MATLAB_CFLAGS])
AC_SUBST([MATLAB_CXXFLAGS])
AC_SUBST([MATLAB_LDFLAGS])
AC_SUBST([MATLAB_LIBS])
AC_SUBST([OPENMP_LDFLAGS])
])
......@@ -4,6 +4,7 @@ TOPDIR = $(top_srcdir)/../../sources/block_kalman_filter
block_kalman_filter_CPPFLAGS = $(AM_CPPFLAGS) -I$(TOPDIR)
block_kalman_filter_CXXFLAGS = $(AM_CXXFLAGS) -fopenmp
block_kalman_filter_LDFLAGS = $(AM_LDFLAGS) $(OPENMP_LDFLAGS)
nodist_block_kalman_filter_SOURCES = block_kalman_filter.cc
......
......@@ -4,6 +4,7 @@ nodist_sparse_hessian_times_B_kronecker_C_SOURCES = sparse_hessian_times_B_krone
nodist_A_times_B_kronecker_C_SOURCES = A_times_B_kronecker_C.cc
sparse_hessian_times_B_kronecker_C_CXXFLAGS = $(AM_CXXFLAGS) -fopenmp
sparse_hessian_times_B_kronecker_C_LDFLAGS = $(AM_LDFLAGS) $(OPENMP_LDFLAGS)
BUILT_SOURCES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES) $(nodist_A_times_B_kronecker_C_SOURCES)
CLEANFILES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES) $(nodist_A_times_B_kronecker_C_SOURCES)
......
......@@ -3,6 +3,7 @@ mex_PROGRAMS = local_state_space_iteration_2
nodist_local_state_space_iteration_2_SOURCES = local_state_space_iteration_2.cc
local_state_space_iteration_2_CXXFLAGS = $(AM_CXXFLAGS) -fopenmp
local_state_space_iteration_2_LDFLAGS = $(AM_LDFLAGS) $(OPENMP_LDFLAGS)
BUILT_SOURCES = $(nodist_local_state_space_iteration_2_SOURCES)
CLEANFILES = $(nodist_local_state_space_iteration_2_SOURCES)
......
......@@ -6,6 +6,7 @@ nodist_perfect_foresight_problem_SOURCES = perfect_foresight_problem.cc DynamicM
perfect_foresight_problem_CPPFLAGS = $(AM_CPPFLAGS) -I$(TOPDIR)
perfect_foresight_problem_CXXFLAGS = $(AM_CXXFLAGS) -fopenmp
perfect_foresight_problem_LDFLAGS = $(AM_LDFLAGS) $(OPENMP_LDFLAGS)
perfect_foresight_problem_LDADD = $(LIBADD_DLOPEN)
BUILT_SOURCES = $(nodist_perfect_foresight_problem_SOURCES)
......
......@@ -4,6 +4,7 @@ TOPDIR = $(top_srcdir)/../../sources/sobol
qmc_sequence_CPPFLAGS = $(AM_CPPFLAGS) -I$(TOPDIR)
qmc_sequence_CXXFLAGS = $(AM_CXXFLAGS) -fopenmp
qmc_sequence_LDFLAGS = $(AM_LDFLAGS) $(OPENMP_LDFLAGS)
nodist_qmc_sequence_SOURCES = qmc_sequence.cc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment