core icon indicating copy to clipboard operation
core copied to clipboard

FindSimModSuite.cmake fails if there is no arch folders under "lib"

Open mortezah opened this issue 6 years ago • 4 comments

It seems that if simmetrix libraries are installed under the /lib without any arch folders present the cmake configuration fails. The reason seems to be that SIM_ARCHOS will get set to the wrong thing.

For example, if libSim*.a files are under simroot/lib then SIM_ARCHOS gets set to one of the .a files.

One simple solution seems to be to add the following lines here https://github.com/SCOREC/core/blob/f66ef983d00ce7c295cd2c090aae0644e893f87a/cmake/FindSimModSuite.cmake#L110

IF( IS_DIRECTORY "${SIMMODSUITE_INSTALL_DIR}/lib/${SIM_ARCHOS}" )
    MESSAGE(STATUS "Is a dir")
ELSE()
  MESSAGE(STATUS "Is not a dir")
  set(SIM_ARCHOS  "")
ENDIF()
message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}") 

@cwsmith can you tell me if there is a better way to do this? Otherwise, I can update the file and commit it to the repo.

mortezah avatar Nov 22 '19 15:11 mortezah

The easiest thing to do is to set CMAKE_PREFIX_PATH to point at the lib dirs. For example:

export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/path/to/simmodsuite/install/include:\
/path/to/simmodsuite/install/lib:\
/path/to/simmodsuite/install/lib/acisKrnl:\
/path/to/simmodsuite/install/lib/psKrnl

cwsmith avatar Nov 22 '19 15:11 cwsmith

@mortezah Did setting CMAKE_PREFIX_PATH work for you?

cwsmith avatar Dec 03 '19 19:12 cwsmith

@cwsmith I will test this on MIT machines today and let you know.

mortezah avatar Dec 04 '19 13:12 mortezah

@cwsmith It did not work, still the same problem.

The SCOREC install tree for SimModSuite has the following structure

| lib
|------ x64_rhel6_gcc44
|------ x64_rhel7_gcc48

and the purpose of SIM_ARCHOS is to pick one of those folders. At MIT the libraries (the .a file) are directly under /lib/, and the part of the FindSimModSuite that handles the directory structure picks one of the .a files. Specifically, if I print out SIM_ARCHOS I get the value libSimPartitionedMesh-mpi.a

mortezah avatar Dec 05 '19 16:12 mortezah