Opened 9 years ago

Closed 9 years ago

#3332 closed defect (fixed)

ParModelica: libOMOCLRuntime.a not found on Linux

Reported by: gustaf Owned by: sjoelund.se
Priority: high Milestone:
Component: Build Environment Version: trunk
Keywords: Cc: mahge930

Description

It appears libOMOCLRuntime.a is put in wrong directory during build on GNU/Linux. While other libraries are put in $OPENMODELICAHOME/lib/{i686,x86_64}-linux-gnu/omc/lib during build, libOMOCLRuntime.a is placed in $OPENMODELICAHOME/omc/lib during build. When trying to use ParModelica, this will result in failures like:

$ omc oclTest.mos
true
true
""
Error processing file: oclTest.mos
Error: Error building simulator. Build log: g++ -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -c -o oclTest_test.o oclTest_test.c
g++ -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -c -o oclTest_test_records.o oclTest_test_records.c
gcc -shared -o oclTest_test.so oclTest_test.o oclTest_test_records.o  -I"/home/gustaf/src/OpenModelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -L"/home/gustaf/src/OpenModelica/build/lib/i686-linux-gnu/omc" -Wl,-rpath,'/home/gustaf/src/OpenModelica/build/lib/i686-linux-gnu/omc' -lOMOCLRuntime -lOpenCL   -lOpenModelicaRuntimeC -llapack -lblas -lm -lpthread -rdynamic -lm
/usr/bin/ld: cannot find -lOMOCLRuntime
collect2: error: ld returned 1 exit status
oclTest_test.makefile:18: recipe for target 'oclTest_test' failed
make: *** [oclTest_test] Error 1

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

A workaround is to add a symlink.

Change History (5)

comment:1 Changed 9 years ago by sjoelund.se

  • Owner changed from somebody to sjoelund.se
  • Status changed from new to accepted

comment:2 Changed 9 years ago by sjoelund.se

  • Milestone Future deleted
  • Resolution set to fixed
  • Status changed from accepted to closed

comment:3 Changed 9 years ago by gustaf

  • Resolution fixed deleted
  • Status changed from closed to reopened

I'm afraid the fix didn't fix the problem.

$ grep OMOCLRuntime make.log 
cp -rp libOMOCLRuntime.a /home/gusth/src/OpenModelica/build/lib/omc/

The culprit appears to be:

 $ grep -R OPENMODELICA_LIB OMCompiler/SimulationRuntime/ParModelica/
OMCompiler/SimulationRuntime/ParModelica/explicit/openclrt/Makefile.common:OPENMODELICA_LIB=$(TOP_BUILDDIR)/lib/omc/

Maybe a similar fix need to be applied there?

comment:5 Changed 9 years ago by mahge930

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.