invalid fix command with rigid command

hello
i cant use rigid command in my simulation..
i want to simulate water cooper nanofluid in a channel with tow wall
but when i started my run total energy was a very big.. when i
visualize output xyz file by vmd i see molecules of water and
nanoparticle Percolate from wall..! i decide to use rigid command but
i cant...
this is part of my code that i use:

group hydrogen type 1
group oxygen type 2
group low type 3
group up type 4
group nanoparticle type 5

set group hydrogen type 1
set group oxygen type 2

set group low type 3
set group up type 4
set group nanoparticle type 5

group wall union low up
group flow union hydrogen oxygen nanoparticle

fix 1 up rigid group 1 up torque * off off off # for this command
lammps had an error invalid fix command

Did you compile LAMMPS with the rigid package?