Problems with compiling OMP package

Dear all,

I am currently trying to compile the OMP package and have the following problem:

I use the LAMMPS version from february 12th. I use Makefile.openmpi in which I
have added the -openmp flag to the compiler options.
I then typed make yes-user-omp and make openmpi.

I get a bunch of error messages that all look like this:

pair_tersoff_omp.o: In function `LAMMPS_NS::PairTersoffOMP::compute(int, int)':
pair_tersoff_omp.cpp:(.text+0x1bc): undefined reference to `__kmpc_global_thread_num'
pair_tersoff_omp.cpp:(.text+0x1cc): undefined reference to `__kmpc_ok_to_fork'
pair_tersoff_omp.cpp:(.text+0x206): undefined reference to `__kmpc_fork_call'
pair_tersoff_omp.cpp:(.text+0x21c): undefined reference to `__kmpc_serialized_parallel'
pair_tersoff_omp.cpp:(.text+0x25e): undefined reference to `__kmpc_end_serialized_parallel'
pair_tersoff_omp.cpp:(.text+0x2f4): undefined reference to `omp_get_thread_num'

How do I get rid of those errors? Will I have to modify the Makefile I am using?
Or is there something wrong with my openMP library?

Best,

Rolf

Dear all,

dear rolf,

I am currently trying to compile the OMP package and have the following problem:

I use the LAMMPS version from february 12th. I use Makefile.openmpi in which I
have added the -openmp flag to the compiler options.
I then typed make yes-user-omp and make openmpi.

I get a bunch of error messages that all look like this:

pair_tersoff_omp.o: In function `LAMMPS_NS::PairTersoffOMP::compute(int, int)':
pair_tersoff_omp.cpp:(.text+0x1bc): undefined reference to `__kmpc_global_thread_num'
pair_tersoff_omp.cpp:(.text+0x1cc): undefined reference to `__kmpc_ok_to_fork'
pair_tersoff_omp.cpp:(.text+0x206): undefined reference to `__kmpc_fork_call'
pair_tersoff_omp.cpp:(.text+0x21c): undefined reference to `__kmpc_serialized_parallel'
pair_tersoff_omp.cpp:(.text+0x25e): undefined reference to `__kmpc_end_serialized_parallel'
pair_tersoff_omp.cpp:(.text+0x2f4): undefined reference to `omp_get_thread_num'

How do I get rid of those errors? Will I have to modify the Makefile I am using?
Or is there something wrong with my openMP library?

this looks like you were using the -openmp flag for compilation, but
not for linking. both is needed.

btw: i'm in the process of making some significant upgrades to the
code in USER-OMP and including some additional optimizations. it may
be worth waiting a couple of days. by then this should be all
available through LAMMPS-ICMS and in the mainline code as soon as
steve gets to include the changes.

ciao,
    axel.