LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Make: Building project with different linker and compiler (https://www.linuxquestions.org/questions/linux-software-2/make-building-project-with-different-linker-and-compiler-885086/)

capo 06-07-2011 08:29 PM

Make: Building project with different linker and compiler
 
I am trying to recompile a large open source project with the Nvidia Cuda Compiler: 'nvcc' (http://en.wikipedia.org/wiki/CUDA).

nvcc supports all the compile flags that gcc does but not all of the linking options. This shouldn't be a problem however as nvcc generates object files that are compatible with gcc and I should hence be able to compile with nvcc and then link with gcc (linking against the CUDA library).

To compile with nvcc I use:

./configure CC=nvcc

Which successfully creates make files that use nvcc to compile. But the Configuration script does not seem to honor LD=gcc in the same way, ie:

./configure CC=nvcc LD=gcc

still tries to link everything with nvcc which promptly fails because nvcc does not support the option '-soname' without which the project will not link correctly.

What am I doing wrong? How can tell the config script to link with gcc?

Oliv' 06-08-2011 07:32 AM

Hello,

We have to know more about the project you are trying to compile. I bet that your problem is about how build system for this project has been written. Indeed to link the project they may have done something like: "$CC $LDFLAGS" and then it's up to CC to invoke the correct linker. Or maybe they did something like: LD=$CC which overwrite your settings and we can imagine a lot of other scenarii which could explain your problem.
So without digging into your project build system, you'll never know.

Kind regards

Oliv'


All times are GMT -5. The time now is 05:40 AM.