building LIGGGHTS as a shared library

Submitted by ljc on
Attachment Size
wei_xin_tu_pian_20180728173345.jpg 24.21 KB
mschramm

Hello,
foo refers to the the makefile you would like to use (for example auto)

so you could use the command
make -f Makefile.shlib auto

Sat, 28 Jul 2018 - 20:18 Permalink
ljc

In reply to by mschramm

Thank you very much for your suggestion, I have tried auto, but it still have some problem I do not know how to solve them.
make[1]: Entering directory '/home/ljc/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:815: *** 'Could not obtain VTK_MAJOR_VERSION. As AUTOINSTALL_VTK is not set to "ON" we cannot continue'。 停止。
make[1]: Leaving directory '/home/ljc/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile.shlib:62: recipe for target 'auto' failed
make: *** [auto] Error 2

Sat, 4 Aug 2018 - 06:49 Permalink
tjleps

In reply to by ljc

When you use makefile.auto for the first time it generates makefile.user. If you haven't installed and don't intend to use VTK in your application, change the line:
USE_VTK = "ON"
to:
USE_VTK = "OFF"
and recompile

Mon, 10 Dec 2018 - 17:42 Permalink
Nathan

Hi Arnom,

I tried to build shared library for LIGGGHTS3.20, following the guidance given in Manual.

make makeshlib
make -f Makefile.shlib fedora

Following error is shown:

/usr/bin/ld: angle.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
angle.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [shlib] Error 1
make[1]: Leaving directory `/home/.../LIGGGHTS3.20_LBM/src/Obj_shlib_fedora'
make: *** [fedora] Error 2

Do you have any ideas about this issue ?

Thank you

Nathan,

Sun, 9 Dec 2018 - 02:51 Permalink
Michelle Phan

In reply to by arnom

Hi Arnom,
I am new to LIGGGHTS and computer modelling. I have the same problem as above to build the shared library. Could you please give me a specific guide? I am not sure what you mean "add a -fPIC" ? In my Makefile.fedora , CCFLAGS = -02\ and LINKFLAGS = -02 , so does it mean I should change it to CCFLAGS = -02\ -fPIC and LINKFLAGS = -02 fPIC ?
Thank you

Mon, 25 Mar 2019 - 23:28 Permalink
Michelle Phan

Hi Arnom,
I am new to LIGGGHTS and computer modelling. I have the same problem as above to build the shared library. Could you please give me a specific guide? I am not sure what you mean "add a -fPIC" ? In my Makefile.fedora , CCFLAGS = -02\ and LINKFLAGS = -02 , so does it mean I should change it to CCFLAGS = -02\ -fPIC and LINKFLAGS = -02 fPIC ?
Thank you

Mon, 25 Mar 2019 - 23:26 Permalink

When I want to build my LIGGGHTS to be a shared library, I always got this problem. And I have install MPICH as the tutorials, but the problem is still exist. I am a new learner of liggghts, I will very appreciate if you can help me