Open JAExposito opened 10 years ago
Well, you could start with the example build script on windows and make your own: https://github.com/ibell/coolprop/blob/master/Web/examples/C%2B%2B/run_example.bat
We are currently working on CoolProp version 5 which is more or less a 100% rewrite of CoolProp. Most of the high-level interface will be the same, you can take a look at https://github.com/CoolProp/CoolProp
Hi @JAExposito,
If you're familiar with cmake the following should work
cmake_minimum_required(VERSION 2.8)
project("coolprop")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/CoolProp")
FILE(GLOB coolprop_files "${CMAKE_CURRENT_SOURCE_DIR}/CoolProp/*.cpp")
add_library(coolprop STATIC ${coolprop_files})
This needs to be placed in a file called CMakeLists.txt in the location you extract coolprop. I have tested this religiously on Linux as part of my own projects, however your mileage may vary. Also it depends on what your trying to do.
I gather you want to make a c++ project, the best way to achieve this is to make a directory structure that has your code in src/ and coolprop in libs/coolprop and then make another CMakeLists.txt to build your own code. This is the way I tend to work because I'm using Windows msvc, Linux eclipse as well as a remote system.
I'll try to have a pull request for cmake tomorrow if that isn't too late?
Thank you for the prompt answers,
I am not familiar at all with cmake. As I could deduce, from both answers, the compilation of all the cpp functions in the source code toguether with the example code would work properly, does it make sense? So proceding in that way, I should create a makefile for all the functions and compile them with g++ ,or using cmake as Rod-Persky told, in which the code of the problem that I want to solve is included and compile them toguether.
What I want to do is solving a thermodynamics problem running a code in c++.
Thank you!
If could file an issue at https://github.com/CoolProp/CoolProp/issues to remind us, we could provide a simple example with CMake build to build the example in the new release of CoolProp - lets say for instance a four-component heat pump cycle.
What kind of thermodynamics problem do you have in mind?
On Mon, May 19, 2014 at 3:36 PM, JAExposito notifications@github.comwrote:
Thank you for the prompt answers,
I am not familiar at all with cmake. As I could deduce, from both answers, the compilation of all the cpp functions in the source code toguether with the example code would work properly, does it make sense? So proceding in that way, I should create a makefile for all the functions and compile them with g++ ,or using cmake as Rod-Persky told, in which the code of the problem that I want to solve is included and compile them toguether.
What I want to do is solving a thermodynamics problem running a code in c++.
Thank you!
— Reply to this email directly or view it on GitHubhttps://github.com/ibell/coolprop/issues/215#issuecomment-43503809 .
Hello Ian,
I will make an issue at github/CoolProp to remind a CMake file to build the example. Anyway I will be working on a makefile and I will let you know if I get it. The problem that I want to solve is the movement of a refrigerant in an ejector to be used as a compressor and then integrate this in a refrigeration or heat pump cycle. I already have the code properly working in Scilab in WIndows but I want to run it directly in c++.
Thank you in advance for your help.
José Expósito.
2014-05-22 0:26 GMT+02:00 Ian Bell notifications@github.com:
If could file an issue at https://github.com/CoolProp/CoolProp/issues to remind us, we could provide a simple example with CMake build to build the example in the new release of CoolProp - lets say for instance a four-component heat pump cycle.
What kind of thermodynamics problem do you have in mind?
On Mon, May 19, 2014 at 3:36 PM, JAExposito notifications@github.comwrote:
Thank you for the prompt answers,
I am not familiar at all with cmake. As I could deduce, from both answers, the compilation of all the cpp functions in the source code toguether with the example code would work properly, does it make sense? So proceding in that way, I should create a makefile for all the functions and compile them with g++ ,or using cmake as Rod-Persky told, in which the code of the problem that I want to solve is included and compile them toguether.
What I want to do is solving a thermodynamics problem running a code in c++.
Thank you!
— Reply to this email directly or view it on GitHub< https://github.com/ibell/coolprop/issues/215#issuecomment-43503809> .
— Reply to this email directly or view it on GitHubhttps://github.com/ibell/coolprop/issues/215#issuecomment-43822453 .
I've added a CMake example project in Web/examples/CMAKE. If you grab the CMake program you can have it automatically setup a workspace for MSVC. I've tested this on linux, and the makefile is derived from V5 which is tested with windows.
You should be able to copy and paste the project anywhere and have it work by copying the coolprop zip contents (or however you downloaded coolprop) into libs/CoolProp. You can then add any code into my_project and it should build properly... It might be helpful to read a quick tutorial on CMAKE to understand what is happening in the build process, but it should be seamless enough.
BTW: the code is here : https://github.com/Rod-Persky/coolprop/tree/example_cmake/Web/examples/CMAKE
I'll test on windows when I get on campus
Can you merge it back into main? And add a small README.md describing how it should be used?
On Fri, May 23, 2014 at 3:54 AM, Rod Persky notifications@github.comwrote:
BTW: the code is here : https://github.com/Rod-Persky/coolprop/tree/example_cmake/Web/examples/CMAKE
I'll test on windows when I get on campus
— Reply to this email directly or view it on GitHubhttps://github.com/ibell/coolprop/issues/215#issuecomment-43964176 .
Whoops sorry disregard the last comment about the merge - but a README would be nice
On Fri, May 23, 2014 at 8:49 AM, Ian Bell ian.h.bell@gmail.com wrote:
Can you merge it back into main? And add a small README.md describing how it should be used?
On Fri, May 23, 2014 at 3:54 AM, Rod Persky notifications@github.comwrote:
BTW: the code is here : https://github.com/Rod-Persky/coolprop/tree/example_cmake/Web/examples/CMAKE
I'll test on windows when I get on campus
— Reply to this email directly or view it on GitHubhttps://github.com/ibell/coolprop/issues/215#issuecomment-43964176 .
Yes, I was in a rush this morning when I got the ping reminding me to get it done. Sorry @JAExposito for being a bit slow, I'll add a readme when I get home in a few hours.
Hello,
I was wondering, if anybody have a make file for compiling the source code that appears in the example of documentation in www.coolprop.org. I tried with the one in wrappers/SharedLibrary but I was not able to make it works.
Any help or advice for using Coolprop in c++?
Thanks in advance.