[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mingw linking error: missing -lregex and -larpack for liboctave?
From: |
Benjamin Lindner |
Subject: |
mingw linking error: missing -lregex and -larpack for liboctave? |
Date: |
Thu, 08 Jan 2009 21:34:55 +0100 |
User-agent: |
Thunderbird 2.0.0.18 (Windows/20081105) |
Hello,
Trying to build the current octave development sources for win32/mingw I
ran into the following error when linking liboctave.dll:
regex-match.o:regex-match.cc:(.text+0xa2): undefined reference to `_regexec'
regex-match.o:regex-match.cc:(.text+0xf3): undefined reference to `_regfree'
regex-match.o:regex-match.cc:(.text+0x163): undefined reference to
`_regfree'
regex-match.o:regex-match.cc:(.text+0x4ed): undefined reference to
`_regcomp'
regex-match.o:regex-match.cc:(.text+0x52f): undefined reference to
`_regerror'
regex-match.o:regex-match.cc:(.text+0x560): undefined reference to
`_regerror'
regex-match.o:regex-match.cc:(.text+0x68f): undefined reference to
`_regfree'
regex-match.o:regex-match.cc:(.text+0x79f): undefined reference to
`_regfree'
regex-match.o:regex-match.cc:(.text+0x80f): undefined reference to
`_regfree'
regex-match.o:regex-match.cc:(.text+0x88a): undefined reference to
`_regfree'
eigs-base.o:eigs-base.cc:(.text+0x60c): undefined reference to `_dnaupd_'
eigs-base.o:eigs-base.cc:(.text+0xefb): undefined reference to `_dneupd_'
eigs-base.o:eigs-base.cc:(.text+0x2669): undefined reference to `_dsaupd_'
eigs-base.o:eigs-base.cc:(.text+0x2e67): undefined reference to `_dseupd_'
eigs-base.o:eigs-base.cc:(.text+0x3f8d): undefined reference to `_znaupd_'
eigs-base.o:eigs-base.cc:(.text+0x4b41): undefined reference to `_zneupd_
This looks like the linker is missing -lregex and -larpack, and indeed,
they are missing, as linking libraries read:
-L../libcruft -L. -lcruft.dll -lcholmod -lumfpack -lamd -lcamd
-lcolamd -lccolamd -lcxsparse -llapack -lblas -lfftw3 -lfftw3f
-lreadline -lglob -lreadline -lncurses -lblas -lhdf5 -lz -lm -lws2_32
-lkernel32 -lgfortran -lstdc++_s
However, the at configure stage, both the regex and arpack library are
reported as found.
As to ARPACK:
I found that in liboactave/Makefile.in, $(LINK_DEPS) does not contain
$(ARPACK_LIBS). Shouldn't it be there, namely in front of $(BLAS_LIBS)?
As to regex:
Here I got confused. config.log reports
configure:8552: checking for regexec in -lregex
configure:8587: mingw32-gcc-4.3.0-dw2 -o conftest.exe -O2 -Wall
-march=i686 -mtune=generic -shared-libgcc conftest.c -lregex -lm >&5
configure:8593: $? = 0
configure:8611: result: yes
but at the end
REGEX libraries: -lpcre
Now judging from configure.in, I see
AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [
AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)])
if test $WITH_REGEX = yes ; then
AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.])
if test $WITH_PCRE = no ; then
AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [
AC_CHECK_LIB(regex, regexec, REGEX_LIBS="-lregex")])
fi
fi
This looks strange to me. First, AC_CHECK_FUNCS(regexec,... ) and
AC_CECK_LIB(regex, regexec,... ) is executed twice ??
Second, REGEX_LIBS="-lregex" is only executed, if PCRE is *not*
available, right?
But libpcre does not depend on libregex, hence -lregex is not added to
REGEX_LIBS (not even by pcre-config). So I end up missing -lregex
although it is present.
And finally, liboctave/makefile.in should also contain $(REGEX_LIBS) in
$(LINK_DEPS).
Long talk's conclusion, please consider the attached changeset which
fixes the issues and allows clean build of the development sources with
mingw32
benjamin
# HG changeset patch
# User Benjamin Lindner <address@hidden>
# Date 1231446734 -3600
# Node ID 680fac2d67244128bf8e1c345b481a9bf2c19f82
# Parent dd52e541418b6ad9d788c0710bdf12727f06f1ab
add -lregex to REGEX_LIBS at configure stage, add ARPACK_LIBS, REGEX_LIBS to
liboctave's link deps
diff -r dd52e541418b -r 680fac2d6724 ChangeLog
--- a/ChangeLog Mon Jan 05 21:33:54 2009 -0500
+++ b/ChangeLog Thu Jan 08 21:32:14 2009 +0100
@@ -1,3 +1,8 @@
+2008-01-08 Benjamin Lindner <address@hidden>
+
+ * configure.in: Addition of -lregex to REGEX_LIBS
+ * liboctave/Makefile.in: add ARPACK_LIBS and REGEX_LIBS to LINK_DEPS
+
2008-12-23 David Bateman <address@hidden>
* configure.in: Add configuration test for ARPACK.
diff -r dd52e541418b -r 680fac2d6724 configure.in
--- a/configure.in Mon Jan 05 21:33:54 2009 -0500
+++ b/configure.in Thu Jan 08 21:32:14 2009 +0100
@@ -453,10 +453,8 @@
AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)])
if test $WITH_REGEX = yes ; then
AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.])
- if test $WITH_PCRE = no ; then
AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [
- AC_CHECK_LIB(regex, regexec, REGEX_LIBS="-lregex")])
- fi
+ AC_CHECK_LIB(regex, regexec, REGEX_LIBS="$REGEX_LIBS -lregex")])
fi
if test $WITH_REGEX = no; then
warn_regex="regular expression functions not found. The regular expression
matching functions will be disabled."
diff -r dd52e541418b -r 680fac2d6724 liboctave/Makefile.in
--- a/liboctave/Makefile.in Mon Jan 05 21:33:54 2009 -0500
+++ b/liboctave/Makefile.in Thu Jan 08 21:32:14 2009 +0100
@@ -38,7 +38,7 @@
-L../libcruft -L. $(RLD_FLAG) \
$(LIBCRUFT) $(CHOLMOD_LIBS) $(UMFPACK_LIBS) $(AMD_LIBS) \
$(CAMD_LIBS) $(COLAMD_LIBS) $(CCOLAMD_LIBS) $(CXSPARSE_LIBS) \
- $(BLAS_LIBS) $(FFTW_LIBS) $(LIBREADLINE) $(LIBGLOB) $(LIBS) $(FLIBS)
+ $(ARPACK_LIBS) $(BLAS_LIBS) $(FFTW_LIBS) $(LIBREADLINE) $(LIBGLOB)
$(REGEX_LIBS) $(LIBS) $(FLIBS) $(CXXLIBS)
MATRIX_INC := Array.h Array2.h Array3.h ArrayN.h DiagArray2.h \
Array-util.h ArrayN-idx.h MArray-defs.h \
- mingw linking error: missing -lregex and -larpack for liboctave?,
Benjamin Lindner <=