KevinCWLi/K600-ALBA

Fixing compile issues

Closed this issue · 10 comments

The fix that worked for the other K600 GEANT4 directory isn't working here. When the code tries to find the CADMesh include directories it gives

CADMESH_INCLUDE_DIRS:/usr/local/include

as the result. Trying to work out the problem.

My bodged fix commenting out the find_package line and adding:

include_directories(${cadmesh_DIR}/include)

adding

target_link_libraries(ALBA -L${cadmesh_DIR}/lib cadmesh assimp tet)

and commenting out

target_link_libraries(ALBA ${cadmesh_LIBRARIES})

in K600-ALBA CMakeLists.txt

This doesn't mean that the fundamental problem is fixed. The find_package command isn't working as expected and I'm just semi-manually working around.

You have to compile with -Dcadmesh_DIR=/path/to/CADMesh/installation if you want to do things this way.

OK. This is working on my laptop and Luna's Ubuntu laptop. The problem appears to be in a Cmake file (the one in this directory maybe but it might be that the one that it's loading from CADMesh is where the problem occurs) and we can fix it by manually specifying the path at cmake-time.

Going to see about getting her Mac working on it but probably next week. If it's looking for Geant4 libraries in the wrong place but there were multiple Geant4s present.

You have no idea of the relief. We looked like we'd won the world cup. 👯‍♂️

I followed another route to solve the "CADMesh.hh: No such file or directory". It is with the installation of CADMesh. I didn't change the CMakeLists.txt or the cmake compilation command as Phil suggested here simply because I tried it and it didn't work for me. I simply changed the cmake compilation of CADMesh as follows (from the CADMesh Issues discussion):

git clone https://github.com/christopherpoole/CADMesh.git
git checkout v1.1
cd CADMesh/
mkdir build
cd build
cmake .. -----> This is the part that I changed.
make -j8
sudo make install

From there on the installation of K600-ALBA proceeded as normal.

Not sure if this is still a problem on other systems but it's sorted on Ubuntu. Should be closed if it is resolved elsewhere (i.e. Mac).

FWIW, I don't think that the problem is fixed. The solution that you've used is to globally install the .hh file in some high-level directory but that still doesn't change the fact that the CADMesh Makefile is falling over when it tries to find the CADMesh install directory on a system.

As someone with a deep and abiding hatred of installations in high-level directories I refuse to accept this as a valid fudge. It works sometimes but generally it's not something that we should be doing.

I should get in touch with the Cmake people about this.

I'm still in favour of banning Apple generally and Apple iOS things in particular.

I'm just having to look at this again - CADMesh remains a total hairy mess, and the guy who is supposed to be supporting it never replies.

In this case, the problem is that the library files don't all go into the same directory. So you have to add the linking for the directories manually for the .so files to the cmake inputs:

target_link_libraries(K600 ${cadmesh_LIBRARIES})
target_link_libraries(K600 -L${cadmesh_DIR}/lib cadmesh assimp tet)
target_link_libraries(K600 -L${cadmesh_DIR} cadmesh assimp tet)

Unless the guy running CADMesh starts to support it properly then we will drop it from this project.