How to use CoolProp and LibreOffice Calc together on Linux?

563 views
Skip to first unread message

Clodoaldo Carvalho

unread,
Jul 14, 2014, 10:24:35 AM7/14/14
to coolpro...@googlegroups.com

Hi,


I'm trying to use CoolProp together with LibreOffice Calc spreadsheets on Linux (Ubuntu 64 bit). My goal is to use them in the courses on Applied Thermodynamics, Heat Transfer, Refrigeration and Air Conditioning that I teach.


I tried the CoolProp.dll and TestLibreOffice.ods without success, even customizing macro CoolProp (changing \ to / ...) in the spreadsheet.


So I ask: Is there a dynamic library compiled for Linux? If not, how can I compile one from the source.


Any help would be appreciated.


Clodoaldo Carvalho

--

Professor

Federal University of Ceará

Technology Center

Dept. of Mechanical Engineering

Fortaleza/CE-Brazil

Ian Bell

unread,
Jul 16, 2014, 4:28:22 PM7/16/14
to Clodoaldo Carvalho, coolpro...@googlegroups.com
Forwarded From Reiner Mayers:

Hello Clodoaldo,

I use Ubuntu LTS 14.04 and I build and install CoolProp using Python tools.
I use OObasic to call python functions, my code is still very alpha, but
it works for me. There is not even the most simple error catching ... and version >4 of
LibreOffice is required (I have 4.2.4.2)

running as root  or with sudo :

        apt-get install libreoffice-script-provider-
python
        apt-get install python3-uno
        pip3 install Cython
        pip3 install CoolProp

compiles and installs Coolprop 4.2.3

        mkdir -p $HOME/.config/libreoffice/4/user/Scripts/python
        copy the attached coolprop.py into that directory and have a look at it
            it is a most simple wrapper for one imported python function
            (! DO NOT use    import    as first statement in a line of python code with Open- or LibreOffice !)
        Make sure Macros are active in your LibreOffice
        Open the attached TestLibreOfficePy-3.ods

You will find a very simple Propane calculation example in table1.
This is only a working example that shows how it can be used in
principle, no warranty ...
Modify it to your needs :)


Kind regards from germany
Reiner Mayers

Lecturer
Bundesfachschule Kälte-Klima-Technik





On Tue, Jul 15, 2014 at 8:48 AM, Ian Bell <ian.h...@gmail.com> wrote:
On linux, calling the DLL from scilab should I think be the same as calling the DLL from scilab on windows.  The only possible wrinkle might be the calling conventions and how it exports the symbols from the DLL.  But in principle it should be fine I think.

And yes, its a pity that LibreOffice doesn't play nicely with shared libraries on linux.


On Tue, Jul 15, 2014 at 8:39 AM, Clodoaldo Carvalho <clod...@ufc.br> wrote:

Hi,

You're right about the limitation to use CoolProp shared library and LibreOffice on Linux. I succeed to compile the shared library libCoolProp.so from the source code downloaded (github.com) with the correct wrapper. After some trials, I read somewhere LibreOffice BASIC don't allow to call shared library function on Linux as it does on Windows. Its a pitty! :(

By the way, I saw that CoolProp functions (dll) can be used with Scilab on Windows. Is it possible to use the shared library (libCoolProp.so) I compiled with Scilab on Linux? If possible, how could I do that?

Cheers,

Clodoaldo Carvalho.

--

Professor

Federal University of Ceará

Technology Center

Dept. of Mechanical Engineering

Fortaleza/CE-Brazil



2014-07-14 15:50 GMT-03:00 Ian Bell <ian.h...@gmail.com>:

I don't remember exactly, but I believe you need to run the makefile
from the folder in which it is found.  I can try to boot up my virtual
box and take a look.

On 7/14/14, Clodoaldo Carvalho <clod...@ufc.br> wrote:
> Hi Ian,
>
> Thanks for your help. I tried to compile the shared library from the source
> coude (zip file) with the makefile you suggested. I put the makefile in the
> '../coolprop-master' dir and changed the COOLPROPDIR accordingly, but I got
> the following output:  makefile:161:  *** missing separator
>
> Any hints?
>
> Cheers,

>
> Clodoaldo Carvalho
>
> --
>
> Professor
>
> Federal University of Ceará
>
> Technology Center
>
> Dept. of Mechanical Engineering
>
> Fortaleza/CE-Brazil
>
>
>
> 2014-07-14 12:17 GMT-03:00 Ian Bell <ian.h...@gmail.com>:
>
>> I am not sure it is possible at all to do what you want in Linux, I am
>> not
>> sure what the functionalities in LibreOffice are for calling shared
>> libraries.  Have you been able to get it working on windows?
>>
>> That said, it should be possible to compile a shared library for linux,
>> the makefile is at
>> https://github.com/ibell/coolprop/tree/master/wrappers/SharedLibrary .
>> You will have to check out all of CoolProp, either using git or by
>> downloading a zip file the source from
>> https://github.com/ibell/coolprop/archive/master.zip
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "coolprop-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to coolprop-user...@googlegroups.com.
>>>
>>> To post to this group, send email to coolpro...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/coolprop-users.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>



TestLibreOfficePy-3.ods
coolprop.py

Jorrit Wronski

unread,
Jul 17, 2014, 5:51:04 AM7/17/14
to coolpro...@googlegroups.com

Hi,

there is also makefile for a static and a dynamic library. In the
wrappers folder
(https://github.com/ibell/coolprop/tree/master/wrappers), you can find
"SharedLibrary". This folder contains a makefile for Linux systems and
gives you the option to install a library

# The installation procedure should be as follows:
# 1) make
# 2) sudo make install


# Header files are going to be installed into
# /usr/local/include
# while the libraries will reside in
# /usr/local/lib

Regards,
Jorrit
> (github.com <http://github.com>) with the correct wrapper. After
> some trials, I read somewhere LibreOffice BASIC don't allow to
> call shared library function on Linux as it does on Windows. Its
> a pitty! :(
>
> By the way, I saw that CoolProp functions (dll) can be used with
> Scilab on Windows. Is it possible to use the shared library
> (libCoolProp.so) I compiled with Scilab on Linux? If possible,
> how could I do that?
>
> Cheers,
>
> Clodoaldo Carvalho.
>
> --
>
> Professor
>
> Federal University of Ceará
>
> Technology Center
>
> Dept. of Mechanical Engineering
>
> Fortaleza/CE-Brazil
>
>
>
> 2014-07-14 15:50 GMT-03:00 Ian Bell <ian.h...@gmail.com
> <mailto:ian.h...@gmail.com>>:
>
> I don't remember exactly, but I believe you need to run the
> makefile
> from the folder in which it is found. I can try to boot up
> my virtual
> box and take a look.
>
> On 7/14/14, Clodoaldo Carvalho <clod...@ufc.br
> <mailto:clod...@ufc.br>> wrote:
> > Hi Ian,
> >
> > Thanks for your help. I tried to compile the shared
> library from the source
> > coude (zip file) with the makefile you suggested. I put
> the makefile in the
> > '../coolprop-master' dir and changed the COOLPROPDIR
> accordingly, but I got
> > the following output: makefile:161: *** missing separator
> >
> > Any hints?
> >
> > Cheers,
> >
> > Clodoaldo Carvalho
> >
> > --
> >
> > Professor
> >
> > Federal University of Ceará
> >
> > Technology Center
> >
> > Dept. of Mechanical Engineering
> >
> > Fortaleza/CE-Brazil
> >
> >
> >
> > 2014-07-14 12:17 GMT-03:00 Ian Bell <ian.h...@gmail.com
> <mailto:ian.h...@gmail.com>>:
> >
> >> I am not sure it is possible at all to do what you want
> in Linux, I am
> >> not
> >> sure what the functionalities in LibreOffice are for
> calling shared
> >> libraries. Have you been able to get it working on windows?
> >>
> >> That said, it should be possible to compile a shared
> library for linux,
> >> the makefile is at
> >>
> https://github.com/ibell/coolprop/tree/master/wrappers/SharedLibrary
> .
> >> You will have to check out all of CoolProp, either using
> git or by
> >> downloading a zip file the source from
> >> https://github.com/ibell/coolprop/archive/master.zip
> >>
> >>
> >> On Mon, Jul 14, 2014 at 10:24 AM, Clodoaldo Carvalho <
> >> clodoal...@gmail.com
> <mailto:coolprop-users%2Bunsu...@googlegroups.com>.
> >>>
> >>> To post to this group, send email to
> coolpro...@googlegroups.com
> <mailto:coolpro...@googlegroups.com>.
> >>> Visit this group at
> http://groups.google.com/group/coolprop-users.
> >>> For more options, visit https://groups.google.com/d/optout.
> >>>
> >>
> >>
> >
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "coolprop-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to coolprop-user...@googlegroups.com
> <mailto:coolprop-user...@googlegroups.com>.
> To post to this group, send email to coolpro...@googlegroups.com
> <mailto:coolpro...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages