[clean-list] htoclean sorrows

SevenThunders mattcbro at earthlink.net
Mon May 15 08:16:08 MEST 2006


I appreciate the helpful  response to my platform specific troubles. 
Unfortunately I'm still not quite out of the woods yet.  I was able to fix
my toy dll example and got it to work as advertised with the changes
suggested, so that the new .icl code is

module oldmatrix 
import StdEnv
import StdList
import StdArray


rmac :: !Real !{#Real} !{#Real} -> Int;
rmac a0 a1 a2 = code {
	ccall rmac "RAA:I"
}




x :: {#Real}
x = {0.5, -0.5, 1.0, -1.0}


y :: *{#Real}
y = {0.0}


nlen :: *Int
nlen = 0


Start :: (*{#Real}, Int)
Start 
# y = {1.0, 2.0, 3.0, 4.0}
#! nlen = rmac  2.0 x  y 
= (y, nlen)

The .dll for rmac was compiled using MS visual toolkit 2003 and I have a dll
symbol file etc.

 Emboldened by this I attempted to link in 
daxpy from 3 different BLAS libraries,  libacm_dll.dll,  an MS VC generated
library,  libacml.dll,  a pgi compiled library and XP_P4.dll, and an ATLAS
library compiled by gcc.  All libraries are 32 bit windows compatible DLLs
and have been verified outside of clean.  All libraries show a daxpy symbol
using dumpbin /exports.

Under Projects->Options->Dynamic Libraries I've set it to XP_P4.dll and
under Projects->Options->Linker I've set the DLL symbol resource to
acml_library, which currently reads

XP_P4.dll
cblas_daxpy at 28



My source compiles just fine and reads as
module matrix 
import StdEnv
import StdList
import StdArray

:: *State :== Int;


cblas_daxpy :: !Int !Real !{Real}  Int !{#Real} !Int !State-> State ;
cblas_daxpy a0 a1 a2 a3 a4 a5 a6 = code {
	ccall cblas_daxpy "IRAIAI:V:I"
}



x :: {Real}
x = {0.5, -0.5, 1.0, -1.0}


// unboxed array IO, uniqueness 

y :: *{#Real}
y = {0.0}


st0 :: State
st0 = 0

Start :: (*{#Real}, State)
Start 
# y = {1.0, 2.0, 3.0, 4.0}
#! st0 = cblas_daxpy 4 -2.0 x 1 y 1 st0
= (y, st0)

But when I attempt to bring it up to date the linker says undefined symbols
cblas_daxpy
The same thing happens for libacml_dll.dll (undefined daxpy),  but for the
pgi library (which would be the best choice since it's multi-threaded and I
have a dual core processor) the code links 'without error', ie no error
messages ; but fails to produce an executable!  For these other options I
change the .dll file names, strip the cblas_ prefix and change the symbols
files.

I haven't yet tried to install the .dll's in the clean system file, but is
the linking procedure different in this case?  Is there a way to use, say
microsofts linker to make the executable?
--
View this message in context: http://www.nabble.com/htoclean-sorrows-t1598541.html#a4387474
Sent from the Clean forum at Nabble.com.



More information about the clean-list mailing list