Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoolProp compilation fails on Xubuntu, not finding CoolPropTools.h / not linking to target library #14

Closed
chermsdorf opened this issue Jul 11, 2018 · 15 comments

Comments

@chermsdorf
Copy link

Hello.

I am currently trying to compile the CoolProp library on a fresh Xubuntu intall (18.04) for use with OpenModelica.

My first approach was to clone ExternalMedia from "https://github.com/modelica/ExternalMedia" (using the --recursive parameter) and then to follow the ComileHowTwo-instructions, but the compilation terminates not finding CoolPropTools.h. Apparently the makefiles do not provide cloning of the missing files and I have no idea how to do so.

Then I realized that there is another repository at https://github.com/coolprop/ExternalMedia which seemed to be more up-to-date. So my second approach was to recursively clone from there and after struggling with the BuildLib-CMake.sh (had to re-link the shell from /bin/dash to /bin/bash since the pushd/popd commands were not found) the compilation got further but finally terminated with the following error

CMake Error at /home/christian/Dokumente/Git/ExternalMedia/externals/CoolProp.git CMakeLists.txt:422 (target_link_libraries):
Object library target "CoolProp" may not link to anything.

I have also tried using "make -f makefile library" according to the "CompilationHowTwo.txt" instructions, but the result is the same.

I have no idea how to fix this and would be very happy if you could give me a hint what else to try and which repository is the right one.

Best regards
Christian

@slamer59
Copy link

slamer59 commented Jul 11, 2018

Hello,
modelica/ExternalMedia should be the right repository to checkout.
First, checkout the branch https://github.com/modelica/ExternalMedia/tree/v.3.3.0-dev

Then, I forced to checkout the v6.1.0 tag from CoolProp:

In BuiildLib-CMake.bat

I change some lines:

if "%COOLP%"=="1" (
  echo ******************** CoolProp ******************************
  echo Sources are located in %CP_SRC%
  if exist "%CP_SRC%" (
    pushd "%CP_SRC%"
    git pull origin master
    git checkout v6.1.0
    git submodule init
    git submodule update
    :: git submodule foreach git pull origin master
	:: git checkout --no-track -B Branch_v6.1.0 v6.1.0 --
	:: git submodule update --init --recursive --force -- "externals/Catch"
    popd 
  ) else (
    git clone -b v6.1.0 --single-branch --recursive https://github.com/CoolProp/CoolProp.git "%CP_SRC%"
  )
)

I'm still confused on why master branch of coolprop doesnot work straight. I will make a pull when I get it right.

Regards

@chermsdorf
Copy link
Author

Hello Thomas,

firs of all thank you for your quick reply :)

How do I checkout the dev-branch? I did the following:

$ git clone --recursive https://github.com/modelica/ExternalMedia/tree/v.3.3.0-dev

which causes the following error message:
fatal: repository 'https://github.com/modelica/ExternalMedia/tree/v.3.3.0-dev/' not found

What am I doing wrong? Maybe I should add that this is my first time that I am using git.

Best regards,
Christian

@slamer59
Copy link

If you didn't clone the repository, the command should be:
git clone -b <remote_repo>

So something like:

git clone -b v.3.3.0-dev master

else (to change branch)
git checkout v.3.3.0-dev

Some git tutorial:
http://rogerdudler.github.io/git-guide/

@chermsdorf
Copy link
Author

Ok, I think that slowly I get an idea of how the git-stuff works...

I have done what you suggested and I think I managed to checkout the v.3.3.0-dev. Unfortunately the script hangs at git submodule update as I am asked to enter a username and password. Unfortunately my GitHub-credentials do not seem to be recognized.

Is there a special user/password available?

@slamer59
Copy link

Hi,
I experienced a problem with submodule Eigen.
I just change the repostory master to point to:
https://github.com/eigenteam/eigen-git-mirror/

So go to CoolProp/externals/Eigen to see where it points to:

git remote -v

if so you can by hand:

I think this is not done automatically because we point to v6.1.0 There is some issue changing Eigen repo in CoolProp.

Hope this help,
Thomas

@chermsdorf
Copy link
Author

Hi Thomas,

I have cloned the repo https://github.com/eigenteam/eigen-git-mirror/ and have then copied the entire directory ../eigen-git-mirror/Eigen to my ExternalMedia repo ../ExternalMedia/externals/CoolProp.git/externals/Eigen et voilà, git submodule update does not ask for a username any more.

Merci beaucoup !

However, compilation still fails, now with the following error:
IOError: [Errno 2] No such file or directory: u'/home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/externals/Catch/single_include/catch.hpp'
CoolProp/CMakeFiles/generate_headers.dir/build.make:57: recipe for target 'CoolProp/CMakeFiles/generate_headers' failed
make[2]: *** [CoolProp/CMakeFiles/generate_headers] Error 1
CMakeFiles/Makefile2:160: recipe for target 'CoolProp/CMakeFiles/generate_headers.dir/all' failed
make[1]: *** [CoolProp/CMakeFiles/generate_headers.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Apparently there are still files missing, like ../externals/CoolProp.git/externals/Catch/single_include/catch.hpp

Regards
Christian

@slamer59
Copy link

Hallo,
Maybe all dependencies have not been pulled ? I am clue less now. In CoolProp repo:

git submodule update --init --recursive

Username and password are requested because github can have private repo (I guess). Because it raise 404 error it tries to connect to a private repo.

The wrong path of Eigen in CoolProp have been corrected in master branch (CoolProp/CoolProp#1697).
Pointing to v6.1.0 raise this issue and a small hack is needed.

The good things to do, in my own opinion is to point to last release of CoolProp.

Regards

@chermsdorf
Copy link
Author

Hi Thomas,

actually the problem with the wrong Eigen repo had been solved by following your earlier suggestions regarding the eigen-git-mirror (as least this is my impression).

I still do not manage to get the missing ../externals/CoolProp.git/externals/Catch/single_include/catch.hpp. Is there a way to update the BuildLib script so that the missing files will be loaded?

Regards
Christian

@slamer59
Copy link

slamer59 commented Jul 12, 2018

I'm not expert of git and submodule. Please look at git documentation on this.
I would try:

git submodule update --init --recursive --force -- "externals/Catch"

or

git submodule foreach git pull origin master

If you plan to change BuildLib, I would say that make your own.

My opinion on this is to write one proper CMakeLists.txt to handle all architectures once and for all.
And then remove every .bat file, .sh, makefile

It is easier to maintain and cross-platform. But it requires some time to be bullet proof.

Regards,
Thomas

@chermsdorf
Copy link
Author

Hi Thomas,

thank you for your reply. Unfortunately things are still not working as new errors occur. Here is what I did:

I navigated to my local directory ../ExternalMedia/externals/CoolProp.git and executed

git submodule update --init --recursive --force -- "externals/Catch"

which results in the following immediate message:

submodul path: 'externals/Catch': '35f510545d55a831372d3113747bf1314ff4f2ef' checked out

but nothing else happens (or is this just my impression?).

Then i did

git submodule foreach git pull origin master

which among others reports the following:

...
delete mode 100644 single_include/catch.hpp
create mode 100644 single_include/catch2/catch.hpp
create mode 100644 single_include/catch2/catch_reporter_automake.hpp
create mode 100644 single_include/catch2/catch_reporter_tap.hpp
create mode 100644 single_include/catch2/catch_reporter_teamcity.hpp
create mode 100644 test_package/CMakeLists.txt
...

As you can see the file catch.hpp is now there but happens to be in a sub-directory named ../catch2/ and the installation fails again. I fixed this by simply moving the files from ../catch2/ one level up, executed my BuildLib-CMake.sh again and all seemed fine until a new error occurs:

[  0%] Built target generate_headers
Scanning dependencies of target CoolProp
[  1%] Building CXX object CoolProp/CMakeFiles/CoolProp.dir/src/AbstractState.cpp.o
In file included from /home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/include/CoolPropTools.h:15:0,
                 from /home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/include/CachedElement.h:11,
                 from /home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/include/AbstractState.h:11,
                 from /home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/src/AbstractState.cpp:14:
/home/christian/Dokumente/Git/modelica/ExternalMedia/externals/CoolProp.git/include/CPstrings.h:13:14: fatal error: fmt/format.h: file or directory not found
     #include "fmt/format.h" // For addition of the string formatting functions and macros from cppformat
              ^~~~~~~~~~~~~~
compilation terminated.

So this time the compilation cannot find the header file

fmt/format.h

Any idea?

Best regards
Christian

@slamer59
Copy link

slamer59 commented Jul 13, 2018

Install fmt lib:

git clone https://github.com/fmtlib/fmt.git
cd fmt
cmake CMakeLists.txt
make
sudo make install

@chermsdorf
Copy link
Author

Hi Thomas,
thank you for the instructions, fmt lib installed without problems.

However, now I get the next error:

fatal error: externals/rapidjson/include/rapidjson/rapidjson.h: file or directory not found
 #include "externals/rapidjson/include/rapidjson/rapidjson.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I assume that I have to install rapidjson in the same manner as I did for the fmt library but I am not sure which is the right repository. Would

git clone https://github.com/Tencent/rapidjson

be correct?

@slamer59
Copy link

Hi,
I think you still have a problem with externals import. I saw that fmt dependencies should be
externals\CoolProp.git\externals\cppformat
The same for rapidjson.

I would look if all submodule are properly pulled.
I don't know why this doesnot work for you.

Regards,
Thomas

@chermsdorf
Copy link
Author

Hi,
since I am not a software developer and this is my first experience with linux and also Git I actually have no clue how to look if all submodules are properly pulled... seems I am stuck here...

Nonetheless I very much appreciate your efforts so far!

Regards
Christian

@jowr
Copy link
Collaborator

jowr commented May 5, 2021

This is obsolete, v3.3.0 should fix this

@jowr jowr closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants