ComputationalRadiationPhysics / clara2

Clara2 - a parallel classical radiation calculator based on Liénard-Wiechert potentials
GNU General Public License v3.0
13 stars 9 forks source link

issue with compiling + simple/fast example(s) #104

Open NIUaard opened 6 years ago

NIUaard commented 6 years ago

Hi, First thank you for making such a nice code available openly. As I was fiddling with the code I had two questions: -1 when I initially try to compile the code it keep complaining with the error message display at the end of this post. I had to fix this issue by replacing in ned_fft.hpp

    fftw_complex *in, *out;
  with the line in
    fftw_complex *input, *output;

and then it compiled fine. Was there a typo in the code or am I diong something wrong?

-2 I was wondering if you could share a simple example (for instance one of the ICS or SR example) with the distribution?

Thank you very much, -- Philippe Piot.

PS: initial error message:

[piot@gaea src]$ make
make -C ./include/
make[1]: Entering directory `/data1/aard/philippe/Codes/clara2/src/include'
g++ -Wall -O3 -c -lfftw3 -lm detector_fft.cpp
In file included from detector_fft.cpp:27:0:
ned_fft.hpp: In member function ?void ned_FFT<A, T>::fft(T*, long unsigned int)?:
ned_fft.hpp:103:5: error: ?input? was not declared in this scope
     input = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
     ^
ned_fft.hpp:103:5: note: suggested alternative:
In file included from detector_fft.cpp:24:0:
../settings.hpp:44:1: note:   ?param::input?
 {
 ^
In file included from detector_fft.cpp:27:0:
ned_fft.hpp:104:5: error: ?output? was not declared in this scope
     output = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
     ^
ned_fft.hpp: In instantiation of ?void ned_FFT<A, T>::fft(T*, long unsigned int) [with A = double; T = Vector<double, 3u>]?:
ned_fft.hpp:71:29:   required from ?ned_FFT<A, T>::ned_FFT(unsigned int, A*, T*) [with A = double; T = Vector<double, 3u>]?
detector_fft.cpp:155:57:   required from here
ned_fft.hpp:102:19: warning: unused variable ?in? [-Wunused-variable]
     fftw_complex *in, *out;
                   ^
ned_fft.hpp:102:24: warning: unused variable ?out? [-Wunused-variable]
     fftw_complex *in, *out;
                        ^
make[1]: *** [detector_fft.o] Error 1
make[1]: Leaving directory `/data1/aard/philippe/Codes/clara2/src/include'
make: *** [subsystem] Error 2
PrometheusPi commented 6 years ago

Dear @NIUaard,

regarding point 1: thank you very much for posting this bug. I assume you used the master version of the clara2 code. The bug has already been fixed with pull request #90 in the dev branch, but I did not port it yet back to the master branch. If you update to the dev branch, a couple or issues have already been solved there.

regarding point 2: I am currently working on setting up a test suite for the code (motivated by @QJohn2017 's issue with wrong scaling #96). This will generate generic trajectories for ICS (laser electron interaction) that can be used as example case. However, I am quite busy, thus this project gets delayed regularly.

Hopefully, there will be some more time till July when I will be able to add examples and test to the code.

Best, @PrometheusPi