[CMake] Object file as first one in link.txt file

Juan Pablo Hernandez Vogt jphv at open-engineering.com
Thu Oct 17 09:21:33 EDT 2013


Hi Eike,

On 17 October 2013 12:32, Rolf Eike Beer <eike at sf-mail.de> wrote:

>
>> 1) CMake generates this link.txt (error when linking)
>> /usr/bin/c++       -lfusion_io -ladios -lmxml -lmpi -lopen-rte -lopen-pal
>> -lpthread -lstdc++ CMakeFiles/niio-main.dir/main.**cpp.o  -o niio-main
>> -rdynamic -L/home/testuser/dev/niio/lib
>> -L/home/testuser/dev/niio/**openmpi/lib
>>
>>
>> 2) Desired linking that works:
>> /usr/bin/c++       CMakeFiles/niio-main.dir/main.**cpp.o -lfusion_io
>> -ladios
>> -lmxml -lmpi -lopen-rte -lopen-pal -lpthread -lstdc++   -o niio-main
>> -rdynamic -L/home/testuser/dev/niio/lib
>> -L/home/testuser/dev/niio/**openmpi/lib
>>
>> cmake --help-module FindMPI
> cmake --help-module FindThreads (I doubt you need it, this is probably
> only a dependency of MPI which should take care for that itself)
> cmake --help-command link_directories
>
> To get -g: cmake -D CMAKE_BUILD_TYPE=Debug … (or =RelWithDebInfo).
>

On this example I'm using a specific MPI compiled for this example. I do
not want to used the MPI installed in the system.

I read the help for that commands (and many other things) and I didn't find
how to move link flags after the object file.

I'm lost. Where I must look for to understand how to modify the way
link.txt is generated? At least specify that my main.cpp.o must be the
first in the chain.



Best regards,

JP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131017/cfe60a9b/attachment.htm>


More information about the CMake mailing list