I figured it out, had to do that gfortran places temporary arrays on the 
heap and ifort places them on the stack. Adding the option -heap-arrays to 
ifort fixed the problem. Thanks for the help

Derek

On Friday, May 6, 2016 at 6:17:57 PM UTC-6, Erik Schnetter wrote:
>
> Derek
>
> The ccall looks correct. (I didn't count the arguments or check their 
> types, though.)
>
> A wild guess: ifort has an option -i8 that uses 8-byte integers. If you're 
> using it, you'd need to use Int64 instead. Alternatively, there could be an 
> "implicit integer*8" statement somewhere.
>
> -erik
>
> On Fri, May 6, 2016 at 7:43 PM, Derek Tucker <[email protected] 
> <javascript:>> wrote:
>
>> Erik,
>>
>> I wondered that, the library is not mine, but the code is here, work in 
>> progress
>>
>> The ccall is here (
>> https://github.com/jdtuck/spatial_pp/blob/master/thomas_pp.jl#L556)
>>
>> The library is here (
>> https://github.com/jdtuck/spatial_pp/blob/master/deps/src/nscluster/Simplex-Thomasf.f
>> )
>>
>> From what I understand everything is a pointer from ccall for Fortran, 
>> correct?
>>
>> Thanks
>>
>> Derek
>>
>> On Friday, May 6, 2016 at 5:03:48 PM UTC-6, Erik Schnetter wrote:
>>>
>>> Derek
>>>
>>> How are you interfacing it with Julia?
>>>
>>> It could be there is an error in the way you are interfacing it. This 
>>> error could be undetected with gfortran, but be visible with ifort. The 
>>> error message sounds as if you are writing to a memory location that should 
>>> not be written to (e.g. to a constant or a string). It is easy to get 
>>> confused with what is a pointer and what not when using Julia's `ccall` for 
>>> Fortran code, and this can lead to that kind of error.
>>>
>>> If you point to your code, people might be able to give better advice.
>>>
>>> -erik
>>>
>>>
>>> On Fri, May 6, 2016 at 6:03 PM, Derek Tucker <[email protected]> 
>>> wrote:
>>>
>>>> I have an external library that I am interfacing with julia, when I 
>>>> compile it with gfortran it runs without a problem. When I compile it with 
>>>> ifort i get this error 
>>>>
>>>> ERROR: ReadOnlyMemoryError()
>>>>
>>>> Anybody has any ideas why. I have test the library with ifort using a 
>>>> test program and it works fine.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Erik Schnetter <[email protected]> 
>>> http://www.perimeterinstitute.ca/personal/eschnetter/
>>>
>>
>
>
> -- 
> Erik Schnetter <[email protected] <javascript:>> 
> http://www.perimeterinstitute.ca/personal/eschnetter/
>

Reply via email to