Hello allin,
Solution found to make a libgretl-1.0.dll.a & libgretl-1.0.dll:
1) -no-undefined should be added to libtool command line when
compiling under cygwin otherwise no shared libraries can be built
2) the library -lgfortran doesnt exist in cygwin (it's only a compiler
options of gcc) so you need to replace it with -XCClinker,-lgfortran
because libtool cannot find a library and doesn't want to build the
dll
And you got :
../libtool --mode=link gcc -o libgretl-1.0.la adf_kpss.lo bhhh_max.lo bootstrap
.lo boxplots.lo calendar.lo compare.lo compat.lo csvdata.lo dataio.lo dataset.lo
dbread.lo dbwrite.lo describe.lo discrete.lo estimate.lo flow_control.lo foreca
st.lo geneval.lo genfuncs.lo genlex.lo genmain.lo gensyntax.lo gmm.lo graphing.l
o gretl_bfgs.lo gretl_bundle.lo gretl_commands.lo gretl_errors.lo gretl_fft.lo g
retl_foreign.lo gretl_func.lo gretl_intl.lo gretl_list.lo gretl_matrix.lo gretl_
model.lo gretl_panel.lo gretl_paths.lo gretl_prn.lo gretl_restrict.lo gretl_scal
ar.lo gretl_string_table.lo gretl_untar.lo gretl_utils.lo gretl_www.lo gretl_xml
.lo interact.lo kalman.lo libset.lo matrix_extra.lo missing.lo modelprint.lo mon
te_carlo.lo nls.lo nonparam.lo objstack.lo options.lo plotspec.lo plugins.lo pri
ntout.lo printscan.lo pvalues.lo qr_estimate.lo random.lo strutils.lo subsample.
lo system.lo texprint.lo transforms.lo tsls.lo usermat.lo var.lo varprint.lo var
test.lo irfboot.lo bdtr.lo btdtr.lo chbevl.lo chdtr.lo const.lo expx2.lo fdtr.lo
gamma.lo gdtr.lo igam.lo igami.lo incbet.lo incbi.lo mtherr.lo nbdtr.lo ndtr.lo
ndtri.lo pdtr.lo polevl.lo polrt.lo stdtr.lo unity.lo airy.lo hyp2f1.lo hyperg.
lo i0.lo i1.lo iv.lo j0.lo j1.lo jn.lo jv.lo k0.lo k1.lo kn.lo psi.lo struve.lo
yn.lo kv.lo chkder.lo dpmpar.lo enorm.lo fdjac2.lo lmder.lo lmder1.lo lmdif.lo l
mpar.lo qrfac.lo qrsolv.lo dlog10.lo lbfgsb.lo -no-undefined \
-rpath /usr/lib -L/usr/lib -llapack -lblas -XCClinker,-lgfortran -lm -ld
l -lz -lxml2 -lz -liconv -lm -lglib-2.0 -lintl -liconv -lgmp -lfftw3 -lm -
version-info 0:58:0
libtool: link: rm -fr .libs/libgretl-1.0.a .libs/libgretl-1.0.la .libs/libgretl
-1.0.lai
libtool: link: gcc -shared .libs/adf_kpss.o .libs/bhhh_max.o .libs/bootstrap.o
.libs/boxplots.o .libs/calendar.o .libs/compare.o .libs/compat.o .libs/csvdata.o
.libs/dataio.o .libs/dataset.o .libs/dbread.o .libs/dbwrite.o .libs/describe.o
.libs/discrete.o .libs/estimate.o .libs/flow_control.o .libs/forecast.o .libs/ge
neval.o .libs/genfuncs.o .libs/genlex.o .libs/genmain.o .libs/gensyntax.o .libs/
gmm.o .libs/graphing.o .libs/gretl_bfgs.o .libs/gretl_bundle.o .libs/gretl_comma
nds.o .libs/gretl_errors.o .libs/gretl_fft.o .libs/gretl_foreign.o .libs/gretl_f
unc.o .libs/gretl_intl.o .libs/gretl_list.o .libs/gretl_matrix.o .libs/gretl_mod
el.o .libs/gretl_panel.o .libs/gretl_paths.o .libs/gretl_prn.o .libs/gretl_restr
ict.o .libs/gretl_scalar.o .libs/gretl_string_table.o .libs/gretl_untar.o .libs/
gretl_utils.o .libs/gretl_www.o .libs/gretl_xml.o .libs/interact.o .libs/kalman.
o .libs/libset.o .libs/matrix_extra.o .libs/missing.o .libs/modelprint.o .libs/m
onte_carlo.o .libs/nls.o .libs/nonparam.o .libs/objstack.o .libs/options.o .libs
/plotspec.o .libs/plugins.o .libs/printout.o .libs/printscan.o .libs/pvalues.o .
libs/qr_estimate.o .libs/random.o .libs/strutils.o .libs/subsample.o .libs/syste
m.o .libs/texprint.o .libs/transforms.o .libs/tsls.o .libs/usermat.o .libs/var.o
.libs/varprint.o .libs/vartest.o .libs/irfboot.o .libs/bdtr.o .libs/btdtr.o .li
bs/chbevl.o .libs/chdtr.o .libs/const.o .libs/expx2.o .libs/fdtr.o .libs/gamma.o
.libs/gdtr.o .libs/igam.o .libs/igami.o .libs/incbet.o .libs/incbi.o .libs/mthe
rr.o .libs/nbdtr.o .libs/ndtr.o .libs/ndtri.o .libs/pdtr.o .libs/polevl.o .libs/
polrt.o .libs/stdtr.o .libs/unity.o .libs/airy.o .libs/hyp2f1.o .libs/hyperg.o .
libs/i0.o .libs/i1.o .libs/iv.o .libs/j0.o .libs/j1.o .libs/jn.o .libs/jv.o .lib
s/k0.o .libs/k1.o .libs/kn.o .libs/psi.o .libs/struve.o .libs/yn.o .libs/kv.o .l
ibs/chkder.o .libs/dpmpar.o .libs/enorm.o .libs/fdjac2.o .libs/lmder.o .libs/lmd
er1.o .libs/lmdif.o .libs/lmpar.o .libs/qrfac.o .libs/qrsolv.o .libs/dlog10.o .l
ibs/lbfgsb.o -L/usr/lib /usr/lib/liblapack.dll.a /usr/lib/libblas.dll.a -ldl /
usr/lib/libxml2.dll.a -lz /usr/lib/libglib-2.0.dll.a /usr/lib/libpcre.dll.a /usr
/lib/libintl.dll.a /usr/lib/libiconv.dll.a /usr/lib/libgmp.dll.a /usr/lib/libfft
w3.dll.a -o .libs/cyggretl-1.0-0.dll -Wl,--enable-auto-image-base -Xlinker --
out-implib -Xlinker .libs/libgretl-1.0.dll.a
Creating library file: .libs/libgretl-1.0.dll.a
So every shared libraries building should have the -no-undefined added
to libtool and same for those which have -lgfortran, it needs
-XCClinker,-lgfortran
Would you add it to the CVS version ?
2010/6/17 denis joubert <denis.joubert(a)gmail.com>:
Hello,
I found something some things to try.
But it will work only for cygwin (it's not recommended for all systems
so conditional usage should be done)
1) Adding this in the libtool command line can solve the problem :
-no-undefined
2) Adding in configure.in (ou configure.ac), before macro
AC_PROG_LIBTOOL the line below :
lt_cv_deplibs_check_method='pass_all'
I cannot try it before around 8 hours. I have no access to cvs
repository where i am now (cvs port are not allowed).
2010/6/17 denis joubert <denis.joubert(a)gmail.com>:
> Ok sorry. switching to gretl-dev for this.
> history of the discussion added.
> I have no more informations this morning i will looking for libtool issues.
>
> 2010/6/17 Riccardo (Jack) Lucchetti <r.lucchetti(a)univpm.it>:
>> On Wed, 16 Jun 2010, Allin Cottrell wrote:
>>
>>>
>>> On Thu, 17 Jun 2010, denis joubert wrote:
>>>
>>>> Oups an error was done in the previous message...
>>>
>>> Thanks, Denis, but I think this quite specialized discussion may
>>> be trying the patience of subscribers to the gretl-users list. I
>>> don't want to cut you off -- it would be very good to come up with
>>> a workable recipe for building gretl on cygwin -- but I'd suggest
>>> either using the gretl-devel mailing list (google: gretl-devel) or
>>> switching to personal email with me. (I'm interested and would
>>> like to continue discussion.)
>>
>> Please keep this thread in gretl-devel. I'm interested too.
>>
>>
>> Riccardo (Jack) Lucchetti
>> Dipartimento di Economia
>> Università Politecnica delle Marche
>>
>> r.lucchetti(a)univpm.it
>>
http://www.econ.univpm.it/lucchetti
>> _______________________________________________
>> Gretl-users mailing list
>> Gretl-users(a)lists.wfu.edu
>>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>>
>
> Hello Allin,
> I found some clues of what is going on when linking the shared librairies .
> I added a -debug into the libtool command line and get back what it is
> doing (log joined).
> So i got the libraries he used to try its link :
> + deplibs='/usr/lib/libgmp.dll.a /usr/lib/libiconv.dll.a
> /usr/lib/libintl.dll.a /usr/lib/libpcre.dll.a
> /usr/lib/libglib-2.0.dll.a -lz /usr/lib/libxml2.dll.a -ldl -lgfortran
> /usr/lib/libblas.dll.a /usr/lib/liblapack.dll.a -L/usr/lib -L/usr/lib
> '
>
> When i link manualy a module it work only if add libgretl-1.0.a or
> libgretl-1.0.so, you can try for example :
> $ g++ ./.libs/arbond.o /usr/lib/libgmp.dll.a /usr/lib/libiconv.dll.a
> /usr/lib/libintl.dll.a /usr/lib/libpcre.dll.a
> /usr/lib/libglib-2.0.dll.a -lz /usr/lib/libxml2.dll.a -ldl -lgfortran
> /usr/lib/libblas.dll.a /usr/lib/liblapack.dll.a -L/usr/lib
> ../lib/libgretl-1.0.so -L/usr/lib -shared -o test.so
>
> And libtool say what the problem is to us :
> *** Warning: This system can not link to static lib archive
> ../lib/libgretl-1.0.la.
> *** I have the capability to make that library automatically link in when
> *** you link to this library. But I can only do this if you have a
> *** shared version of the library, which you do not appear to have.
> *** But as you try to build a module library, libtool will still create
> *** a static module, that should work as long as the dlopening application
> *** is linked with the -dlopen flag to resolve symbols at runtime.
>
> So he said that the module should be linked with libgretl-1.0 in
> shared version !!! But there are the same problem with libgretl-1.0
> (undefined symbol)
> so i build myself with my hands libgretl-1.0.dll (with the same
> arguments sent to libtool):
> g++ adf_kpss.o bhhh_max.o bootstrap.o boxplots.o calendar.o compare.o
> compat.o csvdata.o dataio.o dataset.o dbread.o dbwrite.o describe.o
> discrete.o estimate.o flow_control.o forecast.o geneval.o genfuncs.o
> genlex.o genmain.o gensyntax.o gmm.o graphing.o gretl_bfgs.o
> gretl_bundle.o gretl_commands.o gretl_errors.o gretl_fft.o
> gretl_foreign.o gretl_func.o gretl_intl.o gretl_list.o gretl_matrix.o
> gretl_model.o gretl_panel.o gretl_paths.o gretl_prn.o gretl_restrict.o
> gretl_scalar.o gretl_string_table.o gretl_untar.o gretl_utils.o
> gretl_www.o gretl_xml.o interact.o kalman.o libset.o matrix_extra.o
> missing.o modelprint.o monte_carlo.o nls.o nonparam.o objstack.o
> options.o plotspec.o plugins.o printout.o printscan.o pvalues.o
> qr_estimate.o random.o strutils.o subsample.o system.o texprint.o
> transforms.o tsls.o usermat.o var.o varprint.o vartest.o irfboot.o
> bdtr.o btdtr.o chbevl.o chdtr.o const.o expx2.o fdtr.o gamma.o gdtr.o
> igam.o igami.o incbet.o incbi.o mtherr.o nbdtr.o ndtr.o ndtri.o pdtr.o
> polevl.o polrt.o stdtr.o unity.o airy.o hyp2f1.o hyperg.o i0.o i1.o
> iv.o j0.o j1.o jn.o jv.o k0.o k1.o kn.o psi.o struve.o yn.o kv.o
> chkder.o dpmpar.o enorm.o fdjac2.o lmder.o lmder1.o lmdif.o lmpar.o
> qrfac.o qrsolv.o dlog10.o lbfgsb.o -L/usr/lib -llapack -lblas
> -lgfortran -lm -ldl -lz -lxml2 -lz -liconv -lm -lglib-2.0 -lintl
> -liconv -lgmp -lfftw3 -lm -shared -o libgretl-1.0.dll
>
> Strange it works...
>
> so back to the plugins :
> what the hell !!! I got only :
> ../libtool --mode=link gcc -module -avoid-version -rpath /usr/lib/gretl-gtk2 -o
> arbond.la arbond.lo ../lib/libgretl-1.0.la
> libtool: link: warning: undefined symbols not allowed in
> i686-pc-cygwin shared libraries
>
> ARGH !
>
> There is something tricky with the cygwin version of libtool even with
> a right order of libraries he always find there are undefined
> symbols...
>
> thanks.
>
> 2010/6/16 denis joubert <denis.joubert(a)gmail.com>:
> - Masquer le texte des messages précédents -
>> 2010/6/16 Allin Cottrell <cottrell(a)wfu.edu>:
>>>
>>> On Wed, 16 Jun 2010, denis joubert wrote:
>>>
>>>> I launched the build process with the latest CVS.
>>>> unfortunatly, it didn't worked with shared modules.
>>>> So i sent you the log again :-)
>>>
>>> Thanks! We're still hung up on cygwin's inability to create a
>>> shared libgretl (that is what is subsequently making it impossible
>>> to build the gretl plugins as shared modules).
>>>
>>> This time, however, the compiler is giving no clue as what
>>> undefined symbols are bothering it when trying to link libgretl.
>>> (Before, there was a reference to "errno" being a problem, but
>>> that is now gone with current CVS, as should be.)
>>>
>>> This is quite puzzling, since it seems that all the symbols needed
>>> by libgretl should be provided by the various shared libraries on
>>> the linker line (libm, libz, libxml2, etc.). Indeed, this
>>> condition is satisfied when building on OS X, where the compiler
>>> also refuses to build a shared library if there are undefined
>>> symbols.
>>>
>>> Somehow we need to get the compiler to tell us what it thinks is
>>> missing. I'll see what I can find out about that.
>>
>> I have some experiences with that I will try to find out about it too
>> if I could get some time for.
>>
>>>
>>> Allin Cottrell
>>> _______________________________________________
>>> Gretl-users mailing list
>>> Gretl-users(a)lists.wfu.edu
>>>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>>>
>>
>