static linking issues

In the process of trying to get the QUIP model driver I’m running into linking issues. QUIP exists as a library, which for now is not dynamically linked. Am I correct in believing that I have to switch to static linking?

I tried that, but I don’t know how to get the appropriate library flags to the final linking stage, and because the make system doesn’t show the commands being run, I can’t tell if I’m close. I put this in MODEL_DRIVERS/model_driver_QUIP/Makefile:

LDFLAGS += -L${QUIP_DIR}/build.{QUIP_ARCH} -L{QUIP_DIR}/FoX-4.0.3/objs.${QUIP_ARCH}/lib -lquip_core -lgap_predict -latoms -lFoX_sax -lFoX_wxml -lFoX_utils -lFoX_common -lFoX_fsys -framework Accelerate

but I have no idea if it’s either
being passed to the final linking and somehow the library is wrong,
or
if it’s just not being passed.

How do I go about figuring this out?

thanks,
Noam

Try the "make -n" technique

Ryan

make -n is helpful but not optimal, because it doesn’t actually do the compilation. I’ve found that just removing the ‘@’ symbol from the beginning of each compilation line in MAKE_SYSTEM/Makefile.Generic goes back to the normal output of commands from make. Is there any particular reason you silenced all those commands, and any chance you could just remove those ‘@’ signs? Or maybe have a debugging mode that uses a modified version of Makefile.Generic that doesn’t have them?

Noam

OK, back to the original question. I now have things compiling on Linux, but again, not linking. If I dynamic-load, it links OK, but then can’t run because it can’t find symbols that are in the QUIP static library. This is perhaps unsurprising.
When I switch to static-link or dynamic-link it fails to link, again because the QUIP libraries are not there.

I have the LDFLAGS += … line (in the MODEL_TESTS…Makefile which I copied from one of the examples) uncommented and set properly in MODEL_DRIVERS/model_driver_QUIP/Makefile, but it isn’t being used when linking the test program (I modified Makefile.Test and Makefile.Generic to confirm the linking commands that are being run):

g++ vc_forces_numer_deriv.o -L/home_radon/bernstei/src/work/OpenKIM/openkim-api-v1.4.0/KIM_API/ -lkim -lgfortran -ldl -o vc_forces_numer_deriv

Any ideas as to why my additional LDFLAGS aren’t being passed to the test lining?

Hi Noam,

I prefer to have the default be a cleaner output of the make system. However, I completely agree that it would be good to be able to easily change this...

I'm going to look to see if gnu make allows for an easy way to do this....

It's on my list...

Ryan

Hi Noam,

When I try the same thing (to the best of my understanding of what you have done) my updated LDFALGS is being used....

Can you copy in the explicit makefile you are using?

Ryan

I’ve attached the main Makefile.KIM_Config and the MODEL_DRIVERS/model_driver_QUIP/Makefile

If that’s not enough, let’s try to take this off-line, and I can post a summary for future reference when we’re done.

Noam

Makefile.txt (1.83 KB)

Makefile.KIM_Config.txt (1.43 KB)

I’ve attached the main Makefile.KIM_Config and the MODEL_DRIVERS/model_driver_QUIP/Makefile

If that’s not enough, let’s try to take this off-line, and I can post a summary for future reference when we’re done.

Noam

Makefile.txt (1.83 KB)

Makefile.KIM_Config.txt (1.43 KB)