From alexander.braumann at tuwien.ac.at  Tue Jul 22 15:57:39 2014
From: alexander.braumann at tuwien.ac.at (Alexander Braumann)
Date: Tue, 22 Jul 2014 15:57:39 +0200
Subject: [Rd] Problems with building a private R-package with Fortran source
 under Windows
Message-ID: <53CE6DD3.7060901@tuwien.ac.at>

Hi,

I recently managed to port the slicot library (http://slicot.org/) to R. 
I created a new package, put the fortran libs into the src directory 
together with a Makevars file that include the line:

PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

R CMD check did run through on my ubuntu 14.04 64bit machine with 1 
warning and 4 notes.

Now I wanted to create a Windows version of that package by simply 
sending it to http://win-builder.r-project.org/ and because I am not 
capable of compiling on Windows.

As a respone I got the following error message:

  installing *source* package 'slicot' ...
** libs

*** arch - i386
gfortran      -O3  -mtune=core2 -c AB01MD.f -o AB01MD.o
gfortran      -O3  -mtune=core2 -c AB01ND.f -o AB01ND.o
gfortran      -O3  -mtune=core2 -c AB01OD.f -o AB01OD.o
.
.
. (truncated)
.
gfortran      -O3  -mtune=core2 -c delctg.f -o delctg.o
gfortran      -O3  -mtune=core2 -c select.f -o select.o
gcc -shared -s -static-libgcc -o slicot.dll tmp.def AB01MD.o AB01ND.o AB01OD.o AB04MD.o AB05MD.o AB05ND.o
AB05OD.o AB05PD.o AB05QD.o AB05RD.o AB05SD.o AB07MD.o AB07ND.o AB08MD.o AB08MZ.o AB08ND.o AB08NX.o AB08NZ.o
AB09AD.o AB09AX.o AB09BD.o AB09BX.o AB09CD.o AB09CX.o AB09DD.o AB09ED.o AB09FD.o AB09GD.o AB09HD.o AB09HX.o
AB09HY.o AB09ID.o AB09IX.o AB09IY.o AB09JD.o AB09JV.o AB09JW.o AB09JX.o AB09KD.o AB09KX.o AB09MD.o AB09ND.o AB13AD.o
AB13AX.o AB13BD.o AB13CD.o AB13DD.o AB13DX.o AB13ED.o AB13FD.o AB13ID.o AB13MD.o AB8NXZ.o AG07BD.o AG08BD.o AG08BY.o
AG08BZ.o AG8BYZ.o BB01AD.o BB02AD.o BB03AD.o BB04AD.o BD01AD.o BD02AD.o DE01OD.o DE01PD.o DF01MD.o DG01MD.o DG01ND.o
DG01NY.o DG01OD.o DK01MD.o FB01QD.o FB01RD.o FB01SD.o FB01TD.o FB01VD.o FD01AD.o IB01AD.o IB01BD.o IB01CD.o IB01MD.o
IB01MY.o IB01ND.o IB01OD.o IB01OY.o IB01PD.o IB01PX.o IB01PY.o IB01QD.o IB01RD.o IB03AD.o IB03BD.o MA01AD.o MA01BD.o
MA01BZ.o MA01CD.o MA02AD.o MA02BD.o MA02BZ.o MA02CD.o MA02CZ.o MA02DD.o MA02ED.o MA02ES.o MA02EZ.o MA02FD.o MA02GD.o
MA02GZ.o MA02HD.o MA02ID.o MA02IZ.o MA02JD.o MA02JZ.o MB01KD.o MB01LD.o MB01MD.o MB01ND.o MB01PD.o MB01QD.o MB01RD.o
MB01RU.o MB01RW.o MB01RX.o MB01RY.o MB01SD.o MB01TD.o MB01UD.o MB01UW.o MB01UX.o MB01VD.o MB01WD.o MB01XD.o MB01XY.o MB01YD.o
MB01ZD.o MB02CD.o MB02CU.o MB02CV.o MB02CX.o MB02CY.o MB02DD.o MB02ED.o MB02FD.o MB02GD.o MB02HD.o MB02ID.o MB02JD.o
MB02JX.o MB02KD.o MB02MD.o MB02ND.o MB02NY.o MB02OD.o MB02PD.o MB02QD.o MB02QY.o MB02RD.o MB02RZ.o MB02SD.o MB02SZ.o
MB02TD.o MB02TZ.o MB02UD.o MB02UU.o MB02UV.o MB02UW.o MB02VD.o MB02WD.o MB02XD.o MB02YD.o MB03AD.o MB03BA.o MB03BB.o
MB03BC.o MB03BD.o MB03BE.o MB03BZ.o MB03CD.o MB03CZ.o MB03DD.o MB03DZ.o MB03ED.o MB03FD.o MB03FZ.o MB03GD.o MB03GZ.o
MB03HD.o MB03HZ.o MB03ID.o MB03IZ.o MB03JD.o MB03JZ.o MB03KA.o MB03KB.o MB03KC.o MB03KD.o MB03KE.o MB03LD.o MB03LF.o
MB03LZ.o MB03MD.o MB03MY.o MB03ND.o MB03NY.o MB03OD.o MB03OY.o MB03PD.o MB03PY.o MB03QD.o MB03QX.o MB03QY.o MB03RD.o
MB03RX.o MB03RY.o MB03SD.o MB03TD.o MB03TS.o MB03UD.o MB03VD.o MB03VY.o MB03WA.o MB03WD.o MB03WX.o MB03XD.o MB03XP.o
MB03XS.o MB03XU.o MB03XZ.o MB03YA.o MB03YD.o MB03YT.o MB03ZA.o MB03ZD.o MB04AD.o MB04AZ.o MB04BD.o MB04BZ.o MB04CD.o
MB04DD.o MB04DI.o MB04DS.o MB04DY.o MB04DZ.o MB04ED.o MB04FD.o MB04GD.o MB04HD.o MB04ID.o MB04IY.o MB04IZ.o MB04JD.o
MB04KD.o MB04LD.o MB04MD.o MB04ND.o MB04NY.o MB04OD.o MB04OW.o MB04OX.o MB04OY.o MB04PA.o MB04PB.o MB04PU.o MB04PY.o
MB04QB.o MB04QC.o MB04QF.o MB04QS.o MB04QU.o MB04RB.o MB04RU.o MB04SU.o MB04TB.o MB04TS.o MB04TT.o MB04TU.o MB04TV.o
MB04TW.o MB04TX.o MB04TY.o MB04UD.o MB04VD.o MB04VX.o MB04WD.o MB04WP.o MB04WR.o MB04WU.o MB04XD.o MB04XY.o MB04YD.o
MB04YW.o MB04ZD.o MB05MD.o MB05MY.o MB05ND.o MB05OD.o MB05OY.o MB3OYZ.o MB3PYZ.o MC01MD.o MC01ND.o MC01OD.o MC01PD.o
MC01PY.o MC01QD.o MC01RD.o MC01SD.o MC01SW.o MC01SX.o MC01SY.o MC01TD.o MC01VD.o MC01WD.o MC03MD.o MC03ND.o MC03NX.o
MC03NY.o MD03AD.o MD03BA.o MD03BB.o MD03BD.o MD03BF.o MD03BX.o MD03BY.o NF01AD.o NF01AY.o NF01BA.o NF01BB.o NF01BD.o
NF01BE.o NF01BF.o NF01BP.o NF01BQ.o NF01BR.o NF01BS.o NF01BU.o NF01BV.o NF01BW.o NF01BX.o NF01BY.o SB01BD.o SB01BX.o
SB01BY.o SB01DD.o SB01FY.o SB01MD.o SB02CX.o SB02MD.o SB02MR.o SB02MS.o SB02MT.o SB02MU.o SB02MV.o SB02MW.o SB02ND.o
SB02OD.o SB02OU.o SB02OV.o SB02OW.o SB02OX.o SB02OY.o SB02PD.o SB02QD.o SB02RD.o SB02RU.o SB02SD.o SB03MD.o SB03MU.o
SB03MV.o SB03MW.o SB03MX.o SB03MY.o SB03OD.o SB03OR.o SB03OT.o SB03OU.o SB03OV.o SB03OY.o SB03PD.o SB03QD.o SB03QX.o
SB03QY.o SB03RD.o SB03SD.o SB03SX.o SB03SY.o SB03TD.o SB03UD.o SB04MD.o SB04MR.o SB04MU.o SB04MW.o SB04MY.o SB04ND.o
SB04NV.o SB04NW.o SB04NX.o SB04NY.o SB04OD.o SB04OW.o SB04PD.o SB04PX.o SB04PY.o SB04QD.o SB04QR.o SB04QU.o SB04QY.o
SB04RD.o SB04RV.o SB04RW.o SB04RX.o SB04RY.o SB06ND.o SB08CD.o SB08DD.o SB08ED.o SB08FD.o SB08GD.o SB08HD.o SB08MD.o
SB08MY.o SB08ND.o SB08NY.o SB09MD.o SB10AD.o SB10DD.o SB10ED.o SB10FD.o SB10HD.o SB10ID.o SB10JD.o SB10KD.o SB10LD.o
SB10MD.o SB10PD.o SB10QD.o SB10RD.o SB10SD.o SB10TD.o SB10UD.o SB10VD.o SB10WD.o SB10YD.o SB10ZD.o SB10ZP.o SB16AD.o
SB16AY.o SB16BD.o SB16CD.o SB16CY.o SG02AD.o SG03AD.o SG03AX.o SG03AY.o SG03BD.o SG03BU.o SG03BV.o SG03BW.o SG03BX.o
SG03BY.o TB01ID.o TB01IZ.o TB01KD.o TB01LD.o TB01MD.o TB01ND.o TB01PD.o TB01TD.o TB01TY.o TB01UD.o TB01VD.o TB01VY.o
TB01WD.o TB01XD.o TB01XZ.o TB01YD.o TB01ZD.o TB03AD.o TB03AY.o TB04AD.o TB04AY.o TB04BD.o TB04BV.o TB04BW.o TB04BX.o
TB04CD.o TB05AD.o TC01OD.o TC04AD.o TC05AD.o TD03AD.o TD03AY.o TD04AD.o TD05AD.o TF01MD.o TF01MX.o TF01MY.o TF01ND.o
TF01OD.o TF01PD.o TF01QD.o TF01RD.o TG01AD.o TG01AZ.o TG01BD.o TG01CD.o TG01DD.o TG01ED.o TG01FD.o TG01FZ.o TG01HD.o
TG01HX.o TG01HY.o TG01ID.o TG01JD.o TG01JY.o TG01WD.o UD01BD.o UD01CD.o UD01DD.o UD01MD.o UD01MZ.o UD01ND.o UE01MD.o
delctg.o select.o
-LD:/RCompile/recent/R-3.1.1/bin/i386 -lRlapack -LD:/RCompile/recent/R-3.1.1/bin/i386 -lRblas
-lgfortran -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib/i386 -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib
-lgfortran -LD:/RCompile/recent/R-3.1.1/bin/i386 -lR
AB08NZ.o:AB08NZ.f:(.text+0x658): undefined reference to `ztzrzf_'
AB08NZ.o:AB08NZ.f:(.text+0x78f): undefined reference to `zunmrz_'
AB08NZ.o:AB08NZ.f:(.text+0x150e): undefined reference to `ztzrzf_'
AB08NZ.o:AB08NZ.f:(.text+0x161e): undefined reference to `zunmrz_'
AB08NZ.o:AB08NZ.f:(.text+0x173c): undefined reference to `zunmrz_'
AB13MD.o:AB13MD.f:(.text+0x1a09): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x210b): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x2232): undefined reference to `zgetri_'
AB13MD.o:AB13MD.f:(.text+0x2f8e): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x3bae): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x3cd1): undefined reference to `zgetri_'
AB13MD.o:AB13MD.f:(.text+0x4e4c): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x5ada): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x64b7): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x6c51): undefined reference to `zgees_'
AB13MD.o:AB13MD.f:(.text+0x75ac): undefined reference to `zgees_'
AB8NXZ.o:AB8NXZ.f:(.text+0x3b3): undefined reference to `zunmrq_'
AB8NXZ.o:AB8NXZ.f:(.text+0x469): undefined reference to `zunmrq_'
AB8NXZ.o:AB8NXZ.f:(.text+0x785): undefined reference to `zlatzm_'
AB8NXZ.o:AB8NXZ.f:(.text+0xa77): undefined reference to `zunmrq_'
AB8NXZ.o:AB8NXZ.f:(.text+0xb5d): undefined reference to `zunmrq_'
AB8NXZ.o:AB8NXZ.f:(.text+0xe99): undefined reference to `zlapmt_'
AG08BZ.o:AG08BZ.f:(.text+0x80c): undefined reference to `ztzrzf_'
AG08BZ.o:AG08BZ.f:(.text+0x936): undefined reference to `zunmrz_'
AG08BZ.o:AG08BZ.f:(.text+0x177f): undefined reference to `ztzrzf_'
AG08BZ.o:AG08BZ.f:(.text+0x187f): undefined reference to `zunmrz_'
AG08BZ.o:AG08BZ.f:(.text+0x1a9e): undefined reference to `zunmrz_'
AG8BYZ.o:AG8BYZ.f:(.text+0x5c0): undefined reference to `zlatzm_'
AG8BYZ.o:AG8BYZ.f:(.text+0x1128): undefined reference to `zlaic1_'
AG8BYZ.o:AG8BYZ.f:(.text+0x1181): undefined reference to `zlaic1_'
AG8BYZ.o:AG8BYZ.f:(.text+0x13c4): undefined reference to `zlapmt_'
MB02TZ.o:MB02TZ.f:(.text+0x1ea): undefined reference to `zlacon_'
MB03BZ.o:MB03BZ.f:(.text+0x1fbe): undefined reference to `zlarnv_'
MB03LZ.o:MB03LZ.f:(.text+0x17d0): undefined reference to `zhgeqz_'
MB04BZ.o:MB04BZ.f:(.text+0x17a0): undefined reference to `zhgeqz_'
MB3OYZ.o:MB3OYZ.f:(.text+0x774): undefined reference to `zlaic1_'
MB3OYZ.o:MB3OYZ.f:(.text+0x7cb): undefined reference to `zlaic1_'
MB3PYZ.o:MB3PYZ.f:(.text+0x97a): undefined reference to `zlaic1_'
MB3PYZ.o:MB3PYZ.f:(.text+0x9f4): undefined reference to `zlaic1_'
TG01FZ.o:TG01FZ.f:(.text+0x93a): undefined reference to `ztzrzf_'
TG01FZ.o:TG01FZ.f:(.text+0xa16): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0xb11): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0xc08): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0x18b4): undefined reference to `ztzrzf_'
TG01FZ.o:TG01FZ.f:(.text+0x19d3): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0x1d3c): undefined reference to `ztzrzf_'
TG01FZ.o:TG01FZ.f:(.text+0x1ede): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0x1ff4): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0x22bb): undefined reference to `zunmrz_'
TG01FZ.o:TG01FZ.f:(.text+0x23cf): undefined reference to `zunmrz_'
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'slicot'
* removing 'd:/RCompile/CRANguest/R-release/lib/slicot'

I figured out that the undefined references are LAPACK functions. I am 
not an expert in compiling packages, but I thought my line in Makevars 
already linked to the LAPACK lib.

Can anyone help me on this?

All the best,

Alexander



[Rd] Problems with building a private R-package with Fortran source under Windows
Alexander Braumann