INFO: No output directory specified (--dir)
INFO: Using directory: "MAXIV_DanMAX_pxrd1d_20250501_060041"
INFO: Regenerating c-file: MAXIV_DanMAX_pxrd1d.c
WARNING: Full-path code-generator "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/bin/mcxtrace-antlr -I${MCXTRACE}" not found!!
WARNING: Attempting replacement by "mcxtrace-antlr -I${MCXTRACE}"
DEBUG: CMD: mcxtrace-antlr -I${MCXTRACE} -t -o ./MAXIV_DanMAX_pxrd1d.c MAXIV_DanMAX_pxrd1d.instr
2025-05-01 06:01:58.303 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:41 - sort includes :Monitor_nD(0):monitor_nd-lib :Monitor_nD(1):read_table-lib :Monitor_nD(2):interoff-lib :Filter(0):read_table-lib :Filter(1):interoff-lib :Bragg_crystal(0):perfect_crystals-lib :perfect_crystals-lib(0):read_table-lib :Mirror_toroid(0):read_table-lib :Mirror_toroid(1):reflectivity-lib :Mirror(0):read_table-lib :Mirror(1):reflectivity-lib :Mirror(2):interoff-lib :Lens_parab(0):read_table-lib :PowderN(0):read_table-lib :PowderN(1):interoff-lib
2025-05-01 06:01:58.303 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  monitor_nd-lib  interoff-lib
2025-05-01 06:01:58.303 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  interoff-lib  monitor_nd-lib
2025-05-01 06:01:58.304 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  monitor_nd-lib  interoff-lib  perfect_crystals-lib
2025-05-01 06:01:58.304 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  monitor_nd-lib  interoff-lib
2025-05-01 06:01:58.304 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  monitor_nd-lib  interoff-lib
2025-05-01 06:01:58.304 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  monitor_nd-lib  interoff-lib
2025-05-01 06:01:58.304 | DEBUG    | mccode_antlr.translators.c:sort_include_hierarchy:66 - sorted to read_table-lib  reflectivity-lib  perfect_crystals-lib  monitor_nd-lib  interoff-lib
The instrument has 25 parameters

-----------------------------------------------------------

Generating single GPU kernel or single CPU section layout:
-> SPLIT _instrument_var._parameters.SPLITS at component powdern

-----------------------------------------------------------

Generating GPU/CPU -DFUNNEL layout:
-> GPU kernel from component Origin
Component dmu is NOACC, CPUONLY=True
->FUNNEL mode enabled, SPLIT within buffer.
-> GPU kernel from component src_div
-> GPU kernel from component src_e
-> GPU kernel from component FM1
-> GPU kernel from component FM2
-> GPU kernel from component FEMM
-> GPU kernel from component oh0
-> GPU kernel from component oh_diamond_filter1
-> GPU kernel from component oh_premono_ap
-> GPU kernel from component DCM0_a0
-> GPU kernel from component DCM0
-> GPU kernel from component DCM0_a1
-> GPU kernel from component DCM1_a0
-> GPU kernel from component DCM1
-> GPU kernel from component DCM1_a1
-> GPU kernel from component DMM0_a0
-> GPU kernel from component DMM0a
-> GPU kernel from component DMM0b
-> GPU kernel from component DMM0_a1
-> GPU kernel from component DMM1_a0
-> GPU kernel from component DMM1
-> GPU kernel from component DMM1_a1
-> GPU kernel from component oh_postmono_ap
-> GPU kernel from component oh_postmono_psd
-> GPU kernel from component oh_postmono_div
-> GPU kernel from component oh_postmono_e
-> GPU kernel from component oh_2dcrl_guard
-> GPU kernel from component oh_2dcrl
-> GPU kernel from component oh_end_ap
-> GPU kernel from component eh0
-> GPU kernel from component eh_start_psd
-> GPU kernel from component eh_start_div
-> GPU kernel from component eh_start_e
-> GPU kernel from component Imaging
-> GPU kernel from component imaging_psd
-> GPU kernel from component imaging_div
-> GPU kernel from component imaging_e
-> GPU kernel from component pxrd_1d_pt
-> GPU kernel from component pxrd1_slit
-> GPU kernel from component pxrd1_psd
-> GPU kernel from component pxrd1_div
-> GPU kernel from component pxrd1_e
-> SPLIT within buffer at component powdern
-> GPU kernel from component beamstop1
-> GPU kernel from component mythen_0a
-> GPU kernel from component mythen_1a
-> GPU kernel from component mythen_2a
-> GPU kernel from component mythen_3a
-> GPU kernel from component mythen_4a
-> GPU kernel from component mythen_5a
-> GPU kernel from component mythen_6a
-> GPU kernel from component mythen_7a
-> GPU kernel from component mythen_8a
-> GPU kernel from component mythen_9a
-> GPU kernel from component mythen_10a
-> GPU kernel from component mythen_11a
-> GPU kernel from component mythen_12a
-> GPU kernel from component mythen_13a
-> GPU kernel from component mythen_14a
-> GPU kernel from component mythen_15a
-> GPU kernel from component mythen_16a
-> GPU kernel from component mythen_17a
-> GPU kernel from component mythen_18a
-> GPU kernel from component mythen_19a
-> GPU kernel from component mythen_20a
-> GPU kernel from component mythen_21a
-> GPU kernel from component mythen_22a
-> GPU kernel from component mythen_23a
-> GPU kernel from component dm_strip_banana
-> GPU kernel from component mythen_0
-> GPU kernel from component mythen_1
-> GPU kernel from component mythen_2
-> GPU kernel from component mythen_3
-> GPU kernel from component mythen_4
-> GPU kernel from component mythen_5
-> GPU kernel from component mythen_6
-> GPU kernel from component mythen_7
-> GPU kernel from component mythen_8
-> GPU kernel from component mythen_9
-> GPU kernel from component mythen_10
-> GPU kernel from component mythen_11
-> GPU kernel from component mythen_12
-> GPU kernel from component mythen_13
-> GPU kernel from component mythen_14
-> GPU kernel from component mythen_15
-> GPU kernel from component mythen_16
-> GPU kernel from component mythen_17
-> GPU kernel from component mythen_18
-> GPU kernel from component mythen_19
-> GPU kernel from component mythen_20
-> GPU kernel from component mythen_21
-> GPU kernel from component mythen_22
-> GPU kernel from component mythen_23
-> GPU kernel from component mythen_catchall

-----------------------------------------------------------
CFLAGS= -std=c99  -lgsl -lgslcblas  -DFUNNEL
DEBUG: CMD: mcxtrace-antlr -I${MCXTRACE} finished
INFO: Recompiling: ./MAXIV_DanMAX_pxrd1d.out
DEBUG: CMD: mpicc -o ./MAXIV_DanMAX_pxrd1d.out ./MAXIV_DanMAX_pxrd1d.c -lm -DUSE_MPI -lmpi -fno-PIC -fPIE -flto -O3 -mtune=native -march=native -fno-math-errno -ftree-vectorize -g -DNDEBUG -D_POSIX_SOURCE -std=c99 -lm -std=c99 -lgsl -lgslcblas -DFUNNEL
./MAXIV_DanMAX_pxrd1d.c:868:19: error: unknown type name 'randstate_t'
  868 | double _randnorm2(randstate_t* state);
      |                   ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:891:1: error: unknown type name 'randstate_t'
  891 | randstate_t _hash(randstate_t x);
      | ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:891:19: error: unknown type name 'randstate_t'
  891 | randstate_t _hash(randstate_t x);
      |                   ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:895:16: error: unknown type name 'randstate_t'
  895 | double _rand01(randstate_t* state);
      |                ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:897:17: error: unknown type name 'randstate_t'
  897 | double _randpm1(randstate_t* state);
      |                 ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:899:30: error: unknown type name 'randstate_t'
  899 | double _rand0max(double max, randstate_t* state);
      |                              ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:901:44: error: unknown type name 'randstate_t'
  901 | double _randminmax(double min, double max, randstate_t* state);
      |                                            ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:903:22: error: unknown type name 'randstate_t'
  903 | double _randtriangle(randstate_t* state);
      |                      ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function '_randvec_target_circle':
./MAXIV_DanMAX_pxrd1d.c:874:22: warning: implicit declaration of function '_rand0max'; did you mean 'rand0max'? [-Wimplicit-function-declaration]
  874 | #define rand0max(p1) _rand0max(p1, _particle->randstate)
      |                      ^~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5315:22: note: in expansion of macro 'rand0max'
 5315 |     theta = acos(1 - rand0max(2));
      |                      ^~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function '_randvec_target_rect_angular':
./MAXIV_DanMAX_pxrd1d.c:873:19: warning: implicit declaration of function '_randpm1'; did you mean 'randpm1'? [-Wimplicit-function-declaration]
  873 | #define randpm1() _randpm1(_particle->randstate)
      |                   ^~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5402:19: note: in expansion of macro 'randpm1'
 5402 |     phi   = width*randpm1()/2.0;
      |                   ^~~~~~~
./MAXIV_DanMAX_pxrd1d.c: At top level:
./MAXIV_DanMAX_pxrd1d.c:5768:1: error: unknown type name 'randstate_t'
 5768 | randstate_t _hash(randstate_t x) {
      | ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5768:19: error: unknown type name 'randstate_t'
 5768 | randstate_t _hash(randstate_t x) {
      |                   ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5781:18: error: unknown type name 'randstate_t'
 5781 | double _randnorm(randstate_t* state)
      |                  ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5809:19: error: unknown type name 'randstate_t'
 5809 | double _randnorm2(randstate_t* state) {
      |                   ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5820:22: error: unknown type name 'randstate_t'
 5820 | double _randtriangle(randstate_t* state) {
      |                      ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5825:16: error: unknown type name 'randstate_t'
 5825 | double _rand01(randstate_t* state) {
      |                ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5833:17: error: unknown type name 'randstate_t'
 5833 | double _randpm1(randstate_t* state) {
      |                 ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5841:30: error: unknown type name 'randstate_t'
 5841 | double _rand0max(double max, randstate_t* state) {
      |                              ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:5848:44: error: unknown type name 'randstate_t'
 5848 | double _randminmax(double min, double max, randstate_t* state) {
      |                                            ^~~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function 'cif2hkl':
./MAXIV_DanMAX_pxrd1d.c:8106:22: warning: implicit declaration of function 'Open_File' [-Wimplicit-function-declaration]
 8106 |     FILE *f_infile = Open_File(infile, "r", inpath);
      |                      ^~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:8106:22: warning: initialization of 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
./MAXIV_DanMAX_pxrd1d.c:8143:18: warning: initialization of 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 8143 |     FILE *file = Open_File(OUTFILE,"r", NULL);
      |                  ^~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: At top level:
./MAXIV_DanMAX_pxrd1d.c:9408:9: error: conflicting types for 'Open_File'; have 'FILE *(char *, const char *, char *)'
 9408 |   FILE *Open_File(char *File, const char *Mode, char *Path)
      |         ^~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:8106:22: note: previous implicit declaration of 'Open_File' with type 'int()'
 8106 |     FILE *f_infile = Open_File(infile, "r", inpath);
      |                      ^~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function 'reflec_Init':
./MAXIV_DanMAX_pxrd1d.c:10706:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
10706 |           int N=(unsigned int)((double **) pars)[0];
      |                 ^
./MAXIV_DanMAX_pxrd1d.c: In function 'off_display':
./MAXIV_DanMAX_pxrd1d.c:872:18: warning: implicit declaration of function '_rand01'; did you mean 'rand01'? [-Wimplicit-function-declaration]
  872 | #define rand01() _rand01(_particle->randstate)
      |                  ^~~~~~~
./MAXIV_DanMAX_pxrd1d.c:14892:24: note: in expansion of macro 'rand01'
14892 |         int drawthis = rand01() < ratio;
      |                        ^~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function 'class_Undulator_trace':
./MAXIV_DanMAX_pxrd1d.c:871:20: warning: implicit declaration of function '_randnorm2'; did you mean 'randnorm'? [-Wimplicit-function-declaration]
  871 | #define randnorm() _randnorm2(_particle->randstate)        // NOTE: can't use _randnorm on GPU
      |                    ^~~~~~~~~~
./MAXIV_DanMAX_pxrd1d.c:22450:25: note: in expansion of macro 'randnorm'
22450 |         double deltaEe=(randnorm()*dEe*Ee)+ Ee;
      |                         ^~~~~~~~
./MAXIV_DanMAX_pxrd1d.c: In function 'raytrace':
./MAXIV_DanMAX_pxrd1d.c:24970:5: error: unknown type name 'randstate_t'
24970 |     randstate_t randbackup = *_particle->randstate;
      |     ^~~~~~~~~~~
INFO: call to mpicc failed with Command 'mpicc -o ./MAXIV_DanMAX_pxrd1d.out ./MAXIV_DanMAX_pxrd1d.c -lm -DUSE_MPI -lmpi -fno-PIC -fPIE -flto -O3 -mtune=native -march=native -fno-math-errno -ftree-vectorize -g -DNDEBUG -D_POSIX_SOURCE -std=c99 -lm -std=c99 -lgsl -lgslcblas -DFUNNEL' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/tools/Python/mxrun/mxrun.py", line 616, in <module>
    main()
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/tools/Python/mxrun/mxrun.py", line 524, in main
    mcstas.prepare(options)
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/tools/Python/mxrun/mccode.py", line 311, in prepare
    Process(lexer.quote(options.cc)).run(args)
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/tools/Python/mxrun/mccode.py", line 77, in run
    raise err
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/tools/Python/mxrun/mccode.py", line 73, in run
    proc = run(command, shell=True, check=True, text=True, capture_output=pipe)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nexmap/pkwi/McXtrace/mcxtrace/3.x-dev/miniconda3/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'mpicc -o ./MAXIV_DanMAX_pxrd1d.out ./MAXIV_DanMAX_pxrd1d.c -lm -DUSE_MPI -lmpi -fno-PIC -fPIE -flto -O3 -mtune=native -march=native -fno-math-errno -ftree-vectorize -g -DNDEBUG -D_POSIX_SOURCE -std=c99 -lm -std=c99 -lgsl -lgslcblas -DFUNNEL' returned non-zero exit status 1.