Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compiling with threads and dlopen #2

@orbeckst

Description

@orbeckst

If you get errors on linking such as

/home/..../Library/Gromacs/versions/serial-4.5.5/lib/libgmx.a(vmddlopen.o): In function `vmddlclose': vmddlopen.c:(.text+0x1): undefined reference to `dlclose'
...
/home/..../Library/Gromacs/versions/serial-4.5.5/lib/libgmx.a(pthreads.o): In function `tMPI_Thread_key_delete': pthreads.c:(.text+0x5e6): undefined reference to `pthread_key_delete'

then that means that you have to add additional options to the CPPFLAG and especially LDFLAG variables in the Makefile:

  • add -pthread
  • add the dl library

The lines in the Makefile are:

 CPPFLAGS += -I$(INCLUDEDIR) -I$(GMX_INCLUDE_DIR) -pthread
 LDFLAGS  +=  -pthread -lm -ldl -L$(GMX_LIB_DIR) -lmd -lgmx

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions