Hi, Just tested this and reproduced the error. More below... On Tue, Feb 17, 2009 at 3:17 PM, Sébastien Morin <sebastien.morin.1@xxxxxxxxx> wrote:
Hi, This code was absent from the repository, but I just added it. However, to reproduce the error, you must first use the command 'scons clean_all' to remove the compiled and temporary files. Then, when you use the command 'scons', you get the following message: ========== scons: Reading SConscript files ... scons: warning: Two different environments were specified for target maths_fns/c_chi2.os, but they appear to have the same action: $SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES File "/home/semor/pse-4/collaborations/relax/relax-1.3--relax_disp/sconstruct", line 517, in relax_disp scons: done reading SConscript files. scons: Building targets ... ########################### # Compiling the C modules # ########################### Building the relaxation dispersion curve fitting module 'maths_fns/relax_disp.so' gcc -o maths_fns/c_chi2.os -c -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -fPIC maths_fns/c_chi2.c gcc -o maths_fns/exponential.os -c -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -fPIC maths_fns/exponential.c gcc -o maths_fns/relax_fit.os -c -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -fPIC maths_fns/relax_fit.c gcc -o maths_fns/relax_fit.so -shared maths_fns/c_chi2.os maths_fns/exponential.os maths_fns/relax_fit.os gcc -o maths_fns/dispersion.os -c -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -fPIC maths_fns/dispersion.c gcc -o maths_fns/relax_disp.os -c -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include -fPIC maths_fns/relax_disp.c gcc -o maths_fns/relax_disp.so -shared maths_fns/c_chi2.os maths_fns/dispersion.os maths_fns/relax_disp.os scons: done building targets. ========== After this, both 'relax_disp.so' and 'relax_fit.so' are created. The 'relax_fit' code works fine, but it is difficult to tell whether the 'relax_disp' code works as it is still in development and very incomplete...
The files are both created on my system too. As the relax_disp module isn't complete, I would assume this doesn't work. But from the system tests, the relax_fit.so module is fine. This is just a warning and is nothing to worry about. The c_chi module should only be compiled once as the c_chi.o object is shared. The solution is quite simple here, and have just tested it. I would remove all the changes you made to sconstruct and start again. First rename the relax_fit() method to compile(). Then rename the self.relax_fit_object to self.compile_object. The in the compile() method, expand the file list to: # File names. files = ['c_chi2.c', 'exponential.c', 'relax_fit.c', 'dispersion.c', 'relax_disp.c'] Finally, you need to build both shared libraries by expanding this section of the function with: # Build the relaxation curve fitting module. self.relax_fit_object = env.SharedLibrary(target=dir + path.sep + 'relax_fit', source=nodes, SHLIBPREFIX=prefix, SHLIBSUFFIX=suffix) self.relax_fit_object.append(env.SharedLibrary(target=dir + path.sep + 'relax_disp', source=nodes, SHLIBPREFIX=prefix, SHLIBSUFFIX=suffix)) This will then be a very simple solution to this compilation issue and no warnings will be thrown. I hope this will be sufficient. Regards, Edward