Skip to content
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

how to run JSCIP test exmple on macbook #21

Closed
usact opened this issue Mar 11, 2020 · 40 comments
Closed

how to run JSCIP test exmple on macbook #21

usact opened this issue Mar 11, 2020 · 40 comments

Comments

@usact
Copy link

usact commented Mar 11, 2020

Hi, I am trying to run JSCIP on MacBook.

My OS :

 MacOS Mojave  (10.14.6)

My java:

openjdk version "1.8.0_222" 
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)

I downloaded SCIP from

  https://scip.zib.de/download.php?fname=scipoptsuite-6.0.2.tgz

and build it after installing gmp.
I just run :

  make 

and then

  make test

It works well on MacBook.

Then, I installed JSCIP on macbook by following this step by step:

  https://github.com/SCIP-Interfaces/JSCIPOpt/blob/master/INSTALL.md 

When I am running

java -cp scip.jar:examples.jar <"Linear" or "Quadratic" or "Read" or "Multiknapsack"> 

I got :

  -bash: syntax error near unexpected token `newline' 

When I run

    java -cp scip.jar:examples.jar "Linear" 

I got:

  A fatal error has been detected by the Java Runtime Environment:##  SIGSEGV (0xb) at pc=0x000000012138b319, pid=88434, tid=0x0000000000001d03

How can I run this correctly ?

Thanks

@mueldgog
Copy link
Collaborator

Can you compile the SCIP Optimization Suite via

cd scipoptsuite-6.0.2
mkdir build; cd build
cmake ..
make

and try again? Could you also add the full log when compiling JSCIPOpt? Thanks!

@usact
Copy link
Author

usact commented Mar 11, 2020

Hi, The log is to long, could you please let me know what parts are important ?

@mueldgog
Copy link
Collaborator

mueldgog commented Mar 11, 2020 via email

@usact
Copy link
Author

usact commented Mar 11, 2020

I have rebuilt JSCIPOpt.

I run:

  cmake .. -DSCIP_DIR=/Users/my_name/scipoptsuite-6.0.2/build > JSCIPOpt_cmake_log.txt

got:

  CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
   set the policy and suppress this warning.

   MACOSX_RPATH is not specified for the following targets:

   jscip

   This warning is for project developers.  Use -Wno-dev to suppress it.

then, I run

    make > JSCIPOpt_make_log.txt

I got:

   ld: warning: directory not found for option '-L/Users/my_name/git/JSCIPOpt/lib'

I am not sure why I got this.

The log files are attached.

thanks
JSCIPOpt_cmake_log.txt
JSCIPOpt_make_log.txt

@usact
Copy link
Author

usact commented Mar 11, 2020 via email

@usact
Copy link
Author

usact commented Mar 12, 2020

Did anybody find something wrong in the attached build log files ? thanks!

@mueldgog
Copy link
Collaborator

I just tested it on our Mac machine, which uses

java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
cmake -version
cmake version 3.13.3
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I get the same error message about "-L..." directory not found and the warning about MACOSX_RPATH, which don't seem relevant for the issue.

Anyway, executing

java -cp scip.jar:examples.jar "Linear"
feasible solution found by trivial heuristic after 0,0 seconds, objective value 2,000000e+00
presolving:
(round 1, fast)       1 del vars, 1 del conss, 0 add conss, 1 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
presolving (2 rounds: 2 fast, 1 medium, 1 exhaustive):
 2 deleted vars, 1 deleted constraints, 0 added constraints, 1 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
 0 implications, 0 cliques
presolved problem has 0 variables (0 bin, 0 int, 0 impl, 0 cont) and 0 constraints
transformed objective value is always integral (scale: 1)
Presolving Time: 0,00

 time | node  | left  |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|  dualbound   | primalbound  |  gap   
t 0,0s|     1 |     0 |     0 |     - | 544k|   0 |   - |   0 |   0 |   0 |   0 |   0 |   0 |   0 |-1,000000e+01 |-1,000000e+01 |   0,00%

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0,00
Solving Nodes      : 1
Primal Bound       : -1,00000000000000e+01 (2 solutions)
Dual Bound         : -1,00000000000000e+01
Gap                : 0,00 %
final gap = 0.0
solution (x,y) = (2.0, 4.0) with objective value -10.0
solution (x,y) = (2.0, 0.0) with objective value 2.0

works just fine. I'm not too familiar with Mac and Java, so I cannot help you too much with the issue.

@mueldgog
Copy link
Collaborator

Can you add all the output of the java -cp scip.jar:examples.jar "Linear", please? I think that after A fatal error has been detected by the Java Runtime Environment: there is also an error log mention. Please add the file to the issue.

@usact
Copy link
Author

usact commented Mar 13, 2020

Hi, 

I run the same command and got the error as follows.
I have attached the log report.

thanks


java -cp scip.jar:examples.jar "Linear"

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x000000010d4bd319, pid=52939, tid=0x0000000000002703

JRE version: OpenJDK Runtime Environment (8.0_222-b10) (build 1.8.0_222-b10)

Java VM: OpenJDK 64-Bit Server VM (25.222-b10 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [libawt_lwawt.dylib+0x48319] JNI_OnLoad+0x91

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

An error report file with more information is saved as:

/Users/my_name/git/JSCIPOpt/build/Release/hs_err_pid52939.log

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

Abort trap: 6


gcc --version

 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1

 Apple LLVM version 10.0.1 (clang-1001.0.46.4)

 Target: x86_64-apple-darwin18.7.0

 Thread model: posix

InstalledDir: /Library/Developer/CommandLineTools/usr/bin

cmake --version

  cmake version 3.16.5

  CMake suite maintained and supported by Kitware (kitware.com/cmake).

hs_err_pid52939.log

@mueldgog
Copy link
Collaborator

mueldgog commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020

yes, 
java -cp scip.jar:examples.jar "Linear" ulimit -c unlimited

The error log file is attached.
thanks, 
Jinxu
hs_err_pid54054.log

@usact
Copy link
Author

usact commented Mar 13, 2020 via email

@mueldgog
Copy link
Collaborator

I don't see the log, where is it? Sorry, I might not see it because I use my phone.

It looks like that you added the ulimit ... to the java command. Just to be sure: You need to set the ulimit first and then execute the java command.

@usact
Copy link
Author

usact commented Mar 13, 2020

i have run it:

$ulimit -c unlimited

and then
$ java -cp scip.jar:examples.jar "Linear"

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x0000000123280319, pid=55309, tid=0x0000000000002203

JRE version: OpenJDK Runtime Environment (8.0_222-b10) (build 1.8.0_222-b10)
Java VM: OpenJDK 64-Bit Server VM (25.222-b10 mixed mode bsd-amd64 compressed oops)
Problematic frame:
C [libawt_lwawt.dylib+0x48319] JNI_OnLoad+0x91

Core dump written. Default location: /cores/core or core.55309

An error report file with more information is saved as:
/Users/my_name/git/JSCIPOpt/build/Release/hs_err_pid55309.log

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

Abort trap: 6 (core dumped)

@usact
Copy link
Author

usact commented Mar 13, 2020 via email

@mueldgog
Copy link
Collaborator

mueldgog commented Mar 13, 2020 via email

@mueldgog
Copy link
Collaborator

Okay, I have seen that you added the log to a previous post.

@mueldgog
Copy link
Collaborator

Could it be that you have multiple versions of the java jdk installed? According to the error log, it looks like that there is some jenkins related jdk somewhere used. Could this be?

@usact
Copy link
Author

usact commented Mar 13, 2020

You mean this ?

Internal exceptions (2 events):

200 Event: 0.039 Thread 0x00007fc223006800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang /String;[BII)Ljava/lang/Class; name or signature does not match> (0x000000076ab07cb8) thrown at [/Users/jenkins/workspace/build- scripts/jobs/jdk8u/jdk8u-mac-x64-hotsp

201 Event: 0.039 Thread 0x00007fc223006800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lan g/Object;J)V name or signature does not match> (0x000000076ab07fa0) thrown at [/Users/jenkins/workspace/build-scripts/jobs/jdk8u /jdk8u-mac-x64-hotspot/workspace/build


@usact
Copy link
Author

usact commented Mar 13, 2020

But, I do not have this folder:
/Users/jenkins

on my laptop (macbook pro)

@usact
Copy link
Author

usact commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020

this is the latest error log file attached:

hs_err_pid55309.log

@usact
Copy link
Author

usact commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020

I do not see that I have multiple JDKs ?

@mueldgog
Copy link
Collaborator

mueldgog commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020

These are the values for the two env variables:

echo $PATH
/Users/my_name/.pyenv/versions/3.5.4/lib/python3.5/site-packages/pyspark:/Users/my_name/.jenv/versions/1.8/bin:/Users/my_name/Work_2019_7_18/tools/scala/scala-2.12.3/bin:/usr/local/Cellar/pyenv-virtualenv/1.1.3/shims:/Users/my_name/.pyenv/shims:/Users/my_name/.jenv/shims:/Users/my_name/.jenv/bin:/Users/my_name/.jenv/shims:/Users/my_name/Work_2019_7_18/tools/maven/apache-maven-3.6.1/bin:/Users/my_name/.jenv/bin:~/.pyenv/versions/3.5.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/scala/bin

$ echo $LD_LIBRARY_PATH

It is not set yet.

@usact
Copy link
Author

usact commented Mar 13, 2020

Also, I have installed "docker desktop" on my laptop. Hope that it is not a problem.

@usact
Copy link
Author

usact commented Mar 13, 2020

Also, I have tried to run a simple test Hello-World Java Program on my laptop. It works well.

@mueldgog
Copy link
Collaborator

mueldgog commented Mar 13, 2020 via email

@usact
Copy link
Author

usact commented Mar 13, 2020

You mean "Jenkins" could be a pseudo account that cause this problem ? The MacBook operating system assumes that the "Jenkins" account is calling JDK not my login-account ?

@usact
Copy link
Author

usact commented Mar 13, 2020

But, I never install "Jenkins".

@usact
Copy link
Author

usact commented Mar 13, 2020

If there is something wrong with JDK, why the test "HelloWord" java program works well under the same account on my laptop ? thanks !

@mueldgog
Copy link
Collaborator

I'm proposing to start from a "clean" account, i.e., that didn't install any additional packages. With this account, you try to make JSCIPOpt work and then you want to find out, which package breaks things.

Not very efficient, but I don't have a good suggestion on how to proceed with your issue.

@mueldgog
Copy link
Collaborator

If there is something wrong with JDK, why the test "HelloWord" java program works well under the same account on my laptop ? thanks !

I don't think that your java is generally broken, so this "Hello World" example doesn't mean much. I could imagine that the java native interface that is used to compile the code in JSCIPOpt is incompatible with the installed version of the JDK. Sorry, but I'm just guessing here.

@usact
Copy link
Author

usact commented Mar 13, 2020

"the java native interface that is used to compile the code in JSCIPOpt" should be the JDK that is installed on my laptop, right ?

@usact
Copy link
Author

usact commented Mar 13, 2020

My laptop is a business machine and I cannot create another "clean account" on it. Also, the installed packages are still there even though I can create the "clean account", right ?

@usact
Copy link
Author

usact commented Mar 14, 2020

I have two JDKS:
ls /Library/Java/JavaVirtualMachines
adoptopenjdk-8.jdk jdk-12.0.2.jdk

Should I remove "adoptopenjdk-8.jdk" ? and try jdk12 ?

Hi, I have removed "adoptopenjdk-8.jdk" and now it works. I can run $ java -cp scip.jar:examples.jar "Linear" and get results. I am using jdk 12.
When I run the same java program "Linear" from IntelliJ Idea, it works well. But, if I run it in debug mode, I got the similar error again.

Java VM: Java HotSpot(TM) 64-Bit Server VM (12.0.2+10, mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
Problematic frame:
C [libjscip.dylib+0x3764] Java_jscip_SCIPJNIJNI_SCIPconsGetName+0x4

No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

An error report file with more information is saved as:
/Users/my_name/Work_2019_7_18/projects/SCIP_test1/hs_err_pid76907.log

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

Disconnected from the target VM, address: '127.0.0.1:55368', transport: 'socket'

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

@usact
Copy link
Author

usact commented Mar 14, 2020

The "Linear.java" crashed when I run the following line in debug mode:
// release constraint (if not needed anymore)
scip.releaseCons(lincons);

Which version of JDK is more stable for JSCIP ? JDK10 is not supported so I use JDK12.

Also, "releaseVar" also crashed the program. It seems that if variables or constraints are released, it will cause crash ?

@kkofler
Copy link
Collaborator

kkofler commented Oct 16, 2024

Duplicate of #10.

@kkofler kkofler closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants