New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPsolver not working on ubuntu linux (libglpkjni_x64.so: undefined symbol: lib_set_fault_hook) #24

Closed
matthiaskoenig opened this Issue Jun 7, 2018 · 14 comments

Comments

Projects
None yet
3 participants
@matthiaskoenig
Collaborator

matthiaskoenig commented Jun 7, 2018

I added a simple test case for the solver in org.simulator.fba.CobraSolverTest.
When trying to run an optimization I get the following error:

org.simulator.fba.CobraSolverTest
/usr/lib/jvm/java-8-oracle/bin/java: symbol lookup error: /home/mkoenig/git/sbscl-shalin/libglpkjni_x64.so: undefined symbol: lib_set_fault_hook

Process finished with exit code 127

Do I need to install anything else? Copy glpk libraries somewhere?

@shalinshah1993

This comment has been minimized.

Show comment
Hide comment
@shalinshah1993

shalinshah1993 Jun 7, 2018

Owner
Owner

shalinshah1993 commented Jun 7, 2018

@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 7, 2018

Collaborator

So what do I have to add in addition to the jars which are in the repository? I am working outside of eclipse, i.e., either in the console or with idea intellj.

Collaborator

matthiaskoenig commented Jun 7, 2018

So what do I have to add in addition to the jars which are in the repository? I am working outside of eclipse, i.e., either in the console or with idea intellj.

@shalinshah1993

This comment has been minimized.

Show comment
Hide comment
@shalinshah1993

shalinshah1993 Jun 8, 2018

Owner

Try adding jar files to you classpath in IntelliJ. Right click on project > properties and add jar to classpath.

Owner

shalinshah1993 commented Jun 8, 2018

Try adding jar files to you classpath in IntelliJ. Right click on project > properties and add jar to classpath.

@niko-rodrigue

This comment has been minimized.

Show comment
Hide comment
@niko-rodrigue

niko-rodrigue Jun 8, 2018

Collaborator

This does look more like a linux libraries problem. Can you run:
ldd /home/mkoenig/git/sbscl-shalin/libglpkjni_x64.so

To see if you are missing some libraries. But the problem can be that you have different versions compared to the versions "libglpkjni_x64.so" was compiled against.

Collaborator

niko-rodrigue commented Jun 8, 2018

This does look more like a linux libraries problem. Can you run:
ldd /home/mkoenig/git/sbscl-shalin/libglpkjni_x64.so

To see if you are missing some libraries. But the problem can be that you have different versions compared to the versions "libglpkjni_x64.so" was compiled against.

@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 8, 2018

Collaborator
Collaborator

matthiaskoenig commented Jun 8, 2018

@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 11, 2018

Collaborator

Can anybody besides Shalin run the FBA simulations? If yes, what additional libraries/packages were installed, which paths set after cloning the repository? Did you install libglpk, libglpk-java and add them to the classpath?

Can anybody run the CobraSolverTest.java in the test-cases branch?
https://github.com/shalinshah1993/SBSCL/blob/test-cases/src/test/java/org/simulator/fba/CobraSolverTest.java

The libglpkjni_x64.so is generated dynamically when trying to run an FBA example. I.e. the file is generated while executing the java code.

ldd libglpkjni_x64.so 
	linux-vdso.so.1 =>  (0x00007fff4143b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5497a0a000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5497806000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f549743c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5498012000)
Collaborator

matthiaskoenig commented Jun 11, 2018

Can anybody besides Shalin run the FBA simulations? If yes, what additional libraries/packages were installed, which paths set after cloning the repository? Did you install libglpk, libglpk-java and add them to the classpath?

Can anybody run the CobraSolverTest.java in the test-cases branch?
https://github.com/shalinshah1993/SBSCL/blob/test-cases/src/test/java/org/simulator/fba/CobraSolverTest.java

The libglpkjni_x64.so is generated dynamically when trying to run an FBA example. I.e. the file is generated while executing the java code.

ldd libglpkjni_x64.so 
	linux-vdso.so.1 =>  (0x00007fff4143b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5497a0a000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5497806000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f549743c000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f5498012000)
@niko-rodrigue

This comment has been minimized.

Show comment
Hide comment
@niko-rodrigue

niko-rodrigue Jun 11, 2018

Collaborator
Collaborator

niko-rodrigue commented Jun 11, 2018

@niko-rodrigue

This comment has been minimized.

Show comment
Hide comment
@niko-rodrigue

niko-rodrigue Jun 11, 2018

Collaborator

After downloading by hand BFLog, I was able to run the test and I have the exact same error as you @matthiaskoenig. I am running Centos 7.5.1804.

Collaborator

niko-rodrigue commented Jun 11, 2018

After downloading by hand BFLog, I was able to run the test and I have the exact same error as you @matthiaskoenig. I am running Centos 7.5.1804.

@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 11, 2018

Collaborator

No, I did not see the certificate error so far.

Collaborator

matthiaskoenig commented Jun 11, 2018

No, I did not see the certificate error so far.

@niko-rodrigue

This comment has been minimized.

Show comment
Hide comment
@niko-rodrigue

niko-rodrigue Jun 11, 2018

Collaborator

The certificate problem seem to be avoided if you have already a copy of the jar in your local maven repo.
I managed to run the test. The src/lib/lp-lib/GLPKSolverPack.jar contain several so files which have a different size as the one generated in the root folder. From the scpsolver forum, I guess we should be using glpk version 4.65 that might be a solution to install it on /usr/lib (centos is using version 4.52).

But extracting the GLPKSolverPack.jar to a temp folder and setting LD_LIBRARY_PATH to include the folder that contain the so files, I was then able to run the tests.

Collaborator

niko-rodrigue commented Jun 11, 2018

The certificate problem seem to be avoided if you have already a copy of the jar in your local maven repo.
I managed to run the test. The src/lib/lp-lib/GLPKSolverPack.jar contain several so files which have a different size as the one generated in the root folder. From the scpsolver forum, I guess we should be using glpk version 4.65 that might be a solution to install it on /usr/lib (centos is using version 4.52).

But extracting the GLPKSolverPack.jar to a temp folder and setting LD_LIBRARY_PATH to include the folder that contain the so files, I was then able to run the tests.

@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 11, 2018

Collaborator

Hi @niko-rodrigue,

I tried the LD_LIBRARY_PATH solution (extract in temp dir and setting environment variable), but still get the same error. I can see that the correct library is tried (extracted directory library). Could it be that the library is only working on some linux systems?

/usr/lib/jvm/java-8-oracle/bin/java: symbol lookup error: /home/mkoenig/git/sbscl-shalin/src/lib/glpk/libglpkjni_x64.so: undefined symbol: lib_set_fault_hook
ldd libglpkjni_x64.so 
	linux-vdso.so.1 =>  (0x00007fffe71b0000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcf9ad7c000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcf9ab78000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcf9a7ae000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcf9b384000)
Collaborator

matthiaskoenig commented Jun 11, 2018

Hi @niko-rodrigue,

I tried the LD_LIBRARY_PATH solution (extract in temp dir and setting environment variable), but still get the same error. I can see that the correct library is tried (extracted directory library). Could it be that the library is only working on some linux systems?

/usr/lib/jvm/java-8-oracle/bin/java: symbol lookup error: /home/mkoenig/git/sbscl-shalin/src/lib/glpk/libglpkjni_x64.so: undefined symbol: lib_set_fault_hook
ldd libglpkjni_x64.so 
	linux-vdso.so.1 =>  (0x00007fffe71b0000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcf9ad7c000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcf9ab78000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcf9a7ae000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcf9b384000)
@matthiaskoenig

This comment has been minimized.

Show comment
Hide comment
@matthiaskoenig

matthiaskoenig Jun 11, 2018

Collaborator

Hannes just answered is issue on linux 64.

Hi Matthias,
I am currently working on bringing GLPKSolverPack up to date (v 4.65, and fixing errors) on all operating systems. While the GLPK solver pack has been working on Linux (specifically Ubuntu) forever, there seem to be problems on newer versions. Usually, errors like this occur due to some changes in the JNI interfaces...

This is the current status:
Win 64: works
Win 32: works
Linux 64: error
Linux 32: unknown, but who uses that anyway...
Mac 64: works
 

Collaborator

matthiaskoenig commented Jun 11, 2018

Hannes just answered is issue on linux 64.

Hi Matthias,
I am currently working on bringing GLPKSolverPack up to date (v 4.65, and fixing errors) on all operating systems. While the GLPK solver pack has been working on Linux (specifically Ubuntu) forever, there seem to be problems on newer versions. Usually, errors like this occur due to some changes in the JNI interfaces...

This is the current status:
Win 64: works
Win 32: works
Linux 64: error
Linux 32: unknown, but who uses that anyway...
Mac 64: works
 

matthiaskoenig added a commit that referenced this issue Jun 15, 2018

matthiaskoenig added a commit that referenced this issue Jun 15, 2018

Merge pull request #43 from shalinshah1993/test-cases
Partial fix of #24, LPsolver working for single simulation.
@shalinshah1993

This comment has been minimized.

Show comment
Hide comment
@shalinshah1993

shalinshah1993 Aug 6, 2018

Owner

This issue was moved to draeger-lab#5

Owner

shalinshah1993 commented Aug 6, 2018

This issue was moved to draeger-lab#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment