First parameter for call lammps running as a library

Dear lammps developers,

I have a question about running Lammps as a library. I try to modify the example COUPLE/simple.c and I want to transmit some parameters in lammps_open(…) command.
But I don’t know what I should put into the arg[0]. I tried to leave it NULL and got this error:

[Karen-HP:10600] *** Process received signal ***
[Karen-HP:10600] Signal: Segmentation fault (11)
[Karen-HP:10600] Signal code: Address not mapped (1)
[Karen-HP:10600] Failing at address: (nil)
[Karen-HP:10600] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f678cfdc340]
[Karen-HP:10600] [ 1] ./dyn_matrix() [0x536968]
[Karen-HP:10600] [ 2] ./dyn_matrix() [0x542819]
[Karen-HP:10600] [ 3] ./dyn_matrix() [0x4148e2]
[Karen-HP:10600] [ 4] ./dyn_matrix() [0x40ff4f]
[Karen-HP:10600] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f678b346ec5]
[Karen-HP:10600] [ 6] ./dyn_matrix() [0x40fc2f]
[Karen-HP:10600] *** End of error message ***

When I tried original “simple.c” code, it compiled and ran correctly, so it’s not a compilation error.

Could you give me an advice, please?

Sincerely,
Karen Fidanyan,
Master student at Moscow Inctitute of Physics and Technology,
Department of Molecular and Chemical Physics.

Dear lammps developers,

I have a question about running Lammps as a library. I try to modify the
example COUPLE/simple.c and I want to transmit some parameters in
lammps_open(...) command.
But I don't know what I should put into the arg[0]. I tried to leave it NULL
and got this error:

[Karen-HP:10600] *** Process received signal ***
[Karen-HP:10600] Signal: Segmentation fault (11)
[Karen-HP:10600] Signal code: Address not mapped (1)
[Karen-HP:10600] Failing at address: (nil)
[Karen-HP:10600] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)
[0x7f678cfdc340]
[Karen-HP:10600] [ 1] ./dyn_matrix() [0x536968]
[Karen-HP:10600] [ 2] ./dyn_matrix() [0x542819]
[Karen-HP:10600] [ 3] ./dyn_matrix() [0x4148e2]
[Karen-HP:10600] [ 4] ./dyn_matrix() [0x40ff4f]
[Karen-HP:10600] [ 5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f678b346ec5]
[Karen-HP:10600] [ 6] ./dyn_matrix() [0x40fc2f]
[Karen-HP:10600] *** End of error message ***

When I tried original "simple.c" code, it compiled and ran correctly, so
it's not a compilation error.

Could you give me an advice, please?

the arg array is used like the argv vector in C, i.e. the second
argument to the main() function.
thus arg[0] would be the name of the executable. it can be any valid
string (i.e. a pointer to char).

axel.

Thanks, mr. Kohlmeyer, it works!

Sincerely,
Karen Fidanyan

08.12.2015, 15:16, “Axel Kohlmeyer” <akohlmey@…24…>: