[CMake] Searching for an undefined symbol in library

Marek Szuba marecki at gmail.com
Mon Nov 15 12:41:43 EST 2010


On Mon, 15 Nov 2010 12:00:04 -0500
cmake-request at cmake.org wrote:

> How do you select which of the libraries to use? Based on your
> Fortran compiler?
To be exact, based on the Fortran compiler used to build the
binary-only library.

> If so, I would check for the CMAKE_Fortran_COMPILER_ID variable and
> then go on from there.
Hmm. I've looked at CMakeDetermineFortranCompiler.cmake and it seems to
me the variable you've mentioned is related to the compiler available
in the system. Is that correct? If so, I am afraid this is not what I
need. Consider the following two scenarios:
 - the system has got both the GNU and the PGI compiler, the library
   variant is for the latter, CMake chooses the former. The program
   fails to build due to resolved PGI symbols;
 - the system has got both the GNU and the PGI compiler, the library
   variant is for the former, CMake chooses the latter. The program
   ends up unnecessarily linked against PGI run-time libraries,
   possibly causing binary-portability problems.

I am of course aware I could override CMake's detection routines to
choose a specific compiler. However, what I would like to do here is
have the selection happen automatically depending on the variant of the
binary-only library... Our user base is of the semi-educated sort,
familiar with the concept of building the software from source but
tending to run to us with questions when such building doesn't "just
go".

Cheers,
-- 
MS


More information about the CMake mailing list